/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import $protobuf from "protobufjs/minimal.js";

const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

function longToString(value, unsigned) {
	if (typeof value === "string") {
		return value;
	}
	if (typeof value === "number") {
		return String(value);
	}
	// Fast path: convert Long {low, high} directly via native BigInt
	// BigInt.toString() is a native C++ operation, much faster than Long's pure JS division loops
	if (value && typeof value.low === "number" && typeof value.high === "number") {
		const lo = BigInt(value.low >>> 0);
		const hi = BigInt(value.high >>> 0);
		const combined = (hi << 32n) | lo;
		if (!unsigned && value.high < 0) {
			return (combined - (1n << 64n)).toString();
		}
		return combined.toString();
	}
	return String(value);
}

function longToNumber(value, unsigned) {
	if (typeof value === "number") {
		return value;
	}
	if (typeof value === "string") {
		return Number(value);
	}
	// Fast path: convert Long {low, high} directly via native BigInt
	if (value && typeof value.low === "number" && typeof value.high === "number") {
		const lo = BigInt(value.low >>> 0);
		const hi = BigInt(value.high >>> 0);
		const combined = (hi << 32n) | lo;
		if (!unsigned && value.high < 0) {
			return Number(combined - (1n << 64n));
		}
		return Number(combined);
	}
	return Number(value);
}

export const proto = $root.proto = (() => {

    const proto = {};

    proto.ADVDeviceIdentity = (function() {

        function ADVDeviceIdentity(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ADVDeviceIdentity.prototype.rawId = null;
        ADVDeviceIdentity.prototype.timestamp = null;
        ADVDeviceIdentity.prototype.keyIndex = null;
        ADVDeviceIdentity.prototype.accountType = null;
        ADVDeviceIdentity.prototype.deviceType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVDeviceIdentity.prototype, "_rawId", {
            get: $util.oneOfGetter($oneOfFields = ["rawId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVDeviceIdentity.prototype, "_timestamp", {
            get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVDeviceIdentity.prototype, "_keyIndex", {
            get: $util.oneOfGetter($oneOfFields = ["keyIndex"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVDeviceIdentity.prototype, "_accountType", {
            get: $util.oneOfGetter($oneOfFields = ["accountType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVDeviceIdentity.prototype, "_deviceType", {
            get: $util.oneOfGetter($oneOfFields = ["deviceType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ADVDeviceIdentity.create = function create(properties) {
            return new ADVDeviceIdentity(properties);
        };

        ADVDeviceIdentity.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.rawId != null && Object.hasOwnProperty.call(m, "rawId"))
                w.uint32(8).uint32(m.rawId);
            if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                w.uint32(16).uint64(m.timestamp);
            if (m.keyIndex != null && Object.hasOwnProperty.call(m, "keyIndex"))
                w.uint32(24).uint32(m.keyIndex);
            if (m.accountType != null && Object.hasOwnProperty.call(m, "accountType"))
                w.uint32(32).int32(m.accountType);
            if (m.deviceType != null && Object.hasOwnProperty.call(m, "deviceType"))
                w.uint32(40).int32(m.deviceType);
            return w;
        };

        ADVDeviceIdentity.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVDeviceIdentity();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.rawId = r.uint32();
                        break;
                    }
                case 2: {
                        m.timestamp = r.uint64();
                        break;
                    }
                case 3: {
                        m.keyIndex = r.uint32();
                        break;
                    }
                case 4: {
                        m.accountType = r.int32();
                        break;
                    }
                case 5: {
                        m.deviceType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ADVDeviceIdentity.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ADVDeviceIdentity)
                return d;
            var m = new $root.proto.ADVDeviceIdentity();
            if (d.rawId != null) {
                m.rawId = d.rawId >>> 0;
            }
            if (d.timestamp != null) {
                if ($util.Long)
                    (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = true;
                else if (typeof d.timestamp === "string")
                    m.timestamp = parseInt(d.timestamp, 10);
                else if (typeof d.timestamp === "number")
                    m.timestamp = d.timestamp;
                else if (typeof d.timestamp === "object")
                    m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(true);
            }
            if (d.keyIndex != null) {
                m.keyIndex = d.keyIndex >>> 0;
            }
            switch (d.accountType) {
            default:
                if (typeof d.accountType === "number") {
                    m.accountType = d.accountType;
                    break;
                }
                break;
            case "E2EE":
            case 0:
                m.accountType = 0;
                break;
            case "HOSTED":
            case 1:
                m.accountType = 1;
                break;
            }
            switch (d.deviceType) {
            default:
                if (typeof d.deviceType === "number") {
                    m.deviceType = d.deviceType;
                    break;
                }
                break;
            case "E2EE":
            case 0:
                m.deviceType = 0;
                break;
            case "HOSTED":
            case 1:
                m.deviceType = 1;
                break;
            }
            return m;
        };

        ADVDeviceIdentity.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.rawId != null && m.hasOwnProperty("rawId")) {
                d.rawId = m.rawId;
                if (o.oneofs)
                    d._rawId = "rawId";
            }
            if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                if (typeof m.timestamp === "number")
                    d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                else
                    d.timestamp = o.longs === String ? longToString(m.timestamp, true) : o.longs === Number ? longToNumber(m.timestamp, true) : m.timestamp;
                if (o.oneofs)
                    d._timestamp = "timestamp";
            }
            if (m.keyIndex != null && m.hasOwnProperty("keyIndex")) {
                d.keyIndex = m.keyIndex;
                if (o.oneofs)
                    d._keyIndex = "keyIndex";
            }
            if (m.accountType != null && m.hasOwnProperty("accountType")) {
                d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType;
                if (o.oneofs)
                    d._accountType = "accountType";
            }
            if (m.deviceType != null && m.hasOwnProperty("deviceType")) {
                d.deviceType = o.enums === String ? $root.proto.ADVEncryptionType[m.deviceType] === undefined ? m.deviceType : $root.proto.ADVEncryptionType[m.deviceType] : m.deviceType;
                if (o.oneofs)
                    d._deviceType = "deviceType";
            }
            return d;
        };

        ADVDeviceIdentity.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ADVDeviceIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ADVDeviceIdentity";
        };

        return ADVDeviceIdentity;
    })();

    proto.ADVEncryptionType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "E2EE"] = 0;
        values[valuesById[1] = "HOSTED"] = 1;
        return values;
    })();

    proto.ADVKeyIndexList = (function() {

        function ADVKeyIndexList(p) {
            this.validIndexes = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ADVKeyIndexList.prototype.rawId = null;
        ADVKeyIndexList.prototype.timestamp = null;
        ADVKeyIndexList.prototype.currentIndex = null;
        ADVKeyIndexList.prototype.validIndexes = $util.emptyArray;
        ADVKeyIndexList.prototype.accountType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVKeyIndexList.prototype, "_rawId", {
            get: $util.oneOfGetter($oneOfFields = ["rawId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVKeyIndexList.prototype, "_timestamp", {
            get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVKeyIndexList.prototype, "_currentIndex", {
            get: $util.oneOfGetter($oneOfFields = ["currentIndex"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVKeyIndexList.prototype, "_accountType", {
            get: $util.oneOfGetter($oneOfFields = ["accountType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ADVKeyIndexList.create = function create(properties) {
            return new ADVKeyIndexList(properties);
        };

        ADVKeyIndexList.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.rawId != null && Object.hasOwnProperty.call(m, "rawId"))
                w.uint32(8).uint32(m.rawId);
            if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                w.uint32(16).uint64(m.timestamp);
            if (m.currentIndex != null && Object.hasOwnProperty.call(m, "currentIndex"))
                w.uint32(24).uint32(m.currentIndex);
            if (m.validIndexes != null && m.validIndexes.length) {
                w.uint32(34).fork();
                for (var i = 0; i < m.validIndexes.length; ++i)
                    w.uint32(m.validIndexes[i]);
                w.ldelim();
            }
            if (m.accountType != null && Object.hasOwnProperty.call(m, "accountType"))
                w.uint32(40).int32(m.accountType);
            return w;
        };

        ADVKeyIndexList.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVKeyIndexList();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.rawId = r.uint32();
                        break;
                    }
                case 2: {
                        m.timestamp = r.uint64();
                        break;
                    }
                case 3: {
                        m.currentIndex = r.uint32();
                        break;
                    }
                case 4: {
                        if (!(m.validIndexes && m.validIndexes.length))
                            m.validIndexes = [];
                        if ((t & 7) === 2) {
                            var c2 = r.uint32() + r.pos;
                            while (r.pos < c2)
                                m.validIndexes.push(r.uint32());
                        } else
                            m.validIndexes.push(r.uint32());
                        break;
                    }
                case 5: {
                        m.accountType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ADVKeyIndexList.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ADVKeyIndexList)
                return d;
            var m = new $root.proto.ADVKeyIndexList();
            if (d.rawId != null) {
                m.rawId = d.rawId >>> 0;
            }
            if (d.timestamp != null) {
                if ($util.Long)
                    (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = true;
                else if (typeof d.timestamp === "string")
                    m.timestamp = parseInt(d.timestamp, 10);
                else if (typeof d.timestamp === "number")
                    m.timestamp = d.timestamp;
                else if (typeof d.timestamp === "object")
                    m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(true);
            }
            if (d.currentIndex != null) {
                m.currentIndex = d.currentIndex >>> 0;
            }
            if (d.validIndexes) {
                if (!Array.isArray(d.validIndexes))
                    throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected");
                m.validIndexes = [];
                for (var i = 0; i < d.validIndexes.length; ++i) {
                    m.validIndexes[i] = d.validIndexes[i] >>> 0;
                }
            }
            switch (d.accountType) {
            default:
                if (typeof d.accountType === "number") {
                    m.accountType = d.accountType;
                    break;
                }
                break;
            case "E2EE":
            case 0:
                m.accountType = 0;
                break;
            case "HOSTED":
            case 1:
                m.accountType = 1;
                break;
            }
            return m;
        };

        ADVKeyIndexList.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.validIndexes = [];
            }
            if (m.rawId != null && m.hasOwnProperty("rawId")) {
                d.rawId = m.rawId;
                if (o.oneofs)
                    d._rawId = "rawId";
            }
            if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                if (typeof m.timestamp === "number")
                    d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                else
                    d.timestamp = o.longs === String ? longToString(m.timestamp, true) : o.longs === Number ? longToNumber(m.timestamp, true) : m.timestamp;
                if (o.oneofs)
                    d._timestamp = "timestamp";
            }
            if (m.currentIndex != null && m.hasOwnProperty("currentIndex")) {
                d.currentIndex = m.currentIndex;
                if (o.oneofs)
                    d._currentIndex = "currentIndex";
            }
            if (m.validIndexes && m.validIndexes.length) {
                d.validIndexes = [];
                for (var j = 0; j < m.validIndexes.length; ++j) {
                    d.validIndexes[j] = m.validIndexes[j];
                }
            }
            if (m.accountType != null && m.hasOwnProperty("accountType")) {
                d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType;
                if (o.oneofs)
                    d._accountType = "accountType";
            }
            return d;
        };

        ADVKeyIndexList.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ADVKeyIndexList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ADVKeyIndexList";
        };

        return ADVKeyIndexList;
    })();

    proto.ADVSignedDeviceIdentity = (function() {

        function ADVSignedDeviceIdentity(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ADVSignedDeviceIdentity.prototype.details = null;
        ADVSignedDeviceIdentity.prototype.accountSignatureKey = null;
        ADVSignedDeviceIdentity.prototype.accountSignature = null;
        ADVSignedDeviceIdentity.prototype.deviceSignature = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_details", {
            get: $util.oneOfGetter($oneOfFields = ["details"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_accountSignatureKey", {
            get: $util.oneOfGetter($oneOfFields = ["accountSignatureKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_accountSignature", {
            get: $util.oneOfGetter($oneOfFields = ["accountSignature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_deviceSignature", {
            get: $util.oneOfGetter($oneOfFields = ["deviceSignature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ADVSignedDeviceIdentity.create = function create(properties) {
            return new ADVSignedDeviceIdentity(properties);
        };

        ADVSignedDeviceIdentity.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.details != null && Object.hasOwnProperty.call(m, "details"))
                w.uint32(10).bytes(m.details);
            if (m.accountSignatureKey != null && Object.hasOwnProperty.call(m, "accountSignatureKey"))
                w.uint32(18).bytes(m.accountSignatureKey);
            if (m.accountSignature != null && Object.hasOwnProperty.call(m, "accountSignature"))
                w.uint32(26).bytes(m.accountSignature);
            if (m.deviceSignature != null && Object.hasOwnProperty.call(m, "deviceSignature"))
                w.uint32(34).bytes(m.deviceSignature);
            return w;
        };

        ADVSignedDeviceIdentity.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVSignedDeviceIdentity();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.details = r.bytes();
                        break;
                    }
                case 2: {
                        m.accountSignatureKey = r.bytes();
                        break;
                    }
                case 3: {
                        m.accountSignature = r.bytes();
                        break;
                    }
                case 4: {
                        m.deviceSignature = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ADVSignedDeviceIdentity.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ADVSignedDeviceIdentity)
                return d;
            var m = new $root.proto.ADVSignedDeviceIdentity();
            if (d.details != null) {
                if (typeof d.details === "string")
                    $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0);
                else if (d.details.length >= 0)
                    m.details = d.details;
            }
            if (d.accountSignatureKey != null) {
                if (typeof d.accountSignatureKey === "string")
                    $util.base64.decode(d.accountSignatureKey, m.accountSignatureKey = $util.newBuffer($util.base64.length(d.accountSignatureKey)), 0);
                else if (d.accountSignatureKey.length >= 0)
                    m.accountSignatureKey = d.accountSignatureKey;
            }
            if (d.accountSignature != null) {
                if (typeof d.accountSignature === "string")
                    $util.base64.decode(d.accountSignature, m.accountSignature = $util.newBuffer($util.base64.length(d.accountSignature)), 0);
                else if (d.accountSignature.length >= 0)
                    m.accountSignature = d.accountSignature;
            }
            if (d.deviceSignature != null) {
                if (typeof d.deviceSignature === "string")
                    $util.base64.decode(d.deviceSignature, m.deviceSignature = $util.newBuffer($util.base64.length(d.deviceSignature)), 0);
                else if (d.deviceSignature.length >= 0)
                    m.deviceSignature = d.deviceSignature;
            }
            return m;
        };

        ADVSignedDeviceIdentity.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.details != null && m.hasOwnProperty("details")) {
                d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details;
                if (o.oneofs)
                    d._details = "details";
            }
            if (m.accountSignatureKey != null && m.hasOwnProperty("accountSignatureKey")) {
                d.accountSignatureKey = o.bytes === String ? $util.base64.encode(m.accountSignatureKey, 0, m.accountSignatureKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignatureKey) : m.accountSignatureKey;
                if (o.oneofs)
                    d._accountSignatureKey = "accountSignatureKey";
            }
            if (m.accountSignature != null && m.hasOwnProperty("accountSignature")) {
                d.accountSignature = o.bytes === String ? $util.base64.encode(m.accountSignature, 0, m.accountSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignature) : m.accountSignature;
                if (o.oneofs)
                    d._accountSignature = "accountSignature";
            }
            if (m.deviceSignature != null && m.hasOwnProperty("deviceSignature")) {
                d.deviceSignature = o.bytes === String ? $util.base64.encode(m.deviceSignature, 0, m.deviceSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.deviceSignature) : m.deviceSignature;
                if (o.oneofs)
                    d._deviceSignature = "deviceSignature";
            }
            return d;
        };

        ADVSignedDeviceIdentity.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ADVSignedDeviceIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ADVSignedDeviceIdentity";
        };

        return ADVSignedDeviceIdentity;
    })();

    proto.ADVSignedDeviceIdentityHMAC = (function() {

        function ADVSignedDeviceIdentityHMAC(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ADVSignedDeviceIdentityHMAC.prototype.details = null;
        ADVSignedDeviceIdentityHMAC.prototype.hmac = null;
        ADVSignedDeviceIdentityHMAC.prototype.accountType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_details", {
            get: $util.oneOfGetter($oneOfFields = ["details"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_hmac", {
            get: $util.oneOfGetter($oneOfFields = ["hmac"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_accountType", {
            get: $util.oneOfGetter($oneOfFields = ["accountType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ADVSignedDeviceIdentityHMAC.create = function create(properties) {
            return new ADVSignedDeviceIdentityHMAC(properties);
        };

        ADVSignedDeviceIdentityHMAC.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.details != null && Object.hasOwnProperty.call(m, "details"))
                w.uint32(10).bytes(m.details);
            if (m.hmac != null && Object.hasOwnProperty.call(m, "hmac"))
                w.uint32(18).bytes(m.hmac);
            if (m.accountType != null && Object.hasOwnProperty.call(m, "accountType"))
                w.uint32(24).int32(m.accountType);
            return w;
        };

        ADVSignedDeviceIdentityHMAC.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVSignedDeviceIdentityHMAC();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.details = r.bytes();
                        break;
                    }
                case 2: {
                        m.hmac = r.bytes();
                        break;
                    }
                case 3: {
                        m.accountType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ADVSignedDeviceIdentityHMAC.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ADVSignedDeviceIdentityHMAC)
                return d;
            var m = new $root.proto.ADVSignedDeviceIdentityHMAC();
            if (d.details != null) {
                if (typeof d.details === "string")
                    $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0);
                else if (d.details.length >= 0)
                    m.details = d.details;
            }
            if (d.hmac != null) {
                if (typeof d.hmac === "string")
                    $util.base64.decode(d.hmac, m.hmac = $util.newBuffer($util.base64.length(d.hmac)), 0);
                else if (d.hmac.length >= 0)
                    m.hmac = d.hmac;
            }
            switch (d.accountType) {
            default:
                if (typeof d.accountType === "number") {
                    m.accountType = d.accountType;
                    break;
                }
                break;
            case "E2EE":
            case 0:
                m.accountType = 0;
                break;
            case "HOSTED":
            case 1:
                m.accountType = 1;
                break;
            }
            return m;
        };

        ADVSignedDeviceIdentityHMAC.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.details != null && m.hasOwnProperty("details")) {
                d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details;
                if (o.oneofs)
                    d._details = "details";
            }
            if (m.hmac != null && m.hasOwnProperty("hmac")) {
                d.hmac = o.bytes === String ? $util.base64.encode(m.hmac, 0, m.hmac.length) : o.bytes === Array ? Array.prototype.slice.call(m.hmac) : m.hmac;
                if (o.oneofs)
                    d._hmac = "hmac";
            }
            if (m.accountType != null && m.hasOwnProperty("accountType")) {
                d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType;
                if (o.oneofs)
                    d._accountType = "accountType";
            }
            return d;
        };

        ADVSignedDeviceIdentityHMAC.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ADVSignedDeviceIdentityHMAC.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ADVSignedDeviceIdentityHMAC";
        };

        return ADVSignedDeviceIdentityHMAC;
    })();

    proto.ADVSignedKeyIndexList = (function() {

        function ADVSignedKeyIndexList(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ADVSignedKeyIndexList.prototype.details = null;
        ADVSignedKeyIndexList.prototype.accountSignature = null;
        ADVSignedKeyIndexList.prototype.accountSignatureKey = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedKeyIndexList.prototype, "_details", {
            get: $util.oneOfGetter($oneOfFields = ["details"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedKeyIndexList.prototype, "_accountSignature", {
            get: $util.oneOfGetter($oneOfFields = ["accountSignature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ADVSignedKeyIndexList.prototype, "_accountSignatureKey", {
            get: $util.oneOfGetter($oneOfFields = ["accountSignatureKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ADVSignedKeyIndexList.create = function create(properties) {
            return new ADVSignedKeyIndexList(properties);
        };

        ADVSignedKeyIndexList.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.details != null && Object.hasOwnProperty.call(m, "details"))
                w.uint32(10).bytes(m.details);
            if (m.accountSignature != null && Object.hasOwnProperty.call(m, "accountSignature"))
                w.uint32(18).bytes(m.accountSignature);
            if (m.accountSignatureKey != null && Object.hasOwnProperty.call(m, "accountSignatureKey"))
                w.uint32(26).bytes(m.accountSignatureKey);
            return w;
        };

        ADVSignedKeyIndexList.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVSignedKeyIndexList();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.details = r.bytes();
                        break;
                    }
                case 2: {
                        m.accountSignature = r.bytes();
                        break;
                    }
                case 3: {
                        m.accountSignatureKey = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ADVSignedKeyIndexList.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ADVSignedKeyIndexList)
                return d;
            var m = new $root.proto.ADVSignedKeyIndexList();
            if (d.details != null) {
                if (typeof d.details === "string")
                    $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0);
                else if (d.details.length >= 0)
                    m.details = d.details;
            }
            if (d.accountSignature != null) {
                if (typeof d.accountSignature === "string")
                    $util.base64.decode(d.accountSignature, m.accountSignature = $util.newBuffer($util.base64.length(d.accountSignature)), 0);
                else if (d.accountSignature.length >= 0)
                    m.accountSignature = d.accountSignature;
            }
            if (d.accountSignatureKey != null) {
                if (typeof d.accountSignatureKey === "string")
                    $util.base64.decode(d.accountSignatureKey, m.accountSignatureKey = $util.newBuffer($util.base64.length(d.accountSignatureKey)), 0);
                else if (d.accountSignatureKey.length >= 0)
                    m.accountSignatureKey = d.accountSignatureKey;
            }
            return m;
        };

        ADVSignedKeyIndexList.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.details != null && m.hasOwnProperty("details")) {
                d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details;
                if (o.oneofs)
                    d._details = "details";
            }
            if (m.accountSignature != null && m.hasOwnProperty("accountSignature")) {
                d.accountSignature = o.bytes === String ? $util.base64.encode(m.accountSignature, 0, m.accountSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignature) : m.accountSignature;
                if (o.oneofs)
                    d._accountSignature = "accountSignature";
            }
            if (m.accountSignatureKey != null && m.hasOwnProperty("accountSignatureKey")) {
                d.accountSignatureKey = o.bytes === String ? $util.base64.encode(m.accountSignatureKey, 0, m.accountSignatureKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignatureKey) : m.accountSignatureKey;
                if (o.oneofs)
                    d._accountSignatureKey = "accountSignatureKey";
            }
            return d;
        };

        ADVSignedKeyIndexList.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ADVSignedKeyIndexList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ADVSignedKeyIndexList";
        };

        return ADVSignedKeyIndexList;
    })();

    proto.AIHomeState = (function() {

        function AIHomeState(p) {
            this.capabilityOptions = [];
            this.conversationOptions = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIHomeState.prototype.lastFetchTime = null;
        AIHomeState.prototype.capabilityOptions = $util.emptyArray;
        AIHomeState.prototype.conversationOptions = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIHomeState.prototype, "_lastFetchTime", {
            get: $util.oneOfGetter($oneOfFields = ["lastFetchTime"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIHomeState.create = function create(properties) {
            return new AIHomeState(properties);
        };

        AIHomeState.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.lastFetchTime != null && Object.hasOwnProperty.call(m, "lastFetchTime"))
                w.uint32(8).int64(m.lastFetchTime);
            if (m.capabilityOptions != null && m.capabilityOptions.length) {
                for (var i = 0; i < m.capabilityOptions.length; ++i)
                    $root.proto.AIHomeState.AIHomeOption.encode(m.capabilityOptions[i], w.uint32(18).fork()).ldelim();
            }
            if (m.conversationOptions != null && m.conversationOptions.length) {
                for (var i = 0; i < m.conversationOptions.length; ++i)
                    $root.proto.AIHomeState.AIHomeOption.encode(m.conversationOptions[i], w.uint32(26).fork()).ldelim();
            }
            return w;
        };

        AIHomeState.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIHomeState();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.lastFetchTime = r.int64();
                        break;
                    }
                case 2: {
                        if (!(m.capabilityOptions && m.capabilityOptions.length))
                            m.capabilityOptions = [];
                        m.capabilityOptions.push($root.proto.AIHomeState.AIHomeOption.decode(r, r.uint32()));
                        break;
                    }
                case 3: {
                        if (!(m.conversationOptions && m.conversationOptions.length))
                            m.conversationOptions = [];
                        m.conversationOptions.push($root.proto.AIHomeState.AIHomeOption.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIHomeState.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIHomeState)
                return d;
            var m = new $root.proto.AIHomeState();
            if (d.lastFetchTime != null) {
                if ($util.Long)
                    (m.lastFetchTime = $util.Long.fromValue(d.lastFetchTime)).unsigned = false;
                else if (typeof d.lastFetchTime === "string")
                    m.lastFetchTime = parseInt(d.lastFetchTime, 10);
                else if (typeof d.lastFetchTime === "number")
                    m.lastFetchTime = d.lastFetchTime;
                else if (typeof d.lastFetchTime === "object")
                    m.lastFetchTime = new $util.LongBits(d.lastFetchTime.low >>> 0, d.lastFetchTime.high >>> 0).toNumber();
            }
            if (d.capabilityOptions) {
                if (!Array.isArray(d.capabilityOptions))
                    throw TypeError(".proto.AIHomeState.capabilityOptions: array expected");
                m.capabilityOptions = [];
                for (var i = 0; i < d.capabilityOptions.length; ++i) {
                    if (typeof d.capabilityOptions[i] !== "object")
                        throw TypeError(".proto.AIHomeState.capabilityOptions: object expected");
                    m.capabilityOptions[i] = $root.proto.AIHomeState.AIHomeOption.fromObject(d.capabilityOptions[i]);
                }
            }
            if (d.conversationOptions) {
                if (!Array.isArray(d.conversationOptions))
                    throw TypeError(".proto.AIHomeState.conversationOptions: array expected");
                m.conversationOptions = [];
                for (var i = 0; i < d.conversationOptions.length; ++i) {
                    if (typeof d.conversationOptions[i] !== "object")
                        throw TypeError(".proto.AIHomeState.conversationOptions: object expected");
                    m.conversationOptions[i] = $root.proto.AIHomeState.AIHomeOption.fromObject(d.conversationOptions[i]);
                }
            }
            return m;
        };

        AIHomeState.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.capabilityOptions = [];
                d.conversationOptions = [];
            }
            if (m.lastFetchTime != null && m.hasOwnProperty("lastFetchTime")) {
                if (typeof m.lastFetchTime === "number")
                    d.lastFetchTime = o.longs === String ? String(m.lastFetchTime) : m.lastFetchTime;
                else
                    d.lastFetchTime = o.longs === String ? longToString(m.lastFetchTime) : o.longs === Number ? longToNumber(m.lastFetchTime) : m.lastFetchTime;
                if (o.oneofs)
                    d._lastFetchTime = "lastFetchTime";
            }
            if (m.capabilityOptions && m.capabilityOptions.length) {
                d.capabilityOptions = [];
                for (var j = 0; j < m.capabilityOptions.length; ++j) {
                    d.capabilityOptions[j] = $root.proto.AIHomeState.AIHomeOption.toObject(m.capabilityOptions[j], o);
                }
            }
            if (m.conversationOptions && m.conversationOptions.length) {
                d.conversationOptions = [];
                for (var j = 0; j < m.conversationOptions.length; ++j) {
                    d.conversationOptions[j] = $root.proto.AIHomeState.AIHomeOption.toObject(m.conversationOptions[j], o);
                }
            }
            return d;
        };

        AIHomeState.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIHomeState.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIHomeState";
        };

        AIHomeState.AIHomeOption = (function() {

            function AIHomeOption(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIHomeOption.prototype.type = null;
            AIHomeOption.prototype.title = null;
            AIHomeOption.prototype.promptText = null;
            AIHomeOption.prototype.sessionId = null;
            AIHomeOption.prototype.imageWdsIdentifier = null;
            AIHomeOption.prototype.imageTintColor = null;
            AIHomeOption.prototype.imageBackgroundColor = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIHomeOption.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIHomeOption.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIHomeOption.prototype, "_promptText", {
                get: $util.oneOfGetter($oneOfFields = ["promptText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIHomeOption.prototype, "_sessionId", {
                get: $util.oneOfGetter($oneOfFields = ["sessionId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIHomeOption.prototype, "_imageWdsIdentifier", {
                get: $util.oneOfGetter($oneOfFields = ["imageWdsIdentifier"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIHomeOption.prototype, "_imageTintColor", {
                get: $util.oneOfGetter($oneOfFields = ["imageTintColor"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIHomeOption.prototype, "_imageBackgroundColor", {
                get: $util.oneOfGetter($oneOfFields = ["imageBackgroundColor"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIHomeOption.create = function create(properties) {
                return new AIHomeOption(properties);
            };

            AIHomeOption.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(8).int32(m.type);
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(18).string(m.title);
                if (m.promptText != null && Object.hasOwnProperty.call(m, "promptText"))
                    w.uint32(26).string(m.promptText);
                if (m.sessionId != null && Object.hasOwnProperty.call(m, "sessionId"))
                    w.uint32(34).string(m.sessionId);
                if (m.imageWdsIdentifier != null && Object.hasOwnProperty.call(m, "imageWdsIdentifier"))
                    w.uint32(42).string(m.imageWdsIdentifier);
                if (m.imageTintColor != null && Object.hasOwnProperty.call(m, "imageTintColor"))
                    w.uint32(50).string(m.imageTintColor);
                if (m.imageBackgroundColor != null && Object.hasOwnProperty.call(m, "imageBackgroundColor"))
                    w.uint32(58).string(m.imageBackgroundColor);
                return w;
            };

            AIHomeOption.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIHomeState.AIHomeOption();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.type = r.int32();
                            break;
                        }
                    case 2: {
                            m.title = r.string();
                            break;
                        }
                    case 3: {
                            m.promptText = r.string();
                            break;
                        }
                    case 4: {
                            m.sessionId = r.string();
                            break;
                        }
                    case 5: {
                            m.imageWdsIdentifier = r.string();
                            break;
                        }
                    case 6: {
                            m.imageTintColor = r.string();
                            break;
                        }
                    case 7: {
                            m.imageBackgroundColor = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIHomeOption.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIHomeState.AIHomeOption)
                    return d;
                var m = new $root.proto.AIHomeState.AIHomeOption();
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "PROMPT":
                case 0:
                    m.type = 0;
                    break;
                case "CREATE_IMAGE":
                case 1:
                    m.type = 1;
                    break;
                case "ANIMATE_PHOTO":
                case 2:
                    m.type = 2;
                    break;
                case "ANALYZE_FILE":
                case 3:
                    m.type = 3;
                    break;
                }
                if (d.title != null) {
                    m.title = String(d.title);
                }
                if (d.promptText != null) {
                    m.promptText = String(d.promptText);
                }
                if (d.sessionId != null) {
                    m.sessionId = String(d.sessionId);
                }
                if (d.imageWdsIdentifier != null) {
                    m.imageWdsIdentifier = String(d.imageWdsIdentifier);
                }
                if (d.imageTintColor != null) {
                    m.imageTintColor = String(d.imageTintColor);
                }
                if (d.imageBackgroundColor != null) {
                    m.imageBackgroundColor = String(d.imageBackgroundColor);
                }
                return m;
            };

            AIHomeOption.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.AIHomeState.AIHomeOption.AIHomeActionType[m.type] === undefined ? m.type : $root.proto.AIHomeState.AIHomeOption.AIHomeActionType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.promptText != null && m.hasOwnProperty("promptText")) {
                    d.promptText = m.promptText;
                    if (o.oneofs)
                        d._promptText = "promptText";
                }
                if (m.sessionId != null && m.hasOwnProperty("sessionId")) {
                    d.sessionId = m.sessionId;
                    if (o.oneofs)
                        d._sessionId = "sessionId";
                }
                if (m.imageWdsIdentifier != null && m.hasOwnProperty("imageWdsIdentifier")) {
                    d.imageWdsIdentifier = m.imageWdsIdentifier;
                    if (o.oneofs)
                        d._imageWdsIdentifier = "imageWdsIdentifier";
                }
                if (m.imageTintColor != null && m.hasOwnProperty("imageTintColor")) {
                    d.imageTintColor = m.imageTintColor;
                    if (o.oneofs)
                        d._imageTintColor = "imageTintColor";
                }
                if (m.imageBackgroundColor != null && m.hasOwnProperty("imageBackgroundColor")) {
                    d.imageBackgroundColor = m.imageBackgroundColor;
                    if (o.oneofs)
                        d._imageBackgroundColor = "imageBackgroundColor";
                }
                return d;
            };

            AIHomeOption.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIHomeOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIHomeState.AIHomeOption";
            };

            AIHomeOption.AIHomeActionType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "PROMPT"] = 0;
                values[valuesById[1] = "CREATE_IMAGE"] = 1;
                values[valuesById[2] = "ANIMATE_PHOTO"] = 2;
                values[valuesById[3] = "ANALYZE_FILE"] = 3;
                return values;
            })();

            return AIHomeOption;
        })();

        return AIHomeState;
    })();

    proto.AIQueryFanout = (function() {

        function AIQueryFanout(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIQueryFanout.prototype.messageKey = null;
        AIQueryFanout.prototype.message = null;
        AIQueryFanout.prototype.timestamp = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIQueryFanout.prototype, "_messageKey", {
            get: $util.oneOfGetter($oneOfFields = ["messageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIQueryFanout.prototype, "_message", {
            get: $util.oneOfGetter($oneOfFields = ["message"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIQueryFanout.prototype, "_timestamp", {
            get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIQueryFanout.create = function create(properties) {
            return new AIQueryFanout(properties);
        };

        AIQueryFanout.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.messageKey != null && Object.hasOwnProperty.call(m, "messageKey"))
                $root.proto.MessageKey.encode(m.messageKey, w.uint32(10).fork()).ldelim();
            if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                $root.proto.Message.encode(m.message, w.uint32(18).fork()).ldelim();
            if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                w.uint32(24).int64(m.timestamp);
            return w;
        };

        AIQueryFanout.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIQueryFanout();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.messageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.message = $root.proto.Message.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.timestamp = r.int64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIQueryFanout.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIQueryFanout)
                return d;
            var m = new $root.proto.AIQueryFanout();
            if (d.messageKey != null) {
                if (typeof d.messageKey !== "object")
                    throw TypeError(".proto.AIQueryFanout.messageKey: object expected");
                m.messageKey = $root.proto.MessageKey.fromObject(d.messageKey);
            }
            if (d.message != null) {
                if (typeof d.message !== "object")
                    throw TypeError(".proto.AIQueryFanout.message: object expected");
                m.message = $root.proto.Message.fromObject(d.message);
            }
            if (d.timestamp != null) {
                if ($util.Long)
                    (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                else if (typeof d.timestamp === "string")
                    m.timestamp = parseInt(d.timestamp, 10);
                else if (typeof d.timestamp === "number")
                    m.timestamp = d.timestamp;
                else if (typeof d.timestamp === "object")
                    m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
            }
            return m;
        };

        AIQueryFanout.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.messageKey != null && m.hasOwnProperty("messageKey")) {
                d.messageKey = $root.proto.MessageKey.toObject(m.messageKey, o);
                if (o.oneofs)
                    d._messageKey = "messageKey";
            }
            if (m.message != null && m.hasOwnProperty("message")) {
                d.message = $root.proto.Message.toObject(m.message, o);
                if (o.oneofs)
                    d._message = "message";
            }
            if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                if (typeof m.timestamp === "number")
                    d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                else
                    d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                if (o.oneofs)
                    d._timestamp = "timestamp";
            }
            return d;
        };

        AIQueryFanout.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIQueryFanout.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIQueryFanout";
        };

        return AIQueryFanout;
    })();

    proto.AIRegenerateMetadata = (function() {

        function AIRegenerateMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRegenerateMetadata.prototype.messageKey = null;
        AIRegenerateMetadata.prototype.responseTimestampMs = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRegenerateMetadata.prototype, "_messageKey", {
            get: $util.oneOfGetter($oneOfFields = ["messageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRegenerateMetadata.prototype, "_responseTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["responseTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRegenerateMetadata.create = function create(properties) {
            return new AIRegenerateMetadata(properties);
        };

        AIRegenerateMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.messageKey != null && Object.hasOwnProperty.call(m, "messageKey"))
                $root.proto.MessageKey.encode(m.messageKey, w.uint32(10).fork()).ldelim();
            if (m.responseTimestampMs != null && Object.hasOwnProperty.call(m, "responseTimestampMs"))
                w.uint32(16).int64(m.responseTimestampMs);
            return w;
        };

        AIRegenerateMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRegenerateMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.messageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.responseTimestampMs = r.int64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRegenerateMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRegenerateMetadata)
                return d;
            var m = new $root.proto.AIRegenerateMetadata();
            if (d.messageKey != null) {
                if (typeof d.messageKey !== "object")
                    throw TypeError(".proto.AIRegenerateMetadata.messageKey: object expected");
                m.messageKey = $root.proto.MessageKey.fromObject(d.messageKey);
            }
            if (d.responseTimestampMs != null) {
                if ($util.Long)
                    (m.responseTimestampMs = $util.Long.fromValue(d.responseTimestampMs)).unsigned = false;
                else if (typeof d.responseTimestampMs === "string")
                    m.responseTimestampMs = parseInt(d.responseTimestampMs, 10);
                else if (typeof d.responseTimestampMs === "number")
                    m.responseTimestampMs = d.responseTimestampMs;
                else if (typeof d.responseTimestampMs === "object")
                    m.responseTimestampMs = new $util.LongBits(d.responseTimestampMs.low >>> 0, d.responseTimestampMs.high >>> 0).toNumber();
            }
            return m;
        };

        AIRegenerateMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.messageKey != null && m.hasOwnProperty("messageKey")) {
                d.messageKey = $root.proto.MessageKey.toObject(m.messageKey, o);
                if (o.oneofs)
                    d._messageKey = "messageKey";
            }
            if (m.responseTimestampMs != null && m.hasOwnProperty("responseTimestampMs")) {
                if (typeof m.responseTimestampMs === "number")
                    d.responseTimestampMs = o.longs === String ? String(m.responseTimestampMs) : m.responseTimestampMs;
                else
                    d.responseTimestampMs = o.longs === String ? longToString(m.responseTimestampMs) : o.longs === Number ? longToNumber(m.responseTimestampMs) : m.responseTimestampMs;
                if (o.oneofs)
                    d._responseTimestampMs = "responseTimestampMs";
            }
            return d;
        };

        AIRegenerateMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRegenerateMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRegenerateMetadata";
        };

        return AIRegenerateMetadata;
    })();

    proto.AIRichResponseCodeMetadata = (function() {

        function AIRichResponseCodeMetadata(p) {
            this.codeBlocks = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseCodeMetadata.prototype.codeLanguage = null;
        AIRichResponseCodeMetadata.prototype.codeBlocks = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseCodeMetadata.prototype, "_codeLanguage", {
            get: $util.oneOfGetter($oneOfFields = ["codeLanguage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseCodeMetadata.create = function create(properties) {
            return new AIRichResponseCodeMetadata(properties);
        };

        AIRichResponseCodeMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.codeLanguage != null && Object.hasOwnProperty.call(m, "codeLanguage"))
                w.uint32(10).string(m.codeLanguage);
            if (m.codeBlocks != null && m.codeBlocks.length) {
                for (var i = 0; i < m.codeBlocks.length; ++i)
                    $root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.encode(m.codeBlocks[i], w.uint32(18).fork()).ldelim();
            }
            return w;
        };

        AIRichResponseCodeMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseCodeMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.codeLanguage = r.string();
                        break;
                    }
                case 2: {
                        if (!(m.codeBlocks && m.codeBlocks.length))
                            m.codeBlocks = [];
                        m.codeBlocks.push($root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseCodeMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseCodeMetadata)
                return d;
            var m = new $root.proto.AIRichResponseCodeMetadata();
            if (d.codeLanguage != null) {
                m.codeLanguage = String(d.codeLanguage);
            }
            if (d.codeBlocks) {
                if (!Array.isArray(d.codeBlocks))
                    throw TypeError(".proto.AIRichResponseCodeMetadata.codeBlocks: array expected");
                m.codeBlocks = [];
                for (var i = 0; i < d.codeBlocks.length; ++i) {
                    if (typeof d.codeBlocks[i] !== "object")
                        throw TypeError(".proto.AIRichResponseCodeMetadata.codeBlocks: object expected");
                    m.codeBlocks[i] = $root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.fromObject(d.codeBlocks[i]);
                }
            }
            return m;
        };

        AIRichResponseCodeMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.codeBlocks = [];
            }
            if (m.codeLanguage != null && m.hasOwnProperty("codeLanguage")) {
                d.codeLanguage = m.codeLanguage;
                if (o.oneofs)
                    d._codeLanguage = "codeLanguage";
            }
            if (m.codeBlocks && m.codeBlocks.length) {
                d.codeBlocks = [];
                for (var j = 0; j < m.codeBlocks.length; ++j) {
                    d.codeBlocks[j] = $root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.toObject(m.codeBlocks[j], o);
                }
            }
            return d;
        };

        AIRichResponseCodeMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseCodeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseCodeMetadata";
        };

        AIRichResponseCodeMetadata.AIRichResponseCodeBlock = (function() {

            function AIRichResponseCodeBlock(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIRichResponseCodeBlock.prototype.highlightType = null;
            AIRichResponseCodeBlock.prototype.codeContent = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseCodeBlock.prototype, "_highlightType", {
                get: $util.oneOfGetter($oneOfFields = ["highlightType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseCodeBlock.prototype, "_codeContent", {
                get: $util.oneOfGetter($oneOfFields = ["codeContent"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIRichResponseCodeBlock.create = function create(properties) {
                return new AIRichResponseCodeBlock(properties);
            };

            AIRichResponseCodeBlock.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.highlightType != null && Object.hasOwnProperty.call(m, "highlightType"))
                    w.uint32(8).int32(m.highlightType);
                if (m.codeContent != null && Object.hasOwnProperty.call(m, "codeContent"))
                    w.uint32(18).string(m.codeContent);
                return w;
            };

            AIRichResponseCodeBlock.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.highlightType = r.int32();
                            break;
                        }
                    case 2: {
                            m.codeContent = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIRichResponseCodeBlock.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock)
                    return d;
                var m = new $root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock();
                switch (d.highlightType) {
                default:
                    if (typeof d.highlightType === "number") {
                        m.highlightType = d.highlightType;
                        break;
                    }
                    break;
                case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT":
                case 0:
                    m.highlightType = 0;
                    break;
                case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD":
                case 1:
                    m.highlightType = 1;
                    break;
                case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD":
                case 2:
                    m.highlightType = 2;
                    break;
                case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING":
                case 3:
                    m.highlightType = 3;
                    break;
                case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER":
                case 4:
                    m.highlightType = 4;
                    break;
                case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT":
                case 5:
                    m.highlightType = 5;
                    break;
                }
                if (d.codeContent != null) {
                    m.codeContent = String(d.codeContent);
                }
                return m;
            };

            AIRichResponseCodeBlock.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.highlightType != null && m.hasOwnProperty("highlightType")) {
                    d.highlightType = o.enums === String ? $root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[m.highlightType] === undefined ? m.highlightType : $root.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[m.highlightType] : m.highlightType;
                    if (o.oneofs)
                        d._highlightType = "highlightType";
                }
                if (m.codeContent != null && m.hasOwnProperty("codeContent")) {
                    d.codeContent = m.codeContent;
                    if (o.oneofs)
                        d._codeContent = "codeContent";
                }
                return d;
            };

            AIRichResponseCodeBlock.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIRichResponseCodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock";
            };

            return AIRichResponseCodeBlock;
        })();

        AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT"] = 0;
            values[valuesById[1] = "AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD"] = 1;
            values[valuesById[2] = "AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD"] = 2;
            values[valuesById[3] = "AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING"] = 3;
            values[valuesById[4] = "AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER"] = 4;
            values[valuesById[5] = "AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT"] = 5;
            return values;
        })();

        return AIRichResponseCodeMetadata;
    })();

    proto.AIRichResponseContentItemsMetadata = (function() {

        function AIRichResponseContentItemsMetadata(p) {
            this.itemsMetadata = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseContentItemsMetadata.prototype.itemsMetadata = $util.emptyArray;
        AIRichResponseContentItemsMetadata.prototype.contentType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseContentItemsMetadata.prototype, "_contentType", {
            get: $util.oneOfGetter($oneOfFields = ["contentType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseContentItemsMetadata.create = function create(properties) {
            return new AIRichResponseContentItemsMetadata(properties);
        };

        AIRichResponseContentItemsMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.itemsMetadata != null && m.itemsMetadata.length) {
                for (var i = 0; i < m.itemsMetadata.length; ++i)
                    $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.encode(m.itemsMetadata[i], w.uint32(10).fork()).ldelim();
            }
            if (m.contentType != null && Object.hasOwnProperty.call(m, "contentType"))
                w.uint32(16).int32(m.contentType);
            return w;
        };

        AIRichResponseContentItemsMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseContentItemsMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.itemsMetadata && m.itemsMetadata.length))
                            m.itemsMetadata = [];
                        m.itemsMetadata.push($root.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.decode(r, r.uint32()));
                        break;
                    }
                case 2: {
                        m.contentType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseContentItemsMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseContentItemsMetadata)
                return d;
            var m = new $root.proto.AIRichResponseContentItemsMetadata();
            if (d.itemsMetadata) {
                if (!Array.isArray(d.itemsMetadata))
                    throw TypeError(".proto.AIRichResponseContentItemsMetadata.itemsMetadata: array expected");
                m.itemsMetadata = [];
                for (var i = 0; i < d.itemsMetadata.length; ++i) {
                    if (typeof d.itemsMetadata[i] !== "object")
                        throw TypeError(".proto.AIRichResponseContentItemsMetadata.itemsMetadata: object expected");
                    m.itemsMetadata[i] = $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.fromObject(d.itemsMetadata[i]);
                }
            }
            switch (d.contentType) {
            default:
                if (typeof d.contentType === "number") {
                    m.contentType = d.contentType;
                    break;
                }
                break;
            case "DEFAULT":
            case 0:
                m.contentType = 0;
                break;
            case "CAROUSEL":
            case 1:
                m.contentType = 1;
                break;
            }
            return m;
        };

        AIRichResponseContentItemsMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.itemsMetadata = [];
            }
            if (m.itemsMetadata && m.itemsMetadata.length) {
                d.itemsMetadata = [];
                for (var j = 0; j < m.itemsMetadata.length; ++j) {
                    d.itemsMetadata[j] = $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.toObject(m.itemsMetadata[j], o);
                }
            }
            if (m.contentType != null && m.hasOwnProperty("contentType")) {
                d.contentType = o.enums === String ? $root.proto.AIRichResponseContentItemsMetadata.ContentType[m.contentType] === undefined ? m.contentType : $root.proto.AIRichResponseContentItemsMetadata.ContentType[m.contentType] : m.contentType;
                if (o.oneofs)
                    d._contentType = "contentType";
            }
            return d;
        };

        AIRichResponseContentItemsMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseContentItemsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseContentItemsMetadata";
        };

        AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata = (function() {

            function AIRichResponseContentItemMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIRichResponseContentItemMetadata.prototype.reelItem = null;

            let $oneOfFields;

            Object.defineProperty(AIRichResponseContentItemMetadata.prototype, "aIRichResponseContentItem", {
                get: $util.oneOfGetter($oneOfFields = ["reelItem"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIRichResponseContentItemMetadata.create = function create(properties) {
                return new AIRichResponseContentItemMetadata(properties);
            };

            AIRichResponseContentItemMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.reelItem != null && Object.hasOwnProperty.call(m, "reelItem"))
                    $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.encode(m.reelItem, w.uint32(10).fork()).ldelim();
                return w;
            };

            AIRichResponseContentItemMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.reelItem = $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIRichResponseContentItemMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata)
                    return d;
                var m = new $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata();
                if (d.reelItem != null) {
                    if (typeof d.reelItem !== "object")
                        throw TypeError(".proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.reelItem: object expected");
                    m.reelItem = $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.fromObject(d.reelItem);
                }
                return m;
            };

            AIRichResponseContentItemMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.reelItem != null && m.hasOwnProperty("reelItem")) {
                    d.reelItem = $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.toObject(m.reelItem, o);
                    if (o.oneofs)
                        d.aIRichResponseContentItem = "reelItem";
                }
                return d;
            };

            AIRichResponseContentItemMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIRichResponseContentItemMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata";
            };

            return AIRichResponseContentItemMetadata;
        })();

        AIRichResponseContentItemsMetadata.AIRichResponseReelItem = (function() {

            function AIRichResponseReelItem(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIRichResponseReelItem.prototype.title = null;
            AIRichResponseReelItem.prototype.profileIconUrl = null;
            AIRichResponseReelItem.prototype.thumbnailUrl = null;
            AIRichResponseReelItem.prototype.videoUrl = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseReelItem.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseReelItem.prototype, "_profileIconUrl", {
                get: $util.oneOfGetter($oneOfFields = ["profileIconUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseReelItem.prototype, "_thumbnailUrl", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseReelItem.prototype, "_videoUrl", {
                get: $util.oneOfGetter($oneOfFields = ["videoUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIRichResponseReelItem.create = function create(properties) {
                return new AIRichResponseReelItem(properties);
            };

            AIRichResponseReelItem.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(10).string(m.title);
                if (m.profileIconUrl != null && Object.hasOwnProperty.call(m, "profileIconUrl"))
                    w.uint32(18).string(m.profileIconUrl);
                if (m.thumbnailUrl != null && Object.hasOwnProperty.call(m, "thumbnailUrl"))
                    w.uint32(26).string(m.thumbnailUrl);
                if (m.videoUrl != null && Object.hasOwnProperty.call(m, "videoUrl"))
                    w.uint32(34).string(m.videoUrl);
                return w;
            };

            AIRichResponseReelItem.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.title = r.string();
                            break;
                        }
                    case 2: {
                            m.profileIconUrl = r.string();
                            break;
                        }
                    case 3: {
                            m.thumbnailUrl = r.string();
                            break;
                        }
                    case 4: {
                            m.videoUrl = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIRichResponseReelItem.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem)
                    return d;
                var m = new $root.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem();
                if (d.title != null) {
                    m.title = String(d.title);
                }
                if (d.profileIconUrl != null) {
                    m.profileIconUrl = String(d.profileIconUrl);
                }
                if (d.thumbnailUrl != null) {
                    m.thumbnailUrl = String(d.thumbnailUrl);
                }
                if (d.videoUrl != null) {
                    m.videoUrl = String(d.videoUrl);
                }
                return m;
            };

            AIRichResponseReelItem.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.profileIconUrl != null && m.hasOwnProperty("profileIconUrl")) {
                    d.profileIconUrl = m.profileIconUrl;
                    if (o.oneofs)
                        d._profileIconUrl = "profileIconUrl";
                }
                if (m.thumbnailUrl != null && m.hasOwnProperty("thumbnailUrl")) {
                    d.thumbnailUrl = m.thumbnailUrl;
                    if (o.oneofs)
                        d._thumbnailUrl = "thumbnailUrl";
                }
                if (m.videoUrl != null && m.hasOwnProperty("videoUrl")) {
                    d.videoUrl = m.videoUrl;
                    if (o.oneofs)
                        d._videoUrl = "videoUrl";
                }
                return d;
            };

            AIRichResponseReelItem.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIRichResponseReelItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem";
            };

            return AIRichResponseReelItem;
        })();

        AIRichResponseContentItemsMetadata.ContentType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "DEFAULT"] = 0;
            values[valuesById[1] = "CAROUSEL"] = 1;
            return values;
        })();

        return AIRichResponseContentItemsMetadata;
    })();

    proto.AIRichResponseDynamicMetadata = (function() {

        function AIRichResponseDynamicMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseDynamicMetadata.prototype.type = null;
        AIRichResponseDynamicMetadata.prototype.version = null;
        AIRichResponseDynamicMetadata.prototype.url = null;
        AIRichResponseDynamicMetadata.prototype.loopCount = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseDynamicMetadata.prototype, "_type", {
            get: $util.oneOfGetter($oneOfFields = ["type"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseDynamicMetadata.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseDynamicMetadata.prototype, "_url", {
            get: $util.oneOfGetter($oneOfFields = ["url"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseDynamicMetadata.prototype, "_loopCount", {
            get: $util.oneOfGetter($oneOfFields = ["loopCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseDynamicMetadata.create = function create(properties) {
            return new AIRichResponseDynamicMetadata(properties);
        };

        AIRichResponseDynamicMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                w.uint32(8).int32(m.type);
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                w.uint32(16).uint64(m.version);
            if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                w.uint32(26).string(m.url);
            if (m.loopCount != null && Object.hasOwnProperty.call(m, "loopCount"))
                w.uint32(32).uint32(m.loopCount);
            return w;
        };

        AIRichResponseDynamicMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseDynamicMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.type = r.int32();
                        break;
                    }
                case 2: {
                        m.version = r.uint64();
                        break;
                    }
                case 3: {
                        m.url = r.string();
                        break;
                    }
                case 4: {
                        m.loopCount = r.uint32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseDynamicMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseDynamicMetadata)
                return d;
            var m = new $root.proto.AIRichResponseDynamicMetadata();
            switch (d.type) {
            default:
                if (typeof d.type === "number") {
                    m.type = d.type;
                    break;
                }
                break;
            case "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN":
            case 0:
                m.type = 0;
                break;
            case "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE":
            case 1:
                m.type = 1;
                break;
            case "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF":
            case 2:
                m.type = 2;
                break;
            }
            if (d.version != null) {
                if ($util.Long)
                    (m.version = $util.Long.fromValue(d.version)).unsigned = true;
                else if (typeof d.version === "string")
                    m.version = parseInt(d.version, 10);
                else if (typeof d.version === "number")
                    m.version = d.version;
                else if (typeof d.version === "object")
                    m.version = new $util.LongBits(d.version.low >>> 0, d.version.high >>> 0).toNumber(true);
            }
            if (d.url != null) {
                m.url = String(d.url);
            }
            if (d.loopCount != null) {
                m.loopCount = d.loopCount >>> 0;
            }
            return m;
        };

        AIRichResponseDynamicMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.type != null && m.hasOwnProperty("type")) {
                d.type = o.enums === String ? $root.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[m.type] === undefined ? m.type : $root.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[m.type] : m.type;
                if (o.oneofs)
                    d._type = "type";
            }
            if (m.version != null && m.hasOwnProperty("version")) {
                if (typeof m.version === "number")
                    d.version = o.longs === String ? String(m.version) : m.version;
                else
                    d.version = o.longs === String ? longToString(m.version, true) : o.longs === Number ? longToNumber(m.version, true) : m.version;
                if (o.oneofs)
                    d._version = "version";
            }
            if (m.url != null && m.hasOwnProperty("url")) {
                d.url = m.url;
                if (o.oneofs)
                    d._url = "url";
            }
            if (m.loopCount != null && m.hasOwnProperty("loopCount")) {
                d.loopCount = m.loopCount;
                if (o.oneofs)
                    d._loopCount = "loopCount";
            }
            return d;
        };

        AIRichResponseDynamicMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseDynamicMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseDynamicMetadata";
        };

        AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN"] = 0;
            values[valuesById[1] = "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE"] = 1;
            values[valuesById[2] = "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF"] = 2;
            return values;
        })();

        return AIRichResponseDynamicMetadata;
    })();

    proto.AIRichResponseGridImageMetadata = (function() {

        function AIRichResponseGridImageMetadata(p) {
            this.imageUrls = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseGridImageMetadata.prototype.gridImageUrl = null;
        AIRichResponseGridImageMetadata.prototype.imageUrls = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseGridImageMetadata.prototype, "_gridImageUrl", {
            get: $util.oneOfGetter($oneOfFields = ["gridImageUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseGridImageMetadata.create = function create(properties) {
            return new AIRichResponseGridImageMetadata(properties);
        };

        AIRichResponseGridImageMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.gridImageUrl != null && Object.hasOwnProperty.call(m, "gridImageUrl"))
                $root.proto.AIRichResponseImageURL.encode(m.gridImageUrl, w.uint32(10).fork()).ldelim();
            if (m.imageUrls != null && m.imageUrls.length) {
                for (var i = 0; i < m.imageUrls.length; ++i)
                    $root.proto.AIRichResponseImageURL.encode(m.imageUrls[i], w.uint32(18).fork()).ldelim();
            }
            return w;
        };

        AIRichResponseGridImageMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseGridImageMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.gridImageUrl = $root.proto.AIRichResponseImageURL.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        if (!(m.imageUrls && m.imageUrls.length))
                            m.imageUrls = [];
                        m.imageUrls.push($root.proto.AIRichResponseImageURL.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseGridImageMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseGridImageMetadata)
                return d;
            var m = new $root.proto.AIRichResponseGridImageMetadata();
            if (d.gridImageUrl != null) {
                if (typeof d.gridImageUrl !== "object")
                    throw TypeError(".proto.AIRichResponseGridImageMetadata.gridImageUrl: object expected");
                m.gridImageUrl = $root.proto.AIRichResponseImageURL.fromObject(d.gridImageUrl);
            }
            if (d.imageUrls) {
                if (!Array.isArray(d.imageUrls))
                    throw TypeError(".proto.AIRichResponseGridImageMetadata.imageUrls: array expected");
                m.imageUrls = [];
                for (var i = 0; i < d.imageUrls.length; ++i) {
                    if (typeof d.imageUrls[i] !== "object")
                        throw TypeError(".proto.AIRichResponseGridImageMetadata.imageUrls: object expected");
                    m.imageUrls[i] = $root.proto.AIRichResponseImageURL.fromObject(d.imageUrls[i]);
                }
            }
            return m;
        };

        AIRichResponseGridImageMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.imageUrls = [];
            }
            if (m.gridImageUrl != null && m.hasOwnProperty("gridImageUrl")) {
                d.gridImageUrl = $root.proto.AIRichResponseImageURL.toObject(m.gridImageUrl, o);
                if (o.oneofs)
                    d._gridImageUrl = "gridImageUrl";
            }
            if (m.imageUrls && m.imageUrls.length) {
                d.imageUrls = [];
                for (var j = 0; j < m.imageUrls.length; ++j) {
                    d.imageUrls[j] = $root.proto.AIRichResponseImageURL.toObject(m.imageUrls[j], o);
                }
            }
            return d;
        };

        AIRichResponseGridImageMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseGridImageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseGridImageMetadata";
        };

        return AIRichResponseGridImageMetadata;
    })();

    proto.AIRichResponseImageURL = (function() {

        function AIRichResponseImageURL(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseImageURL.prototype.imagePreviewUrl = null;
        AIRichResponseImageURL.prototype.imageHighResUrl = null;
        AIRichResponseImageURL.prototype.sourceUrl = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseImageURL.prototype, "_imagePreviewUrl", {
            get: $util.oneOfGetter($oneOfFields = ["imagePreviewUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseImageURL.prototype, "_imageHighResUrl", {
            get: $util.oneOfGetter($oneOfFields = ["imageHighResUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseImageURL.prototype, "_sourceUrl", {
            get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseImageURL.create = function create(properties) {
            return new AIRichResponseImageURL(properties);
        };

        AIRichResponseImageURL.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.imagePreviewUrl != null && Object.hasOwnProperty.call(m, "imagePreviewUrl"))
                w.uint32(10).string(m.imagePreviewUrl);
            if (m.imageHighResUrl != null && Object.hasOwnProperty.call(m, "imageHighResUrl"))
                w.uint32(18).string(m.imageHighResUrl);
            if (m.sourceUrl != null && Object.hasOwnProperty.call(m, "sourceUrl"))
                w.uint32(26).string(m.sourceUrl);
            return w;
        };

        AIRichResponseImageURL.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseImageURL();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.imagePreviewUrl = r.string();
                        break;
                    }
                case 2: {
                        m.imageHighResUrl = r.string();
                        break;
                    }
                case 3: {
                        m.sourceUrl = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseImageURL.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseImageURL)
                return d;
            var m = new $root.proto.AIRichResponseImageURL();
            if (d.imagePreviewUrl != null) {
                m.imagePreviewUrl = String(d.imagePreviewUrl);
            }
            if (d.imageHighResUrl != null) {
                m.imageHighResUrl = String(d.imageHighResUrl);
            }
            if (d.sourceUrl != null) {
                m.sourceUrl = String(d.sourceUrl);
            }
            return m;
        };

        AIRichResponseImageURL.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.imagePreviewUrl != null && m.hasOwnProperty("imagePreviewUrl")) {
                d.imagePreviewUrl = m.imagePreviewUrl;
                if (o.oneofs)
                    d._imagePreviewUrl = "imagePreviewUrl";
            }
            if (m.imageHighResUrl != null && m.hasOwnProperty("imageHighResUrl")) {
                d.imageHighResUrl = m.imageHighResUrl;
                if (o.oneofs)
                    d._imageHighResUrl = "imageHighResUrl";
            }
            if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) {
                d.sourceUrl = m.sourceUrl;
                if (o.oneofs)
                    d._sourceUrl = "sourceUrl";
            }
            return d;
        };

        AIRichResponseImageURL.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseImageURL.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseImageURL";
        };

        return AIRichResponseImageURL;
    })();

    proto.AIRichResponseInlineImageMetadata = (function() {

        function AIRichResponseInlineImageMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseInlineImageMetadata.prototype.imageUrl = null;
        AIRichResponseInlineImageMetadata.prototype.imageText = null;
        AIRichResponseInlineImageMetadata.prototype.alignment = null;
        AIRichResponseInlineImageMetadata.prototype.tapLinkUrl = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseInlineImageMetadata.prototype, "_imageUrl", {
            get: $util.oneOfGetter($oneOfFields = ["imageUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseInlineImageMetadata.prototype, "_imageText", {
            get: $util.oneOfGetter($oneOfFields = ["imageText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseInlineImageMetadata.prototype, "_alignment", {
            get: $util.oneOfGetter($oneOfFields = ["alignment"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseInlineImageMetadata.prototype, "_tapLinkUrl", {
            get: $util.oneOfGetter($oneOfFields = ["tapLinkUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseInlineImageMetadata.create = function create(properties) {
            return new AIRichResponseInlineImageMetadata(properties);
        };

        AIRichResponseInlineImageMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.imageUrl != null && Object.hasOwnProperty.call(m, "imageUrl"))
                $root.proto.AIRichResponseImageURL.encode(m.imageUrl, w.uint32(10).fork()).ldelim();
            if (m.imageText != null && Object.hasOwnProperty.call(m, "imageText"))
                w.uint32(18).string(m.imageText);
            if (m.alignment != null && Object.hasOwnProperty.call(m, "alignment"))
                w.uint32(24).int32(m.alignment);
            if (m.tapLinkUrl != null && Object.hasOwnProperty.call(m, "tapLinkUrl"))
                w.uint32(34).string(m.tapLinkUrl);
            return w;
        };

        AIRichResponseInlineImageMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseInlineImageMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.imageUrl = $root.proto.AIRichResponseImageURL.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.imageText = r.string();
                        break;
                    }
                case 3: {
                        m.alignment = r.int32();
                        break;
                    }
                case 4: {
                        m.tapLinkUrl = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseInlineImageMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseInlineImageMetadata)
                return d;
            var m = new $root.proto.AIRichResponseInlineImageMetadata();
            if (d.imageUrl != null) {
                if (typeof d.imageUrl !== "object")
                    throw TypeError(".proto.AIRichResponseInlineImageMetadata.imageUrl: object expected");
                m.imageUrl = $root.proto.AIRichResponseImageURL.fromObject(d.imageUrl);
            }
            if (d.imageText != null) {
                m.imageText = String(d.imageText);
            }
            switch (d.alignment) {
            default:
                if (typeof d.alignment === "number") {
                    m.alignment = d.alignment;
                    break;
                }
                break;
            case "AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED":
            case 0:
                m.alignment = 0;
                break;
            case "AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED":
            case 1:
                m.alignment = 1;
                break;
            case "AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED":
            case 2:
                m.alignment = 2;
                break;
            }
            if (d.tapLinkUrl != null) {
                m.tapLinkUrl = String(d.tapLinkUrl);
            }
            return m;
        };

        AIRichResponseInlineImageMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.imageUrl != null && m.hasOwnProperty("imageUrl")) {
                d.imageUrl = $root.proto.AIRichResponseImageURL.toObject(m.imageUrl, o);
                if (o.oneofs)
                    d._imageUrl = "imageUrl";
            }
            if (m.imageText != null && m.hasOwnProperty("imageText")) {
                d.imageText = m.imageText;
                if (o.oneofs)
                    d._imageText = "imageText";
            }
            if (m.alignment != null && m.hasOwnProperty("alignment")) {
                d.alignment = o.enums === String ? $root.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[m.alignment] === undefined ? m.alignment : $root.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[m.alignment] : m.alignment;
                if (o.oneofs)
                    d._alignment = "alignment";
            }
            if (m.tapLinkUrl != null && m.hasOwnProperty("tapLinkUrl")) {
                d.tapLinkUrl = m.tapLinkUrl;
                if (o.oneofs)
                    d._tapLinkUrl = "tapLinkUrl";
            }
            return d;
        };

        AIRichResponseInlineImageMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseInlineImageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseInlineImageMetadata";
        };

        AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED"] = 0;
            values[valuesById[1] = "AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED"] = 1;
            values[valuesById[2] = "AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED"] = 2;
            return values;
        })();

        return AIRichResponseInlineImageMetadata;
    })();

    proto.AIRichResponseLatexMetadata = (function() {

        function AIRichResponseLatexMetadata(p) {
            this.expressions = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseLatexMetadata.prototype.text = null;
        AIRichResponseLatexMetadata.prototype.expressions = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseLatexMetadata.prototype, "_text", {
            get: $util.oneOfGetter($oneOfFields = ["text"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseLatexMetadata.create = function create(properties) {
            return new AIRichResponseLatexMetadata(properties);
        };

        AIRichResponseLatexMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                w.uint32(10).string(m.text);
            if (m.expressions != null && m.expressions.length) {
                for (var i = 0; i < m.expressions.length; ++i)
                    $root.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.encode(m.expressions[i], w.uint32(18).fork()).ldelim();
            }
            return w;
        };

        AIRichResponseLatexMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseLatexMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.text = r.string();
                        break;
                    }
                case 2: {
                        if (!(m.expressions && m.expressions.length))
                            m.expressions = [];
                        m.expressions.push($root.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseLatexMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseLatexMetadata)
                return d;
            var m = new $root.proto.AIRichResponseLatexMetadata();
            if (d.text != null) {
                m.text = String(d.text);
            }
            if (d.expressions) {
                if (!Array.isArray(d.expressions))
                    throw TypeError(".proto.AIRichResponseLatexMetadata.expressions: array expected");
                m.expressions = [];
                for (var i = 0; i < d.expressions.length; ++i) {
                    if (typeof d.expressions[i] !== "object")
                        throw TypeError(".proto.AIRichResponseLatexMetadata.expressions: object expected");
                    m.expressions[i] = $root.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.fromObject(d.expressions[i]);
                }
            }
            return m;
        };

        AIRichResponseLatexMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.expressions = [];
            }
            if (m.text != null && m.hasOwnProperty("text")) {
                d.text = m.text;
                if (o.oneofs)
                    d._text = "text";
            }
            if (m.expressions && m.expressions.length) {
                d.expressions = [];
                for (var j = 0; j < m.expressions.length; ++j) {
                    d.expressions[j] = $root.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.toObject(m.expressions[j], o);
                }
            }
            return d;
        };

        AIRichResponseLatexMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseLatexMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseLatexMetadata";
        };

        AIRichResponseLatexMetadata.AIRichResponseLatexExpression = (function() {

            function AIRichResponseLatexExpression(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIRichResponseLatexExpression.prototype.latexExpression = null;
            AIRichResponseLatexExpression.prototype.url = null;
            AIRichResponseLatexExpression.prototype.width = null;
            AIRichResponseLatexExpression.prototype.height = null;
            AIRichResponseLatexExpression.prototype.fontHeight = null;
            AIRichResponseLatexExpression.prototype.imageTopPadding = null;
            AIRichResponseLatexExpression.prototype.imageLeadingPadding = null;
            AIRichResponseLatexExpression.prototype.imageBottomPadding = null;
            AIRichResponseLatexExpression.prototype.imageTrailingPadding = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_latexExpression", {
                get: $util.oneOfGetter($oneOfFields = ["latexExpression"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_width", {
                get: $util.oneOfGetter($oneOfFields = ["width"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_height", {
                get: $util.oneOfGetter($oneOfFields = ["height"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_fontHeight", {
                get: $util.oneOfGetter($oneOfFields = ["fontHeight"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_imageTopPadding", {
                get: $util.oneOfGetter($oneOfFields = ["imageTopPadding"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_imageLeadingPadding", {
                get: $util.oneOfGetter($oneOfFields = ["imageLeadingPadding"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_imageBottomPadding", {
                get: $util.oneOfGetter($oneOfFields = ["imageBottomPadding"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseLatexExpression.prototype, "_imageTrailingPadding", {
                get: $util.oneOfGetter($oneOfFields = ["imageTrailingPadding"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIRichResponseLatexExpression.create = function create(properties) {
                return new AIRichResponseLatexExpression(properties);
            };

            AIRichResponseLatexExpression.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.latexExpression != null && Object.hasOwnProperty.call(m, "latexExpression"))
                    w.uint32(10).string(m.latexExpression);
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(18).string(m.url);
                if (m.width != null && Object.hasOwnProperty.call(m, "width"))
                    w.uint32(25).double(m.width);
                if (m.height != null && Object.hasOwnProperty.call(m, "height"))
                    w.uint32(33).double(m.height);
                if (m.fontHeight != null && Object.hasOwnProperty.call(m, "fontHeight"))
                    w.uint32(41).double(m.fontHeight);
                if (m.imageTopPadding != null && Object.hasOwnProperty.call(m, "imageTopPadding"))
                    w.uint32(49).double(m.imageTopPadding);
                if (m.imageLeadingPadding != null && Object.hasOwnProperty.call(m, "imageLeadingPadding"))
                    w.uint32(57).double(m.imageLeadingPadding);
                if (m.imageBottomPadding != null && Object.hasOwnProperty.call(m, "imageBottomPadding"))
                    w.uint32(65).double(m.imageBottomPadding);
                if (m.imageTrailingPadding != null && Object.hasOwnProperty.call(m, "imageTrailingPadding"))
                    w.uint32(73).double(m.imageTrailingPadding);
                return w;
            };

            AIRichResponseLatexExpression.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.latexExpression = r.string();
                            break;
                        }
                    case 2: {
                            m.url = r.string();
                            break;
                        }
                    case 3: {
                            m.width = r.double();
                            break;
                        }
                    case 4: {
                            m.height = r.double();
                            break;
                        }
                    case 5: {
                            m.fontHeight = r.double();
                            break;
                        }
                    case 6: {
                            m.imageTopPadding = r.double();
                            break;
                        }
                    case 7: {
                            m.imageLeadingPadding = r.double();
                            break;
                        }
                    case 8: {
                            m.imageBottomPadding = r.double();
                            break;
                        }
                    case 9: {
                            m.imageTrailingPadding = r.double();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIRichResponseLatexExpression.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression)
                    return d;
                var m = new $root.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression();
                if (d.latexExpression != null) {
                    m.latexExpression = String(d.latexExpression);
                }
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.width != null) {
                    m.width = Number(d.width);
                }
                if (d.height != null) {
                    m.height = Number(d.height);
                }
                if (d.fontHeight != null) {
                    m.fontHeight = Number(d.fontHeight);
                }
                if (d.imageTopPadding != null) {
                    m.imageTopPadding = Number(d.imageTopPadding);
                }
                if (d.imageLeadingPadding != null) {
                    m.imageLeadingPadding = Number(d.imageLeadingPadding);
                }
                if (d.imageBottomPadding != null) {
                    m.imageBottomPadding = Number(d.imageBottomPadding);
                }
                if (d.imageTrailingPadding != null) {
                    m.imageTrailingPadding = Number(d.imageTrailingPadding);
                }
                return m;
            };

            AIRichResponseLatexExpression.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.latexExpression != null && m.hasOwnProperty("latexExpression")) {
                    d.latexExpression = m.latexExpression;
                    if (o.oneofs)
                        d._latexExpression = "latexExpression";
                }
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.width != null && m.hasOwnProperty("width")) {
                    d.width = o.json && !isFinite(m.width) ? String(m.width) : m.width;
                    if (o.oneofs)
                        d._width = "width";
                }
                if (m.height != null && m.hasOwnProperty("height")) {
                    d.height = o.json && !isFinite(m.height) ? String(m.height) : m.height;
                    if (o.oneofs)
                        d._height = "height";
                }
                if (m.fontHeight != null && m.hasOwnProperty("fontHeight")) {
                    d.fontHeight = o.json && !isFinite(m.fontHeight) ? String(m.fontHeight) : m.fontHeight;
                    if (o.oneofs)
                        d._fontHeight = "fontHeight";
                }
                if (m.imageTopPadding != null && m.hasOwnProperty("imageTopPadding")) {
                    d.imageTopPadding = o.json && !isFinite(m.imageTopPadding) ? String(m.imageTopPadding) : m.imageTopPadding;
                    if (o.oneofs)
                        d._imageTopPadding = "imageTopPadding";
                }
                if (m.imageLeadingPadding != null && m.hasOwnProperty("imageLeadingPadding")) {
                    d.imageLeadingPadding = o.json && !isFinite(m.imageLeadingPadding) ? String(m.imageLeadingPadding) : m.imageLeadingPadding;
                    if (o.oneofs)
                        d._imageLeadingPadding = "imageLeadingPadding";
                }
                if (m.imageBottomPadding != null && m.hasOwnProperty("imageBottomPadding")) {
                    d.imageBottomPadding = o.json && !isFinite(m.imageBottomPadding) ? String(m.imageBottomPadding) : m.imageBottomPadding;
                    if (o.oneofs)
                        d._imageBottomPadding = "imageBottomPadding";
                }
                if (m.imageTrailingPadding != null && m.hasOwnProperty("imageTrailingPadding")) {
                    d.imageTrailingPadding = o.json && !isFinite(m.imageTrailingPadding) ? String(m.imageTrailingPadding) : m.imageTrailingPadding;
                    if (o.oneofs)
                        d._imageTrailingPadding = "imageTrailingPadding";
                }
                return d;
            };

            AIRichResponseLatexExpression.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIRichResponseLatexExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression";
            };

            return AIRichResponseLatexExpression;
        })();

        return AIRichResponseLatexMetadata;
    })();

    proto.AIRichResponseMapMetadata = (function() {

        function AIRichResponseMapMetadata(p) {
            this.annotations = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseMapMetadata.prototype.centerLatitude = null;
        AIRichResponseMapMetadata.prototype.centerLongitude = null;
        AIRichResponseMapMetadata.prototype.latitudeDelta = null;
        AIRichResponseMapMetadata.prototype.longitudeDelta = null;
        AIRichResponseMapMetadata.prototype.annotations = $util.emptyArray;
        AIRichResponseMapMetadata.prototype.showInfoList = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseMapMetadata.prototype, "_centerLatitude", {
            get: $util.oneOfGetter($oneOfFields = ["centerLatitude"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseMapMetadata.prototype, "_centerLongitude", {
            get: $util.oneOfGetter($oneOfFields = ["centerLongitude"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseMapMetadata.prototype, "_latitudeDelta", {
            get: $util.oneOfGetter($oneOfFields = ["latitudeDelta"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseMapMetadata.prototype, "_longitudeDelta", {
            get: $util.oneOfGetter($oneOfFields = ["longitudeDelta"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseMapMetadata.prototype, "_showInfoList", {
            get: $util.oneOfGetter($oneOfFields = ["showInfoList"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseMapMetadata.create = function create(properties) {
            return new AIRichResponseMapMetadata(properties);
        };

        AIRichResponseMapMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.centerLatitude != null && Object.hasOwnProperty.call(m, "centerLatitude"))
                w.uint32(9).double(m.centerLatitude);
            if (m.centerLongitude != null && Object.hasOwnProperty.call(m, "centerLongitude"))
                w.uint32(17).double(m.centerLongitude);
            if (m.latitudeDelta != null && Object.hasOwnProperty.call(m, "latitudeDelta"))
                w.uint32(25).double(m.latitudeDelta);
            if (m.longitudeDelta != null && Object.hasOwnProperty.call(m, "longitudeDelta"))
                w.uint32(33).double(m.longitudeDelta);
            if (m.annotations != null && m.annotations.length) {
                for (var i = 0; i < m.annotations.length; ++i)
                    $root.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.encode(m.annotations[i], w.uint32(42).fork()).ldelim();
            }
            if (m.showInfoList != null && Object.hasOwnProperty.call(m, "showInfoList"))
                w.uint32(48).bool(m.showInfoList);
            return w;
        };

        AIRichResponseMapMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseMapMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.centerLatitude = r.double();
                        break;
                    }
                case 2: {
                        m.centerLongitude = r.double();
                        break;
                    }
                case 3: {
                        m.latitudeDelta = r.double();
                        break;
                    }
                case 4: {
                        m.longitudeDelta = r.double();
                        break;
                    }
                case 5: {
                        if (!(m.annotations && m.annotations.length))
                            m.annotations = [];
                        m.annotations.push($root.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.decode(r, r.uint32()));
                        break;
                    }
                case 6: {
                        m.showInfoList = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseMapMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseMapMetadata)
                return d;
            var m = new $root.proto.AIRichResponseMapMetadata();
            if (d.centerLatitude != null) {
                m.centerLatitude = Number(d.centerLatitude);
            }
            if (d.centerLongitude != null) {
                m.centerLongitude = Number(d.centerLongitude);
            }
            if (d.latitudeDelta != null) {
                m.latitudeDelta = Number(d.latitudeDelta);
            }
            if (d.longitudeDelta != null) {
                m.longitudeDelta = Number(d.longitudeDelta);
            }
            if (d.annotations) {
                if (!Array.isArray(d.annotations))
                    throw TypeError(".proto.AIRichResponseMapMetadata.annotations: array expected");
                m.annotations = [];
                for (var i = 0; i < d.annotations.length; ++i) {
                    if (typeof d.annotations[i] !== "object")
                        throw TypeError(".proto.AIRichResponseMapMetadata.annotations: object expected");
                    m.annotations[i] = $root.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.fromObject(d.annotations[i]);
                }
            }
            if (d.showInfoList != null) {
                m.showInfoList = Boolean(d.showInfoList);
            }
            return m;
        };

        AIRichResponseMapMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.annotations = [];
            }
            if (m.centerLatitude != null && m.hasOwnProperty("centerLatitude")) {
                d.centerLatitude = o.json && !isFinite(m.centerLatitude) ? String(m.centerLatitude) : m.centerLatitude;
                if (o.oneofs)
                    d._centerLatitude = "centerLatitude";
            }
            if (m.centerLongitude != null && m.hasOwnProperty("centerLongitude")) {
                d.centerLongitude = o.json && !isFinite(m.centerLongitude) ? String(m.centerLongitude) : m.centerLongitude;
                if (o.oneofs)
                    d._centerLongitude = "centerLongitude";
            }
            if (m.latitudeDelta != null && m.hasOwnProperty("latitudeDelta")) {
                d.latitudeDelta = o.json && !isFinite(m.latitudeDelta) ? String(m.latitudeDelta) : m.latitudeDelta;
                if (o.oneofs)
                    d._latitudeDelta = "latitudeDelta";
            }
            if (m.longitudeDelta != null && m.hasOwnProperty("longitudeDelta")) {
                d.longitudeDelta = o.json && !isFinite(m.longitudeDelta) ? String(m.longitudeDelta) : m.longitudeDelta;
                if (o.oneofs)
                    d._longitudeDelta = "longitudeDelta";
            }
            if (m.annotations && m.annotations.length) {
                d.annotations = [];
                for (var j = 0; j < m.annotations.length; ++j) {
                    d.annotations[j] = $root.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.toObject(m.annotations[j], o);
                }
            }
            if (m.showInfoList != null && m.hasOwnProperty("showInfoList")) {
                d.showInfoList = m.showInfoList;
                if (o.oneofs)
                    d._showInfoList = "showInfoList";
            }
            return d;
        };

        AIRichResponseMapMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseMapMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseMapMetadata";
        };

        AIRichResponseMapMetadata.AIRichResponseMapAnnotation = (function() {

            function AIRichResponseMapAnnotation(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIRichResponseMapAnnotation.prototype.annotationNumber = null;
            AIRichResponseMapAnnotation.prototype.latitude = null;
            AIRichResponseMapAnnotation.prototype.longitude = null;
            AIRichResponseMapAnnotation.prototype.title = null;
            AIRichResponseMapAnnotation.prototype.body = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_annotationNumber", {
                get: $util.oneOfGetter($oneOfFields = ["annotationNumber"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_latitude", {
                get: $util.oneOfGetter($oneOfFields = ["latitude"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_longitude", {
                get: $util.oneOfGetter($oneOfFields = ["longitude"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_body", {
                get: $util.oneOfGetter($oneOfFields = ["body"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIRichResponseMapAnnotation.create = function create(properties) {
                return new AIRichResponseMapAnnotation(properties);
            };

            AIRichResponseMapAnnotation.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.annotationNumber != null && Object.hasOwnProperty.call(m, "annotationNumber"))
                    w.uint32(8).uint32(m.annotationNumber);
                if (m.latitude != null && Object.hasOwnProperty.call(m, "latitude"))
                    w.uint32(17).double(m.latitude);
                if (m.longitude != null && Object.hasOwnProperty.call(m, "longitude"))
                    w.uint32(25).double(m.longitude);
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(34).string(m.title);
                if (m.body != null && Object.hasOwnProperty.call(m, "body"))
                    w.uint32(42).string(m.body);
                return w;
            };

            AIRichResponseMapAnnotation.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.annotationNumber = r.uint32();
                            break;
                        }
                    case 2: {
                            m.latitude = r.double();
                            break;
                        }
                    case 3: {
                            m.longitude = r.double();
                            break;
                        }
                    case 4: {
                            m.title = r.string();
                            break;
                        }
                    case 5: {
                            m.body = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIRichResponseMapAnnotation.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation)
                    return d;
                var m = new $root.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation();
                if (d.annotationNumber != null) {
                    m.annotationNumber = d.annotationNumber >>> 0;
                }
                if (d.latitude != null) {
                    m.latitude = Number(d.latitude);
                }
                if (d.longitude != null) {
                    m.longitude = Number(d.longitude);
                }
                if (d.title != null) {
                    m.title = String(d.title);
                }
                if (d.body != null) {
                    m.body = String(d.body);
                }
                return m;
            };

            AIRichResponseMapAnnotation.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.annotationNumber != null && m.hasOwnProperty("annotationNumber")) {
                    d.annotationNumber = m.annotationNumber;
                    if (o.oneofs)
                        d._annotationNumber = "annotationNumber";
                }
                if (m.latitude != null && m.hasOwnProperty("latitude")) {
                    d.latitude = o.json && !isFinite(m.latitude) ? String(m.latitude) : m.latitude;
                    if (o.oneofs)
                        d._latitude = "latitude";
                }
                if (m.longitude != null && m.hasOwnProperty("longitude")) {
                    d.longitude = o.json && !isFinite(m.longitude) ? String(m.longitude) : m.longitude;
                    if (o.oneofs)
                        d._longitude = "longitude";
                }
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.body != null && m.hasOwnProperty("body")) {
                    d.body = m.body;
                    if (o.oneofs)
                        d._body = "body";
                }
                return d;
            };

            AIRichResponseMapAnnotation.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIRichResponseMapAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation";
            };

            return AIRichResponseMapAnnotation;
        })();

        return AIRichResponseMapMetadata;
    })();

    proto.AIRichResponseMessage = (function() {

        function AIRichResponseMessage(p) {
            this.submessages = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseMessage.prototype.messageType = null;
        AIRichResponseMessage.prototype.submessages = $util.emptyArray;
        AIRichResponseMessage.prototype.unifiedResponse = null;
        AIRichResponseMessage.prototype.contextInfo = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseMessage.prototype, "_messageType", {
            get: $util.oneOfGetter($oneOfFields = ["messageType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseMessage.prototype, "_unifiedResponse", {
            get: $util.oneOfGetter($oneOfFields = ["unifiedResponse"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseMessage.prototype, "_contextInfo", {
            get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseMessage.create = function create(properties) {
            return new AIRichResponseMessage(properties);
        };

        AIRichResponseMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.messageType != null && Object.hasOwnProperty.call(m, "messageType"))
                w.uint32(8).int32(m.messageType);
            if (m.submessages != null && m.submessages.length) {
                for (var i = 0; i < m.submessages.length; ++i)
                    $root.proto.AIRichResponseSubMessage.encode(m.submessages[i], w.uint32(18).fork()).ldelim();
            }
            if (m.unifiedResponse != null && Object.hasOwnProperty.call(m, "unifiedResponse"))
                $root.proto.AIRichResponseUnifiedResponse.encode(m.unifiedResponse, w.uint32(26).fork()).ldelim();
            if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(34).fork()).ldelim();
            return w;
        };

        AIRichResponseMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.messageType = r.int32();
                        break;
                    }
                case 2: {
                        if (!(m.submessages && m.submessages.length))
                            m.submessages = [];
                        m.submessages.push($root.proto.AIRichResponseSubMessage.decode(r, r.uint32()));
                        break;
                    }
                case 3: {
                        m.unifiedResponse = $root.proto.AIRichResponseUnifiedResponse.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseMessage)
                return d;
            var m = new $root.proto.AIRichResponseMessage();
            switch (d.messageType) {
            default:
                if (typeof d.messageType === "number") {
                    m.messageType = d.messageType;
                    break;
                }
                break;
            case "AI_RICH_RESPONSE_TYPE_UNKNOWN":
            case 0:
                m.messageType = 0;
                break;
            case "AI_RICH_RESPONSE_TYPE_STANDARD":
            case 1:
                m.messageType = 1;
                break;
            }
            if (d.submessages) {
                if (!Array.isArray(d.submessages))
                    throw TypeError(".proto.AIRichResponseMessage.submessages: array expected");
                m.submessages = [];
                for (var i = 0; i < d.submessages.length; ++i) {
                    if (typeof d.submessages[i] !== "object")
                        throw TypeError(".proto.AIRichResponseMessage.submessages: object expected");
                    m.submessages[i] = $root.proto.AIRichResponseSubMessage.fromObject(d.submessages[i]);
                }
            }
            if (d.unifiedResponse != null) {
                if (typeof d.unifiedResponse !== "object")
                    throw TypeError(".proto.AIRichResponseMessage.unifiedResponse: object expected");
                m.unifiedResponse = $root.proto.AIRichResponseUnifiedResponse.fromObject(d.unifiedResponse);
            }
            if (d.contextInfo != null) {
                if (typeof d.contextInfo !== "object")
                    throw TypeError(".proto.AIRichResponseMessage.contextInfo: object expected");
                m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
            }
            return m;
        };

        AIRichResponseMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.submessages = [];
            }
            if (m.messageType != null && m.hasOwnProperty("messageType")) {
                d.messageType = o.enums === String ? $root.proto.AIRichResponseMessageType[m.messageType] === undefined ? m.messageType : $root.proto.AIRichResponseMessageType[m.messageType] : m.messageType;
                if (o.oneofs)
                    d._messageType = "messageType";
            }
            if (m.submessages && m.submessages.length) {
                d.submessages = [];
                for (var j = 0; j < m.submessages.length; ++j) {
                    d.submessages[j] = $root.proto.AIRichResponseSubMessage.toObject(m.submessages[j], o);
                }
            }
            if (m.unifiedResponse != null && m.hasOwnProperty("unifiedResponse")) {
                d.unifiedResponse = $root.proto.AIRichResponseUnifiedResponse.toObject(m.unifiedResponse, o);
                if (o.oneofs)
                    d._unifiedResponse = "unifiedResponse";
            }
            if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                if (o.oneofs)
                    d._contextInfo = "contextInfo";
            }
            return d;
        };

        AIRichResponseMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseMessage";
        };

        return AIRichResponseMessage;
    })();

    proto.AIRichResponseMessageType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "AI_RICH_RESPONSE_TYPE_UNKNOWN"] = 0;
        values[valuesById[1] = "AI_RICH_RESPONSE_TYPE_STANDARD"] = 1;
        return values;
    })();

    proto.AIRichResponseSubMessage = (function() {

        function AIRichResponseSubMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseSubMessage.prototype.messageType = null;
        AIRichResponseSubMessage.prototype.gridImageMetadata = null;
        AIRichResponseSubMessage.prototype.messageText = null;
        AIRichResponseSubMessage.prototype.imageMetadata = null;
        AIRichResponseSubMessage.prototype.codeMetadata = null;
        AIRichResponseSubMessage.prototype.tableMetadata = null;
        AIRichResponseSubMessage.prototype.dynamicMetadata = null;
        AIRichResponseSubMessage.prototype.latexMetadata = null;
        AIRichResponseSubMessage.prototype.mapMetadata = null;
        AIRichResponseSubMessage.prototype.contentItemsMetadata = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_messageType", {
            get: $util.oneOfGetter($oneOfFields = ["messageType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_gridImageMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["gridImageMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_messageText", {
            get: $util.oneOfGetter($oneOfFields = ["messageText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_imageMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["imageMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_codeMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["codeMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_tableMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["tableMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_dynamicMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["dynamicMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_latexMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["latexMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_mapMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["mapMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseSubMessage.prototype, "_contentItemsMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["contentItemsMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseSubMessage.create = function create(properties) {
            return new AIRichResponseSubMessage(properties);
        };

        AIRichResponseSubMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.messageType != null && Object.hasOwnProperty.call(m, "messageType"))
                w.uint32(8).int32(m.messageType);
            if (m.gridImageMetadata != null && Object.hasOwnProperty.call(m, "gridImageMetadata"))
                $root.proto.AIRichResponseGridImageMetadata.encode(m.gridImageMetadata, w.uint32(18).fork()).ldelim();
            if (m.messageText != null && Object.hasOwnProperty.call(m, "messageText"))
                w.uint32(26).string(m.messageText);
            if (m.imageMetadata != null && Object.hasOwnProperty.call(m, "imageMetadata"))
                $root.proto.AIRichResponseInlineImageMetadata.encode(m.imageMetadata, w.uint32(34).fork()).ldelim();
            if (m.codeMetadata != null && Object.hasOwnProperty.call(m, "codeMetadata"))
                $root.proto.AIRichResponseCodeMetadata.encode(m.codeMetadata, w.uint32(42).fork()).ldelim();
            if (m.tableMetadata != null && Object.hasOwnProperty.call(m, "tableMetadata"))
                $root.proto.AIRichResponseTableMetadata.encode(m.tableMetadata, w.uint32(50).fork()).ldelim();
            if (m.dynamicMetadata != null && Object.hasOwnProperty.call(m, "dynamicMetadata"))
                $root.proto.AIRichResponseDynamicMetadata.encode(m.dynamicMetadata, w.uint32(58).fork()).ldelim();
            if (m.latexMetadata != null && Object.hasOwnProperty.call(m, "latexMetadata"))
                $root.proto.AIRichResponseLatexMetadata.encode(m.latexMetadata, w.uint32(66).fork()).ldelim();
            if (m.mapMetadata != null && Object.hasOwnProperty.call(m, "mapMetadata"))
                $root.proto.AIRichResponseMapMetadata.encode(m.mapMetadata, w.uint32(74).fork()).ldelim();
            if (m.contentItemsMetadata != null && Object.hasOwnProperty.call(m, "contentItemsMetadata"))
                $root.proto.AIRichResponseContentItemsMetadata.encode(m.contentItemsMetadata, w.uint32(82).fork()).ldelim();
            return w;
        };

        AIRichResponseSubMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseSubMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.messageType = r.int32();
                        break;
                    }
                case 2: {
                        m.gridImageMetadata = $root.proto.AIRichResponseGridImageMetadata.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.messageText = r.string();
                        break;
                    }
                case 4: {
                        m.imageMetadata = $root.proto.AIRichResponseInlineImageMetadata.decode(r, r.uint32());
                        break;
                    }
                case 5: {
                        m.codeMetadata = $root.proto.AIRichResponseCodeMetadata.decode(r, r.uint32());
                        break;
                    }
                case 6: {
                        m.tableMetadata = $root.proto.AIRichResponseTableMetadata.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.dynamicMetadata = $root.proto.AIRichResponseDynamicMetadata.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.latexMetadata = $root.proto.AIRichResponseLatexMetadata.decode(r, r.uint32());
                        break;
                    }
                case 9: {
                        m.mapMetadata = $root.proto.AIRichResponseMapMetadata.decode(r, r.uint32());
                        break;
                    }
                case 10: {
                        m.contentItemsMetadata = $root.proto.AIRichResponseContentItemsMetadata.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseSubMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseSubMessage)
                return d;
            var m = new $root.proto.AIRichResponseSubMessage();
            switch (d.messageType) {
            default:
                if (typeof d.messageType === "number") {
                    m.messageType = d.messageType;
                    break;
                }
                break;
            case "AI_RICH_RESPONSE_UNKNOWN":
            case 0:
                m.messageType = 0;
                break;
            case "AI_RICH_RESPONSE_GRID_IMAGE":
            case 1:
                m.messageType = 1;
                break;
            case "AI_RICH_RESPONSE_TEXT":
            case 2:
                m.messageType = 2;
                break;
            case "AI_RICH_RESPONSE_INLINE_IMAGE":
            case 3:
                m.messageType = 3;
                break;
            case "AI_RICH_RESPONSE_TABLE":
            case 4:
                m.messageType = 4;
                break;
            case "AI_RICH_RESPONSE_CODE":
            case 5:
                m.messageType = 5;
                break;
            case "AI_RICH_RESPONSE_DYNAMIC":
            case 6:
                m.messageType = 6;
                break;
            case "AI_RICH_RESPONSE_MAP":
            case 7:
                m.messageType = 7;
                break;
            case "AI_RICH_RESPONSE_LATEX":
            case 8:
                m.messageType = 8;
                break;
            case "AI_RICH_RESPONSE_CONTENT_ITEMS":
            case 9:
                m.messageType = 9;
                break;
            }
            if (d.gridImageMetadata != null) {
                if (typeof d.gridImageMetadata !== "object")
                    throw TypeError(".proto.AIRichResponseSubMessage.gridImageMetadata: object expected");
                m.gridImageMetadata = $root.proto.AIRichResponseGridImageMetadata.fromObject(d.gridImageMetadata);
            }
            if (d.messageText != null) {
                m.messageText = String(d.messageText);
            }
            if (d.imageMetadata != null) {
                if (typeof d.imageMetadata !== "object")
                    throw TypeError(".proto.AIRichResponseSubMessage.imageMetadata: object expected");
                m.imageMetadata = $root.proto.AIRichResponseInlineImageMetadata.fromObject(d.imageMetadata);
            }
            if (d.codeMetadata != null) {
                if (typeof d.codeMetadata !== "object")
                    throw TypeError(".proto.AIRichResponseSubMessage.codeMetadata: object expected");
                m.codeMetadata = $root.proto.AIRichResponseCodeMetadata.fromObject(d.codeMetadata);
            }
            if (d.tableMetadata != null) {
                if (typeof d.tableMetadata !== "object")
                    throw TypeError(".proto.AIRichResponseSubMessage.tableMetadata: object expected");
                m.tableMetadata = $root.proto.AIRichResponseTableMetadata.fromObject(d.tableMetadata);
            }
            if (d.dynamicMetadata != null) {
                if (typeof d.dynamicMetadata !== "object")
                    throw TypeError(".proto.AIRichResponseSubMessage.dynamicMetadata: object expected");
                m.dynamicMetadata = $root.proto.AIRichResponseDynamicMetadata.fromObject(d.dynamicMetadata);
            }
            if (d.latexMetadata != null) {
                if (typeof d.latexMetadata !== "object")
                    throw TypeError(".proto.AIRichResponseSubMessage.latexMetadata: object expected");
                m.latexMetadata = $root.proto.AIRichResponseLatexMetadata.fromObject(d.latexMetadata);
            }
            if (d.mapMetadata != null) {
                if (typeof d.mapMetadata !== "object")
                    throw TypeError(".proto.AIRichResponseSubMessage.mapMetadata: object expected");
                m.mapMetadata = $root.proto.AIRichResponseMapMetadata.fromObject(d.mapMetadata);
            }
            if (d.contentItemsMetadata != null) {
                if (typeof d.contentItemsMetadata !== "object")
                    throw TypeError(".proto.AIRichResponseSubMessage.contentItemsMetadata: object expected");
                m.contentItemsMetadata = $root.proto.AIRichResponseContentItemsMetadata.fromObject(d.contentItemsMetadata);
            }
            return m;
        };

        AIRichResponseSubMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.messageType != null && m.hasOwnProperty("messageType")) {
                d.messageType = o.enums === String ? $root.proto.AIRichResponseSubMessageType[m.messageType] === undefined ? m.messageType : $root.proto.AIRichResponseSubMessageType[m.messageType] : m.messageType;
                if (o.oneofs)
                    d._messageType = "messageType";
            }
            if (m.gridImageMetadata != null && m.hasOwnProperty("gridImageMetadata")) {
                d.gridImageMetadata = $root.proto.AIRichResponseGridImageMetadata.toObject(m.gridImageMetadata, o);
                if (o.oneofs)
                    d._gridImageMetadata = "gridImageMetadata";
            }
            if (m.messageText != null && m.hasOwnProperty("messageText")) {
                d.messageText = m.messageText;
                if (o.oneofs)
                    d._messageText = "messageText";
            }
            if (m.imageMetadata != null && m.hasOwnProperty("imageMetadata")) {
                d.imageMetadata = $root.proto.AIRichResponseInlineImageMetadata.toObject(m.imageMetadata, o);
                if (o.oneofs)
                    d._imageMetadata = "imageMetadata";
            }
            if (m.codeMetadata != null && m.hasOwnProperty("codeMetadata")) {
                d.codeMetadata = $root.proto.AIRichResponseCodeMetadata.toObject(m.codeMetadata, o);
                if (o.oneofs)
                    d._codeMetadata = "codeMetadata";
            }
            if (m.tableMetadata != null && m.hasOwnProperty("tableMetadata")) {
                d.tableMetadata = $root.proto.AIRichResponseTableMetadata.toObject(m.tableMetadata, o);
                if (o.oneofs)
                    d._tableMetadata = "tableMetadata";
            }
            if (m.dynamicMetadata != null && m.hasOwnProperty("dynamicMetadata")) {
                d.dynamicMetadata = $root.proto.AIRichResponseDynamicMetadata.toObject(m.dynamicMetadata, o);
                if (o.oneofs)
                    d._dynamicMetadata = "dynamicMetadata";
            }
            if (m.latexMetadata != null && m.hasOwnProperty("latexMetadata")) {
                d.latexMetadata = $root.proto.AIRichResponseLatexMetadata.toObject(m.latexMetadata, o);
                if (o.oneofs)
                    d._latexMetadata = "latexMetadata";
            }
            if (m.mapMetadata != null && m.hasOwnProperty("mapMetadata")) {
                d.mapMetadata = $root.proto.AIRichResponseMapMetadata.toObject(m.mapMetadata, o);
                if (o.oneofs)
                    d._mapMetadata = "mapMetadata";
            }
            if (m.contentItemsMetadata != null && m.hasOwnProperty("contentItemsMetadata")) {
                d.contentItemsMetadata = $root.proto.AIRichResponseContentItemsMetadata.toObject(m.contentItemsMetadata, o);
                if (o.oneofs)
                    d._contentItemsMetadata = "contentItemsMetadata";
            }
            return d;
        };

        AIRichResponseSubMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseSubMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseSubMessage";
        };

        return AIRichResponseSubMessage;
    })();

    proto.AIRichResponseSubMessageType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "AI_RICH_RESPONSE_UNKNOWN"] = 0;
        values[valuesById[1] = "AI_RICH_RESPONSE_GRID_IMAGE"] = 1;
        values[valuesById[2] = "AI_RICH_RESPONSE_TEXT"] = 2;
        values[valuesById[3] = "AI_RICH_RESPONSE_INLINE_IMAGE"] = 3;
        values[valuesById[4] = "AI_RICH_RESPONSE_TABLE"] = 4;
        values[valuesById[5] = "AI_RICH_RESPONSE_CODE"] = 5;
        values[valuesById[6] = "AI_RICH_RESPONSE_DYNAMIC"] = 6;
        values[valuesById[7] = "AI_RICH_RESPONSE_MAP"] = 7;
        values[valuesById[8] = "AI_RICH_RESPONSE_LATEX"] = 8;
        values[valuesById[9] = "AI_RICH_RESPONSE_CONTENT_ITEMS"] = 9;
        return values;
    })();

    proto.AIRichResponseTableMetadata = (function() {

        function AIRichResponseTableMetadata(p) {
            this.rows = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseTableMetadata.prototype.rows = $util.emptyArray;
        AIRichResponseTableMetadata.prototype.title = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseTableMetadata.prototype, "_title", {
            get: $util.oneOfGetter($oneOfFields = ["title"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseTableMetadata.create = function create(properties) {
            return new AIRichResponseTableMetadata(properties);
        };

        AIRichResponseTableMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.rows != null && m.rows.length) {
                for (var i = 0; i < m.rows.length; ++i)
                    $root.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.encode(m.rows[i], w.uint32(10).fork()).ldelim();
            }
            if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                w.uint32(18).string(m.title);
            return w;
        };

        AIRichResponseTableMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseTableMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.rows && m.rows.length))
                            m.rows = [];
                        m.rows.push($root.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.decode(r, r.uint32()));
                        break;
                    }
                case 2: {
                        m.title = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseTableMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseTableMetadata)
                return d;
            var m = new $root.proto.AIRichResponseTableMetadata();
            if (d.rows) {
                if (!Array.isArray(d.rows))
                    throw TypeError(".proto.AIRichResponseTableMetadata.rows: array expected");
                m.rows = [];
                for (var i = 0; i < d.rows.length; ++i) {
                    if (typeof d.rows[i] !== "object")
                        throw TypeError(".proto.AIRichResponseTableMetadata.rows: object expected");
                    m.rows[i] = $root.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.fromObject(d.rows[i]);
                }
            }
            if (d.title != null) {
                m.title = String(d.title);
            }
            return m;
        };

        AIRichResponseTableMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.rows = [];
            }
            if (m.rows && m.rows.length) {
                d.rows = [];
                for (var j = 0; j < m.rows.length; ++j) {
                    d.rows[j] = $root.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.toObject(m.rows[j], o);
                }
            }
            if (m.title != null && m.hasOwnProperty("title")) {
                d.title = m.title;
                if (o.oneofs)
                    d._title = "title";
            }
            return d;
        };

        AIRichResponseTableMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseTableMetadata";
        };

        AIRichResponseTableMetadata.AIRichResponseTableRow = (function() {

            function AIRichResponseTableRow(p) {
                this.items = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIRichResponseTableRow.prototype.items = $util.emptyArray;
            AIRichResponseTableRow.prototype.isHeading = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIRichResponseTableRow.prototype, "_isHeading", {
                get: $util.oneOfGetter($oneOfFields = ["isHeading"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIRichResponseTableRow.create = function create(properties) {
                return new AIRichResponseTableRow(properties);
            };

            AIRichResponseTableRow.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.items != null && m.items.length) {
                    for (var i = 0; i < m.items.length; ++i)
                        w.uint32(10).string(m.items[i]);
                }
                if (m.isHeading != null && Object.hasOwnProperty.call(m, "isHeading"))
                    w.uint32(16).bool(m.isHeading);
                return w;
            };

            AIRichResponseTableRow.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseTableMetadata.AIRichResponseTableRow();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.items && m.items.length))
                                m.items = [];
                            m.items.push(r.string());
                            break;
                        }
                    case 2: {
                            m.isHeading = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIRichResponseTableRow.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIRichResponseTableMetadata.AIRichResponseTableRow)
                    return d;
                var m = new $root.proto.AIRichResponseTableMetadata.AIRichResponseTableRow();
                if (d.items) {
                    if (!Array.isArray(d.items))
                        throw TypeError(".proto.AIRichResponseTableMetadata.AIRichResponseTableRow.items: array expected");
                    m.items = [];
                    for (var i = 0; i < d.items.length; ++i) {
                        m.items[i] = String(d.items[i]);
                    }
                }
                if (d.isHeading != null) {
                    m.isHeading = Boolean(d.isHeading);
                }
                return m;
            };

            AIRichResponseTableRow.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.items = [];
                }
                if (m.items && m.items.length) {
                    d.items = [];
                    for (var j = 0; j < m.items.length; ++j) {
                        d.items[j] = m.items[j];
                    }
                }
                if (m.isHeading != null && m.hasOwnProperty("isHeading")) {
                    d.isHeading = m.isHeading;
                    if (o.oneofs)
                        d._isHeading = "isHeading";
                }
                return d;
            };

            AIRichResponseTableRow.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIRichResponseTableRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIRichResponseTableMetadata.AIRichResponseTableRow";
            };

            return AIRichResponseTableRow;
        })();

        return AIRichResponseTableMetadata;
    })();

    proto.AIRichResponseUnifiedResponse = (function() {

        function AIRichResponseUnifiedResponse(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIRichResponseUnifiedResponse.prototype.data = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIRichResponseUnifiedResponse.prototype, "_data", {
            get: $util.oneOfGetter($oneOfFields = ["data"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIRichResponseUnifiedResponse.create = function create(properties) {
            return new AIRichResponseUnifiedResponse(properties);
        };

        AIRichResponseUnifiedResponse.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.data != null && Object.hasOwnProperty.call(m, "data"))
                w.uint32(10).bytes(m.data);
            return w;
        };

        AIRichResponseUnifiedResponse.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseUnifiedResponse();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.data = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIRichResponseUnifiedResponse.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIRichResponseUnifiedResponse)
                return d;
            var m = new $root.proto.AIRichResponseUnifiedResponse();
            if (d.data != null) {
                if (typeof d.data === "string")
                    $util.base64.decode(d.data, m.data = $util.newBuffer($util.base64.length(d.data)), 0);
                else if (d.data.length >= 0)
                    m.data = d.data;
            }
            return m;
        };

        AIRichResponseUnifiedResponse.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.data != null && m.hasOwnProperty("data")) {
                d.data = o.bytes === String ? $util.base64.encode(m.data, 0, m.data.length) : o.bytes === Array ? Array.prototype.slice.call(m.data) : m.data;
                if (o.oneofs)
                    d._data = "data";
            }
            return d;
        };

        AIRichResponseUnifiedResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIRichResponseUnifiedResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIRichResponseUnifiedResponse";
        };

        return AIRichResponseUnifiedResponse;
    })();

    proto.AIThreadInfo = (function() {

        function AIThreadInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AIThreadInfo.prototype.serverInfo = null;
        AIThreadInfo.prototype.clientInfo = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIThreadInfo.prototype, "_serverInfo", {
            get: $util.oneOfGetter($oneOfFields = ["serverInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AIThreadInfo.prototype, "_clientInfo", {
            get: $util.oneOfGetter($oneOfFields = ["clientInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AIThreadInfo.create = function create(properties) {
            return new AIThreadInfo(properties);
        };

        AIThreadInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.serverInfo != null && Object.hasOwnProperty.call(m, "serverInfo"))
                $root.proto.AIThreadInfo.AIThreadServerInfo.encode(m.serverInfo, w.uint32(10).fork()).ldelim();
            if (m.clientInfo != null && Object.hasOwnProperty.call(m, "clientInfo"))
                $root.proto.AIThreadInfo.AIThreadClientInfo.encode(m.clientInfo, w.uint32(18).fork()).ldelim();
            return w;
        };

        AIThreadInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIThreadInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.serverInfo = $root.proto.AIThreadInfo.AIThreadServerInfo.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.clientInfo = $root.proto.AIThreadInfo.AIThreadClientInfo.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AIThreadInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AIThreadInfo)
                return d;
            var m = new $root.proto.AIThreadInfo();
            if (d.serverInfo != null) {
                if (typeof d.serverInfo !== "object")
                    throw TypeError(".proto.AIThreadInfo.serverInfo: object expected");
                m.serverInfo = $root.proto.AIThreadInfo.AIThreadServerInfo.fromObject(d.serverInfo);
            }
            if (d.clientInfo != null) {
                if (typeof d.clientInfo !== "object")
                    throw TypeError(".proto.AIThreadInfo.clientInfo: object expected");
                m.clientInfo = $root.proto.AIThreadInfo.AIThreadClientInfo.fromObject(d.clientInfo);
            }
            return m;
        };

        AIThreadInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.serverInfo != null && m.hasOwnProperty("serverInfo")) {
                d.serverInfo = $root.proto.AIThreadInfo.AIThreadServerInfo.toObject(m.serverInfo, o);
                if (o.oneofs)
                    d._serverInfo = "serverInfo";
            }
            if (m.clientInfo != null && m.hasOwnProperty("clientInfo")) {
                d.clientInfo = $root.proto.AIThreadInfo.AIThreadClientInfo.toObject(m.clientInfo, o);
                if (o.oneofs)
                    d._clientInfo = "clientInfo";
            }
            return d;
        };

        AIThreadInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AIThreadInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AIThreadInfo";
        };

        AIThreadInfo.AIThreadClientInfo = (function() {

            function AIThreadClientInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIThreadClientInfo.prototype.type = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIThreadClientInfo.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIThreadClientInfo.create = function create(properties) {
                return new AIThreadClientInfo(properties);
            };

            AIThreadClientInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(8).int32(m.type);
                return w;
            };

            AIThreadClientInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIThreadInfo.AIThreadClientInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.type = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIThreadClientInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIThreadInfo.AIThreadClientInfo)
                    return d;
                var m = new $root.proto.AIThreadInfo.AIThreadClientInfo();
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.type = 0;
                    break;
                case "DEFAULT":
                case 1:
                    m.type = 1;
                    break;
                case "INCOGNITO":
                case 2:
                    m.type = 2;
                    break;
                }
                return m;
            };

            AIThreadClientInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[m.type] === undefined ? m.type : $root.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                return d;
            };

            AIThreadClientInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIThreadClientInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIThreadInfo.AIThreadClientInfo";
            };

            AIThreadClientInfo.AIThreadType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "DEFAULT"] = 1;
                values[valuesById[2] = "INCOGNITO"] = 2;
                return values;
            })();

            return AIThreadClientInfo;
        })();

        AIThreadInfo.AIThreadServerInfo = (function() {

            function AIThreadServerInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AIThreadServerInfo.prototype.title = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AIThreadServerInfo.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AIThreadServerInfo.create = function create(properties) {
                return new AIThreadServerInfo(properties);
            };

            AIThreadServerInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(10).string(m.title);
                return w;
            };

            AIThreadServerInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIThreadInfo.AIThreadServerInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.title = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AIThreadServerInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.AIThreadInfo.AIThreadServerInfo)
                    return d;
                var m = new $root.proto.AIThreadInfo.AIThreadServerInfo();
                if (d.title != null) {
                    m.title = String(d.title);
                }
                return m;
            };

            AIThreadServerInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                return d;
            };

            AIThreadServerInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AIThreadServerInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.AIThreadInfo.AIThreadServerInfo";
            };

            return AIThreadServerInfo;
        })();

        return AIThreadInfo;
    })();

    proto.Account = (function() {

        function Account(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Account.prototype.lid = null;
        Account.prototype.username = null;
        Account.prototype.countryCode = null;
        Account.prototype.isUsernameDeleted = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Account.prototype, "_lid", {
            get: $util.oneOfGetter($oneOfFields = ["lid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Account.prototype, "_username", {
            get: $util.oneOfGetter($oneOfFields = ["username"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Account.prototype, "_countryCode", {
            get: $util.oneOfGetter($oneOfFields = ["countryCode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Account.prototype, "_isUsernameDeleted", {
            get: $util.oneOfGetter($oneOfFields = ["isUsernameDeleted"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Account.create = function create(properties) {
            return new Account(properties);
        };

        Account.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.lid != null && Object.hasOwnProperty.call(m, "lid"))
                w.uint32(10).string(m.lid);
            if (m.username != null && Object.hasOwnProperty.call(m, "username"))
                w.uint32(18).string(m.username);
            if (m.countryCode != null && Object.hasOwnProperty.call(m, "countryCode"))
                w.uint32(26).string(m.countryCode);
            if (m.isUsernameDeleted != null && Object.hasOwnProperty.call(m, "isUsernameDeleted"))
                w.uint32(32).bool(m.isUsernameDeleted);
            return w;
        };

        Account.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Account();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.lid = r.string();
                        break;
                    }
                case 2: {
                        m.username = r.string();
                        break;
                    }
                case 3: {
                        m.countryCode = r.string();
                        break;
                    }
                case 4: {
                        m.isUsernameDeleted = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Account.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Account)
                return d;
            var m = new $root.proto.Account();
            if (d.lid != null) {
                m.lid = String(d.lid);
            }
            if (d.username != null) {
                m.username = String(d.username);
            }
            if (d.countryCode != null) {
                m.countryCode = String(d.countryCode);
            }
            if (d.isUsernameDeleted != null) {
                m.isUsernameDeleted = Boolean(d.isUsernameDeleted);
            }
            return m;
        };

        Account.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.lid != null && m.hasOwnProperty("lid")) {
                d.lid = m.lid;
                if (o.oneofs)
                    d._lid = "lid";
            }
            if (m.username != null && m.hasOwnProperty("username")) {
                d.username = m.username;
                if (o.oneofs)
                    d._username = "username";
            }
            if (m.countryCode != null && m.hasOwnProperty("countryCode")) {
                d.countryCode = m.countryCode;
                if (o.oneofs)
                    d._countryCode = "countryCode";
            }
            if (m.isUsernameDeleted != null && m.hasOwnProperty("isUsernameDeleted")) {
                d.isUsernameDeleted = m.isUsernameDeleted;
                if (o.oneofs)
                    d._isUsernameDeleted = "isUsernameDeleted";
            }
            return d;
        };

        Account.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Account.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Account";
        };

        return Account;
    })();

    proto.ActionLink = (function() {

        function ActionLink(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ActionLink.prototype.url = null;
        ActionLink.prototype.buttonTitle = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ActionLink.prototype, "_url", {
            get: $util.oneOfGetter($oneOfFields = ["url"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ActionLink.prototype, "_buttonTitle", {
            get: $util.oneOfGetter($oneOfFields = ["buttonTitle"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ActionLink.create = function create(properties) {
            return new ActionLink(properties);
        };

        ActionLink.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                w.uint32(10).string(m.url);
            if (m.buttonTitle != null && Object.hasOwnProperty.call(m, "buttonTitle"))
                w.uint32(18).string(m.buttonTitle);
            return w;
        };

        ActionLink.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ActionLink();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.url = r.string();
                        break;
                    }
                case 2: {
                        m.buttonTitle = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ActionLink.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ActionLink)
                return d;
            var m = new $root.proto.ActionLink();
            if (d.url != null) {
                m.url = String(d.url);
            }
            if (d.buttonTitle != null) {
                m.buttonTitle = String(d.buttonTitle);
            }
            return m;
        };

        ActionLink.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.url != null && m.hasOwnProperty("url")) {
                d.url = m.url;
                if (o.oneofs)
                    d._url = "url";
            }
            if (m.buttonTitle != null && m.hasOwnProperty("buttonTitle")) {
                d.buttonTitle = m.buttonTitle;
                if (o.oneofs)
                    d._buttonTitle = "buttonTitle";
            }
            return d;
        };

        ActionLink.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ActionLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ActionLink";
        };

        return ActionLink;
    })();

    proto.AutoDownloadSettings = (function() {

        function AutoDownloadSettings(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AutoDownloadSettings.prototype.downloadImages = null;
        AutoDownloadSettings.prototype.downloadAudio = null;
        AutoDownloadSettings.prototype.downloadVideo = null;
        AutoDownloadSettings.prototype.downloadDocuments = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AutoDownloadSettings.prototype, "_downloadImages", {
            get: $util.oneOfGetter($oneOfFields = ["downloadImages"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AutoDownloadSettings.prototype, "_downloadAudio", {
            get: $util.oneOfGetter($oneOfFields = ["downloadAudio"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AutoDownloadSettings.prototype, "_downloadVideo", {
            get: $util.oneOfGetter($oneOfFields = ["downloadVideo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AutoDownloadSettings.prototype, "_downloadDocuments", {
            get: $util.oneOfGetter($oneOfFields = ["downloadDocuments"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AutoDownloadSettings.create = function create(properties) {
            return new AutoDownloadSettings(properties);
        };

        AutoDownloadSettings.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.downloadImages != null && Object.hasOwnProperty.call(m, "downloadImages"))
                w.uint32(8).bool(m.downloadImages);
            if (m.downloadAudio != null && Object.hasOwnProperty.call(m, "downloadAudio"))
                w.uint32(16).bool(m.downloadAudio);
            if (m.downloadVideo != null && Object.hasOwnProperty.call(m, "downloadVideo"))
                w.uint32(24).bool(m.downloadVideo);
            if (m.downloadDocuments != null && Object.hasOwnProperty.call(m, "downloadDocuments"))
                w.uint32(32).bool(m.downloadDocuments);
            return w;
        };

        AutoDownloadSettings.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AutoDownloadSettings();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.downloadImages = r.bool();
                        break;
                    }
                case 2: {
                        m.downloadAudio = r.bool();
                        break;
                    }
                case 3: {
                        m.downloadVideo = r.bool();
                        break;
                    }
                case 4: {
                        m.downloadDocuments = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AutoDownloadSettings.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AutoDownloadSettings)
                return d;
            var m = new $root.proto.AutoDownloadSettings();
            if (d.downloadImages != null) {
                m.downloadImages = Boolean(d.downloadImages);
            }
            if (d.downloadAudio != null) {
                m.downloadAudio = Boolean(d.downloadAudio);
            }
            if (d.downloadVideo != null) {
                m.downloadVideo = Boolean(d.downloadVideo);
            }
            if (d.downloadDocuments != null) {
                m.downloadDocuments = Boolean(d.downloadDocuments);
            }
            return m;
        };

        AutoDownloadSettings.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.downloadImages != null && m.hasOwnProperty("downloadImages")) {
                d.downloadImages = m.downloadImages;
                if (o.oneofs)
                    d._downloadImages = "downloadImages";
            }
            if (m.downloadAudio != null && m.hasOwnProperty("downloadAudio")) {
                d.downloadAudio = m.downloadAudio;
                if (o.oneofs)
                    d._downloadAudio = "downloadAudio";
            }
            if (m.downloadVideo != null && m.hasOwnProperty("downloadVideo")) {
                d.downloadVideo = m.downloadVideo;
                if (o.oneofs)
                    d._downloadVideo = "downloadVideo";
            }
            if (m.downloadDocuments != null && m.hasOwnProperty("downloadDocuments")) {
                d.downloadDocuments = m.downloadDocuments;
                if (o.oneofs)
                    d._downloadDocuments = "downloadDocuments";
            }
            return d;
        };

        AutoDownloadSettings.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AutoDownloadSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AutoDownloadSettings";
        };

        return AutoDownloadSettings;
    })();

    proto.AvatarUserSettings = (function() {

        function AvatarUserSettings(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        AvatarUserSettings.prototype.fbid = null;
        AvatarUserSettings.prototype.password = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AvatarUserSettings.prototype, "_fbid", {
            get: $util.oneOfGetter($oneOfFields = ["fbid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(AvatarUserSettings.prototype, "_password", {
            get: $util.oneOfGetter($oneOfFields = ["password"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        AvatarUserSettings.create = function create(properties) {
            return new AvatarUserSettings(properties);
        };

        AvatarUserSettings.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.fbid != null && Object.hasOwnProperty.call(m, "fbid"))
                w.uint32(10).string(m.fbid);
            if (m.password != null && Object.hasOwnProperty.call(m, "password"))
                w.uint32(18).string(m.password);
            return w;
        };

        AvatarUserSettings.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AvatarUserSettings();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.fbid = r.string();
                        break;
                    }
                case 2: {
                        m.password = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        AvatarUserSettings.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.AvatarUserSettings)
                return d;
            var m = new $root.proto.AvatarUserSettings();
            if (d.fbid != null) {
                m.fbid = String(d.fbid);
            }
            if (d.password != null) {
                m.password = String(d.password);
            }
            return m;
        };

        AvatarUserSettings.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.fbid != null && m.hasOwnProperty("fbid")) {
                d.fbid = m.fbid;
                if (o.oneofs)
                    d._fbid = "fbid";
            }
            if (m.password != null && m.hasOwnProperty("password")) {
                d.password = m.password;
                if (o.oneofs)
                    d._password = "password";
            }
            return d;
        };

        AvatarUserSettings.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        AvatarUserSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.AvatarUserSettings";
        };

        return AvatarUserSettings;
    })();

    proto.BizAccountLinkInfo = (function() {

        function BizAccountLinkInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BizAccountLinkInfo.prototype.whatsappBizAcctFbid = null;
        BizAccountLinkInfo.prototype.whatsappAcctNumber = null;
        BizAccountLinkInfo.prototype.issueTime = null;
        BizAccountLinkInfo.prototype.hostStorage = null;
        BizAccountLinkInfo.prototype.accountType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizAccountLinkInfo.prototype, "_whatsappBizAcctFbid", {
            get: $util.oneOfGetter($oneOfFields = ["whatsappBizAcctFbid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizAccountLinkInfo.prototype, "_whatsappAcctNumber", {
            get: $util.oneOfGetter($oneOfFields = ["whatsappAcctNumber"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizAccountLinkInfo.prototype, "_issueTime", {
            get: $util.oneOfGetter($oneOfFields = ["issueTime"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizAccountLinkInfo.prototype, "_hostStorage", {
            get: $util.oneOfGetter($oneOfFields = ["hostStorage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizAccountLinkInfo.prototype, "_accountType", {
            get: $util.oneOfGetter($oneOfFields = ["accountType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BizAccountLinkInfo.create = function create(properties) {
            return new BizAccountLinkInfo(properties);
        };

        BizAccountLinkInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.whatsappBizAcctFbid != null && Object.hasOwnProperty.call(m, "whatsappBizAcctFbid"))
                w.uint32(8).uint64(m.whatsappBizAcctFbid);
            if (m.whatsappAcctNumber != null && Object.hasOwnProperty.call(m, "whatsappAcctNumber"))
                w.uint32(18).string(m.whatsappAcctNumber);
            if (m.issueTime != null && Object.hasOwnProperty.call(m, "issueTime"))
                w.uint32(24).uint64(m.issueTime);
            if (m.hostStorage != null && Object.hasOwnProperty.call(m, "hostStorage"))
                w.uint32(32).int32(m.hostStorage);
            if (m.accountType != null && Object.hasOwnProperty.call(m, "accountType"))
                w.uint32(40).int32(m.accountType);
            return w;
        };

        BizAccountLinkInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BizAccountLinkInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.whatsappBizAcctFbid = r.uint64();
                        break;
                    }
                case 2: {
                        m.whatsappAcctNumber = r.string();
                        break;
                    }
                case 3: {
                        m.issueTime = r.uint64();
                        break;
                    }
                case 4: {
                        m.hostStorage = r.int32();
                        break;
                    }
                case 5: {
                        m.accountType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BizAccountLinkInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BizAccountLinkInfo)
                return d;
            var m = new $root.proto.BizAccountLinkInfo();
            if (d.whatsappBizAcctFbid != null) {
                if ($util.Long)
                    (m.whatsappBizAcctFbid = $util.Long.fromValue(d.whatsappBizAcctFbid)).unsigned = true;
                else if (typeof d.whatsappBizAcctFbid === "string")
                    m.whatsappBizAcctFbid = parseInt(d.whatsappBizAcctFbid, 10);
                else if (typeof d.whatsappBizAcctFbid === "number")
                    m.whatsappBizAcctFbid = d.whatsappBizAcctFbid;
                else if (typeof d.whatsappBizAcctFbid === "object")
                    m.whatsappBizAcctFbid = new $util.LongBits(d.whatsappBizAcctFbid.low >>> 0, d.whatsappBizAcctFbid.high >>> 0).toNumber(true);
            }
            if (d.whatsappAcctNumber != null) {
                m.whatsappAcctNumber = String(d.whatsappAcctNumber);
            }
            if (d.issueTime != null) {
                if ($util.Long)
                    (m.issueTime = $util.Long.fromValue(d.issueTime)).unsigned = true;
                else if (typeof d.issueTime === "string")
                    m.issueTime = parseInt(d.issueTime, 10);
                else if (typeof d.issueTime === "number")
                    m.issueTime = d.issueTime;
                else if (typeof d.issueTime === "object")
                    m.issueTime = new $util.LongBits(d.issueTime.low >>> 0, d.issueTime.high >>> 0).toNumber(true);
            }
            switch (d.hostStorage) {
            default:
                if (typeof d.hostStorage === "number") {
                    m.hostStorage = d.hostStorage;
                    break;
                }
                break;
            case "ON_PREMISE":
            case 0:
                m.hostStorage = 0;
                break;
            case "FACEBOOK":
            case 1:
                m.hostStorage = 1;
                break;
            }
            switch (d.accountType) {
            default:
                if (typeof d.accountType === "number") {
                    m.accountType = d.accountType;
                    break;
                }
                break;
            case "ENTERPRISE":
            case 0:
                m.accountType = 0;
                break;
            }
            return m;
        };

        BizAccountLinkInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.whatsappBizAcctFbid != null && m.hasOwnProperty("whatsappBizAcctFbid")) {
                if (typeof m.whatsappBizAcctFbid === "number")
                    d.whatsappBizAcctFbid = o.longs === String ? String(m.whatsappBizAcctFbid) : m.whatsappBizAcctFbid;
                else
                    d.whatsappBizAcctFbid = o.longs === String ? longToString(m.whatsappBizAcctFbid, true) : o.longs === Number ? longToNumber(m.whatsappBizAcctFbid, true) : m.whatsappBizAcctFbid;
                if (o.oneofs)
                    d._whatsappBizAcctFbid = "whatsappBizAcctFbid";
            }
            if (m.whatsappAcctNumber != null && m.hasOwnProperty("whatsappAcctNumber")) {
                d.whatsappAcctNumber = m.whatsappAcctNumber;
                if (o.oneofs)
                    d._whatsappAcctNumber = "whatsappAcctNumber";
            }
            if (m.issueTime != null && m.hasOwnProperty("issueTime")) {
                if (typeof m.issueTime === "number")
                    d.issueTime = o.longs === String ? String(m.issueTime) : m.issueTime;
                else
                    d.issueTime = o.longs === String ? longToString(m.issueTime, true) : o.longs === Number ? longToNumber(m.issueTime, true) : m.issueTime;
                if (o.oneofs)
                    d._issueTime = "issueTime";
            }
            if (m.hostStorage != null && m.hasOwnProperty("hostStorage")) {
                d.hostStorage = o.enums === String ? $root.proto.BizAccountLinkInfo.HostStorageType[m.hostStorage] === undefined ? m.hostStorage : $root.proto.BizAccountLinkInfo.HostStorageType[m.hostStorage] : m.hostStorage;
                if (o.oneofs)
                    d._hostStorage = "hostStorage";
            }
            if (m.accountType != null && m.hasOwnProperty("accountType")) {
                d.accountType = o.enums === String ? $root.proto.BizAccountLinkInfo.AccountType[m.accountType] === undefined ? m.accountType : $root.proto.BizAccountLinkInfo.AccountType[m.accountType] : m.accountType;
                if (o.oneofs)
                    d._accountType = "accountType";
            }
            return d;
        };

        BizAccountLinkInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BizAccountLinkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BizAccountLinkInfo";
        };

        BizAccountLinkInfo.AccountType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "ENTERPRISE"] = 0;
            return values;
        })();

        BizAccountLinkInfo.HostStorageType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "ON_PREMISE"] = 0;
            values[valuesById[1] = "FACEBOOK"] = 1;
            return values;
        })();

        return BizAccountLinkInfo;
    })();

    proto.BizAccountPayload = (function() {

        function BizAccountPayload(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BizAccountPayload.prototype.vnameCert = null;
        BizAccountPayload.prototype.bizAcctLinkInfo = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizAccountPayload.prototype, "_vnameCert", {
            get: $util.oneOfGetter($oneOfFields = ["vnameCert"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizAccountPayload.prototype, "_bizAcctLinkInfo", {
            get: $util.oneOfGetter($oneOfFields = ["bizAcctLinkInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BizAccountPayload.create = function create(properties) {
            return new BizAccountPayload(properties);
        };

        BizAccountPayload.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.vnameCert != null && Object.hasOwnProperty.call(m, "vnameCert"))
                $root.proto.VerifiedNameCertificate.encode(m.vnameCert, w.uint32(10).fork()).ldelim();
            if (m.bizAcctLinkInfo != null && Object.hasOwnProperty.call(m, "bizAcctLinkInfo"))
                w.uint32(18).bytes(m.bizAcctLinkInfo);
            return w;
        };

        BizAccountPayload.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BizAccountPayload();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.vnameCert = $root.proto.VerifiedNameCertificate.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.bizAcctLinkInfo = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BizAccountPayload.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BizAccountPayload)
                return d;
            var m = new $root.proto.BizAccountPayload();
            if (d.vnameCert != null) {
                if (typeof d.vnameCert !== "object")
                    throw TypeError(".proto.BizAccountPayload.vnameCert: object expected");
                m.vnameCert = $root.proto.VerifiedNameCertificate.fromObject(d.vnameCert);
            }
            if (d.bizAcctLinkInfo != null) {
                if (typeof d.bizAcctLinkInfo === "string")
                    $util.base64.decode(d.bizAcctLinkInfo, m.bizAcctLinkInfo = $util.newBuffer($util.base64.length(d.bizAcctLinkInfo)), 0);
                else if (d.bizAcctLinkInfo.length >= 0)
                    m.bizAcctLinkInfo = d.bizAcctLinkInfo;
            }
            return m;
        };

        BizAccountPayload.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.vnameCert != null && m.hasOwnProperty("vnameCert")) {
                d.vnameCert = $root.proto.VerifiedNameCertificate.toObject(m.vnameCert, o);
                if (o.oneofs)
                    d._vnameCert = "vnameCert";
            }
            if (m.bizAcctLinkInfo != null && m.hasOwnProperty("bizAcctLinkInfo")) {
                d.bizAcctLinkInfo = o.bytes === String ? $util.base64.encode(m.bizAcctLinkInfo, 0, m.bizAcctLinkInfo.length) : o.bytes === Array ? Array.prototype.slice.call(m.bizAcctLinkInfo) : m.bizAcctLinkInfo;
                if (o.oneofs)
                    d._bizAcctLinkInfo = "bizAcctLinkInfo";
            }
            return d;
        };

        BizAccountPayload.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BizAccountPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BizAccountPayload";
        };

        return BizAccountPayload;
    })();

    proto.BizIdentityInfo = (function() {

        function BizIdentityInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BizIdentityInfo.prototype.vlevel = null;
        BizIdentityInfo.prototype.vnameCert = null;
        BizIdentityInfo.prototype.signed = null;
        BizIdentityInfo.prototype.revoked = null;
        BizIdentityInfo.prototype.hostStorage = null;
        BizIdentityInfo.prototype.actualActors = null;
        BizIdentityInfo.prototype.privacyModeTs = null;
        BizIdentityInfo.prototype.featureControls = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizIdentityInfo.prototype, "_vlevel", {
            get: $util.oneOfGetter($oneOfFields = ["vlevel"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizIdentityInfo.prototype, "_vnameCert", {
            get: $util.oneOfGetter($oneOfFields = ["vnameCert"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizIdentityInfo.prototype, "_signed", {
            get: $util.oneOfGetter($oneOfFields = ["signed"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizIdentityInfo.prototype, "_revoked", {
            get: $util.oneOfGetter($oneOfFields = ["revoked"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizIdentityInfo.prototype, "_hostStorage", {
            get: $util.oneOfGetter($oneOfFields = ["hostStorage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizIdentityInfo.prototype, "_actualActors", {
            get: $util.oneOfGetter($oneOfFields = ["actualActors"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizIdentityInfo.prototype, "_privacyModeTs", {
            get: $util.oneOfGetter($oneOfFields = ["privacyModeTs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BizIdentityInfo.prototype, "_featureControls", {
            get: $util.oneOfGetter($oneOfFields = ["featureControls"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BizIdentityInfo.create = function create(properties) {
            return new BizIdentityInfo(properties);
        };

        BizIdentityInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.vlevel != null && Object.hasOwnProperty.call(m, "vlevel"))
                w.uint32(8).int32(m.vlevel);
            if (m.vnameCert != null && Object.hasOwnProperty.call(m, "vnameCert"))
                $root.proto.VerifiedNameCertificate.encode(m.vnameCert, w.uint32(18).fork()).ldelim();
            if (m.signed != null && Object.hasOwnProperty.call(m, "signed"))
                w.uint32(24).bool(m.signed);
            if (m.revoked != null && Object.hasOwnProperty.call(m, "revoked"))
                w.uint32(32).bool(m.revoked);
            if (m.hostStorage != null && Object.hasOwnProperty.call(m, "hostStorage"))
                w.uint32(40).int32(m.hostStorage);
            if (m.actualActors != null && Object.hasOwnProperty.call(m, "actualActors"))
                w.uint32(48).int32(m.actualActors);
            if (m.privacyModeTs != null && Object.hasOwnProperty.call(m, "privacyModeTs"))
                w.uint32(56).uint64(m.privacyModeTs);
            if (m.featureControls != null && Object.hasOwnProperty.call(m, "featureControls"))
                w.uint32(64).uint64(m.featureControls);
            return w;
        };

        BizIdentityInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BizIdentityInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.vlevel = r.int32();
                        break;
                    }
                case 2: {
                        m.vnameCert = $root.proto.VerifiedNameCertificate.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.signed = r.bool();
                        break;
                    }
                case 4: {
                        m.revoked = r.bool();
                        break;
                    }
                case 5: {
                        m.hostStorage = r.int32();
                        break;
                    }
                case 6: {
                        m.actualActors = r.int32();
                        break;
                    }
                case 7: {
                        m.privacyModeTs = r.uint64();
                        break;
                    }
                case 8: {
                        m.featureControls = r.uint64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BizIdentityInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BizIdentityInfo)
                return d;
            var m = new $root.proto.BizIdentityInfo();
            switch (d.vlevel) {
            default:
                if (typeof d.vlevel === "number") {
                    m.vlevel = d.vlevel;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.vlevel = 0;
                break;
            case "LOW":
            case 1:
                m.vlevel = 1;
                break;
            case "HIGH":
            case 2:
                m.vlevel = 2;
                break;
            }
            if (d.vnameCert != null) {
                if (typeof d.vnameCert !== "object")
                    throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected");
                m.vnameCert = $root.proto.VerifiedNameCertificate.fromObject(d.vnameCert);
            }
            if (d.signed != null) {
                m.signed = Boolean(d.signed);
            }
            if (d.revoked != null) {
                m.revoked = Boolean(d.revoked);
            }
            switch (d.hostStorage) {
            default:
                if (typeof d.hostStorage === "number") {
                    m.hostStorage = d.hostStorage;
                    break;
                }
                break;
            case "ON_PREMISE":
            case 0:
                m.hostStorage = 0;
                break;
            case "FACEBOOK":
            case 1:
                m.hostStorage = 1;
                break;
            }
            switch (d.actualActors) {
            default:
                if (typeof d.actualActors === "number") {
                    m.actualActors = d.actualActors;
                    break;
                }
                break;
            case "SELF":
            case 0:
                m.actualActors = 0;
                break;
            case "BSP":
            case 1:
                m.actualActors = 1;
                break;
            }
            if (d.privacyModeTs != null) {
                if ($util.Long)
                    (m.privacyModeTs = $util.Long.fromValue(d.privacyModeTs)).unsigned = true;
                else if (typeof d.privacyModeTs === "string")
                    m.privacyModeTs = parseInt(d.privacyModeTs, 10);
                else if (typeof d.privacyModeTs === "number")
                    m.privacyModeTs = d.privacyModeTs;
                else if (typeof d.privacyModeTs === "object")
                    m.privacyModeTs = new $util.LongBits(d.privacyModeTs.low >>> 0, d.privacyModeTs.high >>> 0).toNumber(true);
            }
            if (d.featureControls != null) {
                if ($util.Long)
                    (m.featureControls = $util.Long.fromValue(d.featureControls)).unsigned = true;
                else if (typeof d.featureControls === "string")
                    m.featureControls = parseInt(d.featureControls, 10);
                else if (typeof d.featureControls === "number")
                    m.featureControls = d.featureControls;
                else if (typeof d.featureControls === "object")
                    m.featureControls = new $util.LongBits(d.featureControls.low >>> 0, d.featureControls.high >>> 0).toNumber(true);
            }
            return m;
        };

        BizIdentityInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.vlevel != null && m.hasOwnProperty("vlevel")) {
                d.vlevel = o.enums === String ? $root.proto.BizIdentityInfo.VerifiedLevelValue[m.vlevel] === undefined ? m.vlevel : $root.proto.BizIdentityInfo.VerifiedLevelValue[m.vlevel] : m.vlevel;
                if (o.oneofs)
                    d._vlevel = "vlevel";
            }
            if (m.vnameCert != null && m.hasOwnProperty("vnameCert")) {
                d.vnameCert = $root.proto.VerifiedNameCertificate.toObject(m.vnameCert, o);
                if (o.oneofs)
                    d._vnameCert = "vnameCert";
            }
            if (m.signed != null && m.hasOwnProperty("signed")) {
                d.signed = m.signed;
                if (o.oneofs)
                    d._signed = "signed";
            }
            if (m.revoked != null && m.hasOwnProperty("revoked")) {
                d.revoked = m.revoked;
                if (o.oneofs)
                    d._revoked = "revoked";
            }
            if (m.hostStorage != null && m.hasOwnProperty("hostStorage")) {
                d.hostStorage = o.enums === String ? $root.proto.BizIdentityInfo.HostStorageType[m.hostStorage] === undefined ? m.hostStorage : $root.proto.BizIdentityInfo.HostStorageType[m.hostStorage] : m.hostStorage;
                if (o.oneofs)
                    d._hostStorage = "hostStorage";
            }
            if (m.actualActors != null && m.hasOwnProperty("actualActors")) {
                d.actualActors = o.enums === String ? $root.proto.BizIdentityInfo.ActualActorsType[m.actualActors] === undefined ? m.actualActors : $root.proto.BizIdentityInfo.ActualActorsType[m.actualActors] : m.actualActors;
                if (o.oneofs)
                    d._actualActors = "actualActors";
            }
            if (m.privacyModeTs != null && m.hasOwnProperty("privacyModeTs")) {
                if (typeof m.privacyModeTs === "number")
                    d.privacyModeTs = o.longs === String ? String(m.privacyModeTs) : m.privacyModeTs;
                else
                    d.privacyModeTs = o.longs === String ? longToString(m.privacyModeTs, true) : o.longs === Number ? longToNumber(m.privacyModeTs, true) : m.privacyModeTs;
                if (o.oneofs)
                    d._privacyModeTs = "privacyModeTs";
            }
            if (m.featureControls != null && m.hasOwnProperty("featureControls")) {
                if (typeof m.featureControls === "number")
                    d.featureControls = o.longs === String ? String(m.featureControls) : m.featureControls;
                else
                    d.featureControls = o.longs === String ? longToString(m.featureControls, true) : o.longs === Number ? longToNumber(m.featureControls, true) : m.featureControls;
                if (o.oneofs)
                    d._featureControls = "featureControls";
            }
            return d;
        };

        BizIdentityInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BizIdentityInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BizIdentityInfo";
        };

        BizIdentityInfo.ActualActorsType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "SELF"] = 0;
            values[valuesById[1] = "BSP"] = 1;
            return values;
        })();

        BizIdentityInfo.HostStorageType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "ON_PREMISE"] = 0;
            values[valuesById[1] = "FACEBOOK"] = 1;
            return values;
        })();

        BizIdentityInfo.VerifiedLevelValue = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "LOW"] = 1;
            values[valuesById[2] = "HIGH"] = 2;
            return values;
        })();

        return BizIdentityInfo;
    })();

    proto.BotAgeCollectionMetadata = (function() {

        function BotAgeCollectionMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotAgeCollectionMetadata.prototype.ageCollectionEligible = null;
        BotAgeCollectionMetadata.prototype.shouldTriggerAgeCollectionOnClient = null;
        BotAgeCollectionMetadata.prototype.ageCollectionType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotAgeCollectionMetadata.prototype, "_ageCollectionEligible", {
            get: $util.oneOfGetter($oneOfFields = ["ageCollectionEligible"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotAgeCollectionMetadata.prototype, "_shouldTriggerAgeCollectionOnClient", {
            get: $util.oneOfGetter($oneOfFields = ["shouldTriggerAgeCollectionOnClient"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotAgeCollectionMetadata.prototype, "_ageCollectionType", {
            get: $util.oneOfGetter($oneOfFields = ["ageCollectionType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotAgeCollectionMetadata.create = function create(properties) {
            return new BotAgeCollectionMetadata(properties);
        };

        BotAgeCollectionMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.ageCollectionEligible != null && Object.hasOwnProperty.call(m, "ageCollectionEligible"))
                w.uint32(8).bool(m.ageCollectionEligible);
            if (m.shouldTriggerAgeCollectionOnClient != null && Object.hasOwnProperty.call(m, "shouldTriggerAgeCollectionOnClient"))
                w.uint32(16).bool(m.shouldTriggerAgeCollectionOnClient);
            if (m.ageCollectionType != null && Object.hasOwnProperty.call(m, "ageCollectionType"))
                w.uint32(24).int32(m.ageCollectionType);
            return w;
        };

        BotAgeCollectionMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotAgeCollectionMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.ageCollectionEligible = r.bool();
                        break;
                    }
                case 2: {
                        m.shouldTriggerAgeCollectionOnClient = r.bool();
                        break;
                    }
                case 3: {
                        m.ageCollectionType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotAgeCollectionMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotAgeCollectionMetadata)
                return d;
            var m = new $root.proto.BotAgeCollectionMetadata();
            if (d.ageCollectionEligible != null) {
                m.ageCollectionEligible = Boolean(d.ageCollectionEligible);
            }
            if (d.shouldTriggerAgeCollectionOnClient != null) {
                m.shouldTriggerAgeCollectionOnClient = Boolean(d.shouldTriggerAgeCollectionOnClient);
            }
            switch (d.ageCollectionType) {
            default:
                if (typeof d.ageCollectionType === "number") {
                    m.ageCollectionType = d.ageCollectionType;
                    break;
                }
                break;
            case "O18_BINARY":
            case 0:
                m.ageCollectionType = 0;
                break;
            case "WAFFLE":
            case 1:
                m.ageCollectionType = 1;
                break;
            }
            return m;
        };

        BotAgeCollectionMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.ageCollectionEligible != null && m.hasOwnProperty("ageCollectionEligible")) {
                d.ageCollectionEligible = m.ageCollectionEligible;
                if (o.oneofs)
                    d._ageCollectionEligible = "ageCollectionEligible";
            }
            if (m.shouldTriggerAgeCollectionOnClient != null && m.hasOwnProperty("shouldTriggerAgeCollectionOnClient")) {
                d.shouldTriggerAgeCollectionOnClient = m.shouldTriggerAgeCollectionOnClient;
                if (o.oneofs)
                    d._shouldTriggerAgeCollectionOnClient = "shouldTriggerAgeCollectionOnClient";
            }
            if (m.ageCollectionType != null && m.hasOwnProperty("ageCollectionType")) {
                d.ageCollectionType = o.enums === String ? $root.proto.BotAgeCollectionMetadata.AgeCollectionType[m.ageCollectionType] === undefined ? m.ageCollectionType : $root.proto.BotAgeCollectionMetadata.AgeCollectionType[m.ageCollectionType] : m.ageCollectionType;
                if (o.oneofs)
                    d._ageCollectionType = "ageCollectionType";
            }
            return d;
        };

        BotAgeCollectionMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotAgeCollectionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotAgeCollectionMetadata";
        };

        BotAgeCollectionMetadata.AgeCollectionType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "O18_BINARY"] = 0;
            values[valuesById[1] = "WAFFLE"] = 1;
            return values;
        })();

        return BotAgeCollectionMetadata;
    })();

    proto.BotAvatarMetadata = (function() {

        function BotAvatarMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotAvatarMetadata.prototype.sentiment = null;
        BotAvatarMetadata.prototype.behaviorGraph = null;
        BotAvatarMetadata.prototype.action = null;
        BotAvatarMetadata.prototype.intensity = null;
        BotAvatarMetadata.prototype.wordCount = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotAvatarMetadata.prototype, "_sentiment", {
            get: $util.oneOfGetter($oneOfFields = ["sentiment"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotAvatarMetadata.prototype, "_behaviorGraph", {
            get: $util.oneOfGetter($oneOfFields = ["behaviorGraph"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotAvatarMetadata.prototype, "_action", {
            get: $util.oneOfGetter($oneOfFields = ["action"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotAvatarMetadata.prototype, "_intensity", {
            get: $util.oneOfGetter($oneOfFields = ["intensity"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotAvatarMetadata.prototype, "_wordCount", {
            get: $util.oneOfGetter($oneOfFields = ["wordCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotAvatarMetadata.create = function create(properties) {
            return new BotAvatarMetadata(properties);
        };

        BotAvatarMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.sentiment != null && Object.hasOwnProperty.call(m, "sentiment"))
                w.uint32(8).uint32(m.sentiment);
            if (m.behaviorGraph != null && Object.hasOwnProperty.call(m, "behaviorGraph"))
                w.uint32(18).string(m.behaviorGraph);
            if (m.action != null && Object.hasOwnProperty.call(m, "action"))
                w.uint32(24).uint32(m.action);
            if (m.intensity != null && Object.hasOwnProperty.call(m, "intensity"))
                w.uint32(32).uint32(m.intensity);
            if (m.wordCount != null && Object.hasOwnProperty.call(m, "wordCount"))
                w.uint32(40).uint32(m.wordCount);
            return w;
        };

        BotAvatarMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotAvatarMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.sentiment = r.uint32();
                        break;
                    }
                case 2: {
                        m.behaviorGraph = r.string();
                        break;
                    }
                case 3: {
                        m.action = r.uint32();
                        break;
                    }
                case 4: {
                        m.intensity = r.uint32();
                        break;
                    }
                case 5: {
                        m.wordCount = r.uint32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotAvatarMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotAvatarMetadata)
                return d;
            var m = new $root.proto.BotAvatarMetadata();
            if (d.sentiment != null) {
                m.sentiment = d.sentiment >>> 0;
            }
            if (d.behaviorGraph != null) {
                m.behaviorGraph = String(d.behaviorGraph);
            }
            if (d.action != null) {
                m.action = d.action >>> 0;
            }
            if (d.intensity != null) {
                m.intensity = d.intensity >>> 0;
            }
            if (d.wordCount != null) {
                m.wordCount = d.wordCount >>> 0;
            }
            return m;
        };

        BotAvatarMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.sentiment != null && m.hasOwnProperty("sentiment")) {
                d.sentiment = m.sentiment;
                if (o.oneofs)
                    d._sentiment = "sentiment";
            }
            if (m.behaviorGraph != null && m.hasOwnProperty("behaviorGraph")) {
                d.behaviorGraph = m.behaviorGraph;
                if (o.oneofs)
                    d._behaviorGraph = "behaviorGraph";
            }
            if (m.action != null && m.hasOwnProperty("action")) {
                d.action = m.action;
                if (o.oneofs)
                    d._action = "action";
            }
            if (m.intensity != null && m.hasOwnProperty("intensity")) {
                d.intensity = m.intensity;
                if (o.oneofs)
                    d._intensity = "intensity";
            }
            if (m.wordCount != null && m.hasOwnProperty("wordCount")) {
                d.wordCount = m.wordCount;
                if (o.oneofs)
                    d._wordCount = "wordCount";
            }
            return d;
        };

        BotAvatarMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotAvatarMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotAvatarMetadata";
        };

        return BotAvatarMetadata;
    })();

    proto.BotCapabilityMetadata = (function() {

        function BotCapabilityMetadata(p) {
            this.capabilities = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotCapabilityMetadata.prototype.capabilities = $util.emptyArray;

        BotCapabilityMetadata.create = function create(properties) {
            return new BotCapabilityMetadata(properties);
        };

        BotCapabilityMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.capabilities != null && m.capabilities.length) {
                w.uint32(10).fork();
                for (var i = 0; i < m.capabilities.length; ++i)
                    w.int32(m.capabilities[i]);
                w.ldelim();
            }
            return w;
        };

        BotCapabilityMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotCapabilityMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.capabilities && m.capabilities.length))
                            m.capabilities = [];
                        if ((t & 7) === 2) {
                            var c2 = r.uint32() + r.pos;
                            while (r.pos < c2)
                                m.capabilities.push(r.int32());
                        } else
                            m.capabilities.push(r.int32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotCapabilityMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotCapabilityMetadata)
                return d;
            var m = new $root.proto.BotCapabilityMetadata();
            if (d.capabilities) {
                if (!Array.isArray(d.capabilities))
                    throw TypeError(".proto.BotCapabilityMetadata.capabilities: array expected");
                m.capabilities = [];
                for (var i = 0; i < d.capabilities.length; ++i) {
                    switch (d.capabilities[i]) {
                    default:
                        if (typeof d.capabilities[i] === "number") {
                            m.capabilities[i] = d.capabilities[i];
                            break;
                        }
                    case "UNKNOWN":
                    case 0:
                        m.capabilities[i] = 0;
                        break;
                    case "PROGRESS_INDICATOR":
                    case 1:
                        m.capabilities[i] = 1;
                        break;
                    case "RICH_RESPONSE_HEADING":
                    case 2:
                        m.capabilities[i] = 2;
                        break;
                    case "RICH_RESPONSE_NESTED_LIST":
                    case 3:
                        m.capabilities[i] = 3;
                        break;
                    case "AI_MEMORY":
                    case 4:
                        m.capabilities[i] = 4;
                        break;
                    case "RICH_RESPONSE_THREAD_SURFING":
                    case 5:
                        m.capabilities[i] = 5;
                        break;
                    case "RICH_RESPONSE_TABLE":
                    case 6:
                        m.capabilities[i] = 6;
                        break;
                    case "RICH_RESPONSE_CODE":
                    case 7:
                        m.capabilities[i] = 7;
                        break;
                    case "RICH_RESPONSE_STRUCTURED_RESPONSE":
                    case 8:
                        m.capabilities[i] = 8;
                        break;
                    case "RICH_RESPONSE_INLINE_IMAGE":
                    case 9:
                        m.capabilities[i] = 9;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_CONTROL":
                    case 10:
                        m.capabilities[i] = 10;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_1":
                    case 11:
                        m.capabilities[i] = 11;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_2":
                    case 12:
                        m.capabilities[i] = 12;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_3":
                    case 13:
                        m.capabilities[i] = 13;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_4":
                    case 14:
                        m.capabilities[i] = 14;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_5":
                    case 15:
                        m.capabilities[i] = 15;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_6":
                    case 16:
                        m.capabilities[i] = 16;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_7":
                    case 17:
                        m.capabilities[i] = 17;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_8":
                    case 18:
                        m.capabilities[i] = 18;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_9":
                    case 19:
                        m.capabilities[i] = 19;
                        break;
                    case "WA_IG_1P_PLUGIN_RANKING_UPDATE_10":
                    case 20:
                        m.capabilities[i] = 20;
                        break;
                    case "RICH_RESPONSE_SUB_HEADING":
                    case 21:
                        m.capabilities[i] = 21;
                        break;
                    case "RICH_RESPONSE_GRID_IMAGE":
                    case 22:
                        m.capabilities[i] = 22;
                        break;
                    case "AI_STUDIO_UGC_MEMORY":
                    case 23:
                        m.capabilities[i] = 23;
                        break;
                    case "RICH_RESPONSE_LATEX":
                    case 24:
                        m.capabilities[i] = 24;
                        break;
                    case "RICH_RESPONSE_MAPS":
                    case 25:
                        m.capabilities[i] = 25;
                        break;
                    case "RICH_RESPONSE_INLINE_REELS":
                    case 26:
                        m.capabilities[i] = 26;
                        break;
                    case "AGENTIC_PLANNING":
                    case 27:
                        m.capabilities[i] = 27;
                        break;
                    case "ACCOUNT_LINKING":
                    case 28:
                        m.capabilities[i] = 28;
                        break;
                    case "STREAMING_DISAGGREGATION":
                    case 29:
                        m.capabilities[i] = 29;
                        break;
                    case "RICH_RESPONSE_GRID_IMAGE_3P":
                    case 30:
                        m.capabilities[i] = 30;
                        break;
                    case "RICH_RESPONSE_LATEX_INLINE":
                    case 31:
                        m.capabilities[i] = 31;
                        break;
                    case "QUERY_PLAN":
                    case 32:
                        m.capabilities[i] = 32;
                        break;
                    case "PROACTIVE_MESSAGE":
                    case 33:
                        m.capabilities[i] = 33;
                        break;
                    case "RICH_RESPONSE_UNIFIED_RESPONSE":
                    case 34:
                        m.capabilities[i] = 34;
                        break;
                    case "PROMOTION_MESSAGE":
                    case 35:
                        m.capabilities[i] = 35;
                        break;
                    case "SIMPLIFIED_PROFILE_PAGE":
                    case 36:
                        m.capabilities[i] = 36;
                        break;
                    case "RICH_RESPONSE_SOURCES_IN_MESSAGE":
                    case 37:
                        m.capabilities[i] = 37;
                        break;
                    case "RICH_RESPONSE_SIDE_BY_SIDE_SURVEY":
                    case 38:
                        m.capabilities[i] = 38;
                        break;
                    case "RICH_RESPONSE_UNIFIED_TEXT_COMPONENT":
                    case 39:
                        m.capabilities[i] = 39;
                        break;
                    case "AI_SHARED_MEMORY":
                    case 40:
                        m.capabilities[i] = 40;
                        break;
                    case "RICH_RESPONSE_UNIFIED_SOURCES":
                    case 41:
                        m.capabilities[i] = 41;
                        break;
                    case "RICH_RESPONSE_UNIFIED_DOMAIN_CITATIONS":
                    case 42:
                        m.capabilities[i] = 42;
                        break;
                    case "RICH_RESPONSE_UR_INLINE_REELS_ENABLED":
                    case 43:
                        m.capabilities[i] = 43;
                        break;
                    case "RICH_RESPONSE_UR_MEDIA_GRID_ENABLED":
                    case 44:
                        m.capabilities[i] = 44;
                        break;
                    case "RICH_RESPONSE_UR_TIMESTAMP_PLACEHOLDER":
                    case 45:
                        m.capabilities[i] = 45;
                        break;
                    case "RICH_RESPONSE_IN_APP_SURVEY":
                    case 46:
                        m.capabilities[i] = 46;
                        break;
                    case "AI_RESPONSE_MODEL_BRANDING":
                    case 47:
                        m.capabilities[i] = 47;
                        break;
                    case "SESSION_TRANSPARENCY_SYSTEM_MESSAGE":
                    case 48:
                        m.capabilities[i] = 48;
                        break;
                    case "RICH_RESPONSE_UR_REASONING":
                    case 49:
                        m.capabilities[i] = 49;
                        break;
                    }
                }
            }
            return m;
        };

        BotCapabilityMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.capabilities = [];
            }
            if (m.capabilities && m.capabilities.length) {
                d.capabilities = [];
                for (var j = 0; j < m.capabilities.length; ++j) {
                    d.capabilities[j] = o.enums === String ? $root.proto.BotCapabilityMetadata.BotCapabilityType[m.capabilities[j]] === undefined ? m.capabilities[j] : $root.proto.BotCapabilityMetadata.BotCapabilityType[m.capabilities[j]] : m.capabilities[j];
                }
            }
            return d;
        };

        BotCapabilityMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotCapabilityMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotCapabilityMetadata";
        };

        BotCapabilityMetadata.BotCapabilityType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "PROGRESS_INDICATOR"] = 1;
            values[valuesById[2] = "RICH_RESPONSE_HEADING"] = 2;
            values[valuesById[3] = "RICH_RESPONSE_NESTED_LIST"] = 3;
            values[valuesById[4] = "AI_MEMORY"] = 4;
            values[valuesById[5] = "RICH_RESPONSE_THREAD_SURFING"] = 5;
            values[valuesById[6] = "RICH_RESPONSE_TABLE"] = 6;
            values[valuesById[7] = "RICH_RESPONSE_CODE"] = 7;
            values[valuesById[8] = "RICH_RESPONSE_STRUCTURED_RESPONSE"] = 8;
            values[valuesById[9] = "RICH_RESPONSE_INLINE_IMAGE"] = 9;
            values[valuesById[10] = "WA_IG_1P_PLUGIN_RANKING_CONTROL"] = 10;
            values[valuesById[11] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_1"] = 11;
            values[valuesById[12] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_2"] = 12;
            values[valuesById[13] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_3"] = 13;
            values[valuesById[14] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_4"] = 14;
            values[valuesById[15] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_5"] = 15;
            values[valuesById[16] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_6"] = 16;
            values[valuesById[17] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_7"] = 17;
            values[valuesById[18] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_8"] = 18;
            values[valuesById[19] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_9"] = 19;
            values[valuesById[20] = "WA_IG_1P_PLUGIN_RANKING_UPDATE_10"] = 20;
            values[valuesById[21] = "RICH_RESPONSE_SUB_HEADING"] = 21;
            values[valuesById[22] = "RICH_RESPONSE_GRID_IMAGE"] = 22;
            values[valuesById[23] = "AI_STUDIO_UGC_MEMORY"] = 23;
            values[valuesById[24] = "RICH_RESPONSE_LATEX"] = 24;
            values[valuesById[25] = "RICH_RESPONSE_MAPS"] = 25;
            values[valuesById[26] = "RICH_RESPONSE_INLINE_REELS"] = 26;
            values[valuesById[27] = "AGENTIC_PLANNING"] = 27;
            values[valuesById[28] = "ACCOUNT_LINKING"] = 28;
            values[valuesById[29] = "STREAMING_DISAGGREGATION"] = 29;
            values[valuesById[30] = "RICH_RESPONSE_GRID_IMAGE_3P"] = 30;
            values[valuesById[31] = "RICH_RESPONSE_LATEX_INLINE"] = 31;
            values[valuesById[32] = "QUERY_PLAN"] = 32;
            values[valuesById[33] = "PROACTIVE_MESSAGE"] = 33;
            values[valuesById[34] = "RICH_RESPONSE_UNIFIED_RESPONSE"] = 34;
            values[valuesById[35] = "PROMOTION_MESSAGE"] = 35;
            values[valuesById[36] = "SIMPLIFIED_PROFILE_PAGE"] = 36;
            values[valuesById[37] = "RICH_RESPONSE_SOURCES_IN_MESSAGE"] = 37;
            values[valuesById[38] = "RICH_RESPONSE_SIDE_BY_SIDE_SURVEY"] = 38;
            values[valuesById[39] = "RICH_RESPONSE_UNIFIED_TEXT_COMPONENT"] = 39;
            values[valuesById[40] = "AI_SHARED_MEMORY"] = 40;
            values[valuesById[41] = "RICH_RESPONSE_UNIFIED_SOURCES"] = 41;
            values[valuesById[42] = "RICH_RESPONSE_UNIFIED_DOMAIN_CITATIONS"] = 42;
            values[valuesById[43] = "RICH_RESPONSE_UR_INLINE_REELS_ENABLED"] = 43;
            values[valuesById[44] = "RICH_RESPONSE_UR_MEDIA_GRID_ENABLED"] = 44;
            values[valuesById[45] = "RICH_RESPONSE_UR_TIMESTAMP_PLACEHOLDER"] = 45;
            values[valuesById[46] = "RICH_RESPONSE_IN_APP_SURVEY"] = 46;
            values[valuesById[47] = "AI_RESPONSE_MODEL_BRANDING"] = 47;
            values[valuesById[48] = "SESSION_TRANSPARENCY_SYSTEM_MESSAGE"] = 48;
            values[valuesById[49] = "RICH_RESPONSE_UR_REASONING"] = 49;
            return values;
        })();

        return BotCapabilityMetadata;
    })();

    proto.BotFeedbackMessage = (function() {

        function BotFeedbackMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotFeedbackMessage.prototype.messageKey = null;
        BotFeedbackMessage.prototype.kind = null;
        BotFeedbackMessage.prototype.text = null;
        BotFeedbackMessage.prototype.kindNegative = null;
        BotFeedbackMessage.prototype.kindPositive = null;
        BotFeedbackMessage.prototype.kindReport = null;
        BotFeedbackMessage.prototype.sideBySideSurveyMetadata = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotFeedbackMessage.prototype, "_messageKey", {
            get: $util.oneOfGetter($oneOfFields = ["messageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotFeedbackMessage.prototype, "_kind", {
            get: $util.oneOfGetter($oneOfFields = ["kind"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotFeedbackMessage.prototype, "_text", {
            get: $util.oneOfGetter($oneOfFields = ["text"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotFeedbackMessage.prototype, "_kindNegative", {
            get: $util.oneOfGetter($oneOfFields = ["kindNegative"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotFeedbackMessage.prototype, "_kindPositive", {
            get: $util.oneOfGetter($oneOfFields = ["kindPositive"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotFeedbackMessage.prototype, "_kindReport", {
            get: $util.oneOfGetter($oneOfFields = ["kindReport"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotFeedbackMessage.prototype, "_sideBySideSurveyMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["sideBySideSurveyMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotFeedbackMessage.create = function create(properties) {
            return new BotFeedbackMessage(properties);
        };

        BotFeedbackMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.messageKey != null && Object.hasOwnProperty.call(m, "messageKey"))
                $root.proto.MessageKey.encode(m.messageKey, w.uint32(10).fork()).ldelim();
            if (m.kind != null && Object.hasOwnProperty.call(m, "kind"))
                w.uint32(16).int32(m.kind);
            if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                w.uint32(26).string(m.text);
            if (m.kindNegative != null && Object.hasOwnProperty.call(m, "kindNegative"))
                w.uint32(32).uint64(m.kindNegative);
            if (m.kindPositive != null && Object.hasOwnProperty.call(m, "kindPositive"))
                w.uint32(40).uint64(m.kindPositive);
            if (m.kindReport != null && Object.hasOwnProperty.call(m, "kindReport"))
                w.uint32(48).int32(m.kindReport);
            if (m.sideBySideSurveyMetadata != null && Object.hasOwnProperty.call(m, "sideBySideSurveyMetadata"))
                $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.encode(m.sideBySideSurveyMetadata, w.uint32(58).fork()).ldelim();
            return w;
        };

        BotFeedbackMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.messageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.kind = r.int32();
                        break;
                    }
                case 3: {
                        m.text = r.string();
                        break;
                    }
                case 4: {
                        m.kindNegative = r.uint64();
                        break;
                    }
                case 5: {
                        m.kindPositive = r.uint64();
                        break;
                    }
                case 6: {
                        m.kindReport = r.int32();
                        break;
                    }
                case 7: {
                        m.sideBySideSurveyMetadata = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotFeedbackMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotFeedbackMessage)
                return d;
            var m = new $root.proto.BotFeedbackMessage();
            if (d.messageKey != null) {
                if (typeof d.messageKey !== "object")
                    throw TypeError(".proto.BotFeedbackMessage.messageKey: object expected");
                m.messageKey = $root.proto.MessageKey.fromObject(d.messageKey);
            }
            switch (d.kind) {
            default:
                if (typeof d.kind === "number") {
                    m.kind = d.kind;
                    break;
                }
                break;
            case "BOT_FEEDBACK_POSITIVE":
            case 0:
                m.kind = 0;
                break;
            case "BOT_FEEDBACK_NEGATIVE_GENERIC":
            case 1:
                m.kind = 1;
                break;
            case "BOT_FEEDBACK_NEGATIVE_HELPFUL":
            case 2:
                m.kind = 2;
                break;
            case "BOT_FEEDBACK_NEGATIVE_INTERESTING":
            case 3:
                m.kind = 3;
                break;
            case "BOT_FEEDBACK_NEGATIVE_ACCURATE":
            case 4:
                m.kind = 4;
                break;
            case "BOT_FEEDBACK_NEGATIVE_SAFE":
            case 5:
                m.kind = 5;
                break;
            case "BOT_FEEDBACK_NEGATIVE_OTHER":
            case 6:
                m.kind = 6;
                break;
            case "BOT_FEEDBACK_NEGATIVE_REFUSED":
            case 7:
                m.kind = 7;
                break;
            case "BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING":
            case 8:
                m.kind = 8;
                break;
            case "BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT":
            case 9:
                m.kind = 9;
                break;
            case "BOT_FEEDBACK_NEGATIVE_PERSONALIZED":
            case 10:
                m.kind = 10;
                break;
            case "BOT_FEEDBACK_NEGATIVE_CLARITY":
            case 11:
                m.kind = 11;
                break;
            case "BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON":
            case 12:
                m.kind = 12;
                break;
            case "BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY":
            case 13:
                m.kind = 13;
                break;
            case "BOT_FEEDBACK_NEGATIVE":
            case 14:
                m.kind = 14;
                break;
            }
            if (d.text != null) {
                m.text = String(d.text);
            }
            if (d.kindNegative != null) {
                if ($util.Long)
                    (m.kindNegative = $util.Long.fromValue(d.kindNegative)).unsigned = true;
                else if (typeof d.kindNegative === "string")
                    m.kindNegative = parseInt(d.kindNegative, 10);
                else if (typeof d.kindNegative === "number")
                    m.kindNegative = d.kindNegative;
                else if (typeof d.kindNegative === "object")
                    m.kindNegative = new $util.LongBits(d.kindNegative.low >>> 0, d.kindNegative.high >>> 0).toNumber(true);
            }
            if (d.kindPositive != null) {
                if ($util.Long)
                    (m.kindPositive = $util.Long.fromValue(d.kindPositive)).unsigned = true;
                else if (typeof d.kindPositive === "string")
                    m.kindPositive = parseInt(d.kindPositive, 10);
                else if (typeof d.kindPositive === "number")
                    m.kindPositive = d.kindPositive;
                else if (typeof d.kindPositive === "object")
                    m.kindPositive = new $util.LongBits(d.kindPositive.low >>> 0, d.kindPositive.high >>> 0).toNumber(true);
            }
            switch (d.kindReport) {
            default:
                if (typeof d.kindReport === "number") {
                    m.kindReport = d.kindReport;
                    break;
                }
                break;
            case "NONE":
            case 0:
                m.kindReport = 0;
                break;
            case "GENERIC":
            case 1:
                m.kindReport = 1;
                break;
            }
            if (d.sideBySideSurveyMetadata != null) {
                if (typeof d.sideBySideSurveyMetadata !== "object")
                    throw TypeError(".proto.BotFeedbackMessage.sideBySideSurveyMetadata: object expected");
                m.sideBySideSurveyMetadata = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.fromObject(d.sideBySideSurveyMetadata);
            }
            return m;
        };

        BotFeedbackMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.messageKey != null && m.hasOwnProperty("messageKey")) {
                d.messageKey = $root.proto.MessageKey.toObject(m.messageKey, o);
                if (o.oneofs)
                    d._messageKey = "messageKey";
            }
            if (m.kind != null && m.hasOwnProperty("kind")) {
                d.kind = o.enums === String ? $root.proto.BotFeedbackMessage.BotFeedbackKind[m.kind] === undefined ? m.kind : $root.proto.BotFeedbackMessage.BotFeedbackKind[m.kind] : m.kind;
                if (o.oneofs)
                    d._kind = "kind";
            }
            if (m.text != null && m.hasOwnProperty("text")) {
                d.text = m.text;
                if (o.oneofs)
                    d._text = "text";
            }
            if (m.kindNegative != null && m.hasOwnProperty("kindNegative")) {
                if (typeof m.kindNegative === "number")
                    d.kindNegative = o.longs === String ? String(m.kindNegative) : m.kindNegative;
                else
                    d.kindNegative = o.longs === String ? longToString(m.kindNegative, true) : o.longs === Number ? longToNumber(m.kindNegative, true) : m.kindNegative;
                if (o.oneofs)
                    d._kindNegative = "kindNegative";
            }
            if (m.kindPositive != null && m.hasOwnProperty("kindPositive")) {
                if (typeof m.kindPositive === "number")
                    d.kindPositive = o.longs === String ? String(m.kindPositive) : m.kindPositive;
                else
                    d.kindPositive = o.longs === String ? longToString(m.kindPositive, true) : o.longs === Number ? longToNumber(m.kindPositive, true) : m.kindPositive;
                if (o.oneofs)
                    d._kindPositive = "kindPositive";
            }
            if (m.kindReport != null && m.hasOwnProperty("kindReport")) {
                d.kindReport = o.enums === String ? $root.proto.BotFeedbackMessage.ReportKind[m.kindReport] === undefined ? m.kindReport : $root.proto.BotFeedbackMessage.ReportKind[m.kindReport] : m.kindReport;
                if (o.oneofs)
                    d._kindReport = "kindReport";
            }
            if (m.sideBySideSurveyMetadata != null && m.hasOwnProperty("sideBySideSurveyMetadata")) {
                d.sideBySideSurveyMetadata = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.toObject(m.sideBySideSurveyMetadata, o);
                if (o.oneofs)
                    d._sideBySideSurveyMetadata = "sideBySideSurveyMetadata";
            }
            return d;
        };

        BotFeedbackMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotFeedbackMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotFeedbackMessage";
        };

        BotFeedbackMessage.BotFeedbackKind = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "BOT_FEEDBACK_POSITIVE"] = 0;
            values[valuesById[1] = "BOT_FEEDBACK_NEGATIVE_GENERIC"] = 1;
            values[valuesById[2] = "BOT_FEEDBACK_NEGATIVE_HELPFUL"] = 2;
            values[valuesById[3] = "BOT_FEEDBACK_NEGATIVE_INTERESTING"] = 3;
            values[valuesById[4] = "BOT_FEEDBACK_NEGATIVE_ACCURATE"] = 4;
            values[valuesById[5] = "BOT_FEEDBACK_NEGATIVE_SAFE"] = 5;
            values[valuesById[6] = "BOT_FEEDBACK_NEGATIVE_OTHER"] = 6;
            values[valuesById[7] = "BOT_FEEDBACK_NEGATIVE_REFUSED"] = 7;
            values[valuesById[8] = "BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING"] = 8;
            values[valuesById[9] = "BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT"] = 9;
            values[valuesById[10] = "BOT_FEEDBACK_NEGATIVE_PERSONALIZED"] = 10;
            values[valuesById[11] = "BOT_FEEDBACK_NEGATIVE_CLARITY"] = 11;
            values[valuesById[12] = "BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON"] = 12;
            values[valuesById[13] = "BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY"] = 13;
            values[valuesById[14] = "BOT_FEEDBACK_NEGATIVE"] = 14;
            return values;
        })();

        BotFeedbackMessage.BotFeedbackKindMultipleNegative = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[1] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_GENERIC"] = 1;
            values[valuesById[2] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_HELPFUL"] = 2;
            values[valuesById[4] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_INTERESTING"] = 4;
            values[valuesById[8] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_ACCURATE"] = 8;
            values[valuesById[16] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_SAFE"] = 16;
            values[valuesById[32] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_OTHER"] = 32;
            values[valuesById[64] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_REFUSED"] = 64;
            values[valuesById[128] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_VISUALLY_APPEALING"] = 128;
            values[valuesById[256] = "BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_RELEVANT_TO_TEXT"] = 256;
            return values;
        })();

        BotFeedbackMessage.BotFeedbackKindMultiplePositive = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[1] = "BOT_FEEDBACK_MULTIPLE_POSITIVE_GENERIC"] = 1;
            return values;
        })();

        BotFeedbackMessage.ReportKind = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "NONE"] = 0;
            values[valuesById[1] = "GENERIC"] = 1;
            return values;
        })();

        BotFeedbackMessage.SideBySideSurveyMetadata = (function() {

            function SideBySideSurveyMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SideBySideSurveyMetadata.prototype.selectedRequestId = null;
            SideBySideSurveyMetadata.prototype.surveyId = null;
            SideBySideSurveyMetadata.prototype.simonSessionFbid = null;
            SideBySideSurveyMetadata.prototype.responseOtid = null;
            SideBySideSurveyMetadata.prototype.responseTimestampMsString = null;
            SideBySideSurveyMetadata.prototype.isSelectedResponsePrimary = null;
            SideBySideSurveyMetadata.prototype.messageIdToEdit = null;
            SideBySideSurveyMetadata.prototype.analyticsData = null;
            SideBySideSurveyMetadata.prototype.metaAiAnalyticsData = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_selectedRequestId", {
                get: $util.oneOfGetter($oneOfFields = ["selectedRequestId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_surveyId", {
                get: $util.oneOfGetter($oneOfFields = ["surveyId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_simonSessionFbid", {
                get: $util.oneOfGetter($oneOfFields = ["simonSessionFbid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_responseOtid", {
                get: $util.oneOfGetter($oneOfFields = ["responseOtid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_responseTimestampMsString", {
                get: $util.oneOfGetter($oneOfFields = ["responseTimestampMsString"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_isSelectedResponsePrimary", {
                get: $util.oneOfGetter($oneOfFields = ["isSelectedResponsePrimary"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_messageIdToEdit", {
                get: $util.oneOfGetter($oneOfFields = ["messageIdToEdit"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_analyticsData", {
                get: $util.oneOfGetter($oneOfFields = ["analyticsData"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideSurveyMetadata.prototype, "_metaAiAnalyticsData", {
                get: $util.oneOfGetter($oneOfFields = ["metaAiAnalyticsData"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SideBySideSurveyMetadata.create = function create(properties) {
                return new SideBySideSurveyMetadata(properties);
            };

            SideBySideSurveyMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.selectedRequestId != null && Object.hasOwnProperty.call(m, "selectedRequestId"))
                    w.uint32(10).string(m.selectedRequestId);
                if (m.surveyId != null && Object.hasOwnProperty.call(m, "surveyId"))
                    w.uint32(16).uint32(m.surveyId);
                if (m.simonSessionFbid != null && Object.hasOwnProperty.call(m, "simonSessionFbid"))
                    w.uint32(26).string(m.simonSessionFbid);
                if (m.responseOtid != null && Object.hasOwnProperty.call(m, "responseOtid"))
                    w.uint32(34).string(m.responseOtid);
                if (m.responseTimestampMsString != null && Object.hasOwnProperty.call(m, "responseTimestampMsString"))
                    w.uint32(42).string(m.responseTimestampMsString);
                if (m.isSelectedResponsePrimary != null && Object.hasOwnProperty.call(m, "isSelectedResponsePrimary"))
                    w.uint32(48).bool(m.isSelectedResponsePrimary);
                if (m.messageIdToEdit != null && Object.hasOwnProperty.call(m, "messageIdToEdit"))
                    w.uint32(58).string(m.messageIdToEdit);
                if (m.analyticsData != null && Object.hasOwnProperty.call(m, "analyticsData"))
                    $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.encode(m.analyticsData, w.uint32(66).fork()).ldelim();
                if (m.metaAiAnalyticsData != null && Object.hasOwnProperty.call(m, "metaAiAnalyticsData"))
                    $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.encode(m.metaAiAnalyticsData, w.uint32(74).fork()).ldelim();
                return w;
            };

            SideBySideSurveyMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.selectedRequestId = r.string();
                            break;
                        }
                    case 2: {
                            m.surveyId = r.uint32();
                            break;
                        }
                    case 3: {
                            m.simonSessionFbid = r.string();
                            break;
                        }
                    case 4: {
                            m.responseOtid = r.string();
                            break;
                        }
                    case 5: {
                            m.responseTimestampMsString = r.string();
                            break;
                        }
                    case 6: {
                            m.isSelectedResponsePrimary = r.bool();
                            break;
                        }
                    case 7: {
                            m.messageIdToEdit = r.string();
                            break;
                        }
                    case 8: {
                            m.analyticsData = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.decode(r, r.uint32());
                            break;
                        }
                    case 9: {
                            m.metaAiAnalyticsData = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SideBySideSurveyMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata)
                    return d;
                var m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata();
                if (d.selectedRequestId != null) {
                    m.selectedRequestId = String(d.selectedRequestId);
                }
                if (d.surveyId != null) {
                    m.surveyId = d.surveyId >>> 0;
                }
                if (d.simonSessionFbid != null) {
                    m.simonSessionFbid = String(d.simonSessionFbid);
                }
                if (d.responseOtid != null) {
                    m.responseOtid = String(d.responseOtid);
                }
                if (d.responseTimestampMsString != null) {
                    m.responseTimestampMsString = String(d.responseTimestampMsString);
                }
                if (d.isSelectedResponsePrimary != null) {
                    m.isSelectedResponsePrimary = Boolean(d.isSelectedResponsePrimary);
                }
                if (d.messageIdToEdit != null) {
                    m.messageIdToEdit = String(d.messageIdToEdit);
                }
                if (d.analyticsData != null) {
                    if (typeof d.analyticsData !== "object")
                        throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.analyticsData: object expected");
                    m.analyticsData = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.fromObject(d.analyticsData);
                }
                if (d.metaAiAnalyticsData != null) {
                    if (typeof d.metaAiAnalyticsData !== "object")
                        throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.metaAiAnalyticsData: object expected");
                    m.metaAiAnalyticsData = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.fromObject(d.metaAiAnalyticsData);
                }
                return m;
            };

            SideBySideSurveyMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.selectedRequestId != null && m.hasOwnProperty("selectedRequestId")) {
                    d.selectedRequestId = m.selectedRequestId;
                    if (o.oneofs)
                        d._selectedRequestId = "selectedRequestId";
                }
                if (m.surveyId != null && m.hasOwnProperty("surveyId")) {
                    d.surveyId = m.surveyId;
                    if (o.oneofs)
                        d._surveyId = "surveyId";
                }
                if (m.simonSessionFbid != null && m.hasOwnProperty("simonSessionFbid")) {
                    d.simonSessionFbid = m.simonSessionFbid;
                    if (o.oneofs)
                        d._simonSessionFbid = "simonSessionFbid";
                }
                if (m.responseOtid != null && m.hasOwnProperty("responseOtid")) {
                    d.responseOtid = m.responseOtid;
                    if (o.oneofs)
                        d._responseOtid = "responseOtid";
                }
                if (m.responseTimestampMsString != null && m.hasOwnProperty("responseTimestampMsString")) {
                    d.responseTimestampMsString = m.responseTimestampMsString;
                    if (o.oneofs)
                        d._responseTimestampMsString = "responseTimestampMsString";
                }
                if (m.isSelectedResponsePrimary != null && m.hasOwnProperty("isSelectedResponsePrimary")) {
                    d.isSelectedResponsePrimary = m.isSelectedResponsePrimary;
                    if (o.oneofs)
                        d._isSelectedResponsePrimary = "isSelectedResponsePrimary";
                }
                if (m.messageIdToEdit != null && m.hasOwnProperty("messageIdToEdit")) {
                    d.messageIdToEdit = m.messageIdToEdit;
                    if (o.oneofs)
                        d._messageIdToEdit = "messageIdToEdit";
                }
                if (m.analyticsData != null && m.hasOwnProperty("analyticsData")) {
                    d.analyticsData = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.toObject(m.analyticsData, o);
                    if (o.oneofs)
                        d._analyticsData = "analyticsData";
                }
                if (m.metaAiAnalyticsData != null && m.hasOwnProperty("metaAiAnalyticsData")) {
                    d.metaAiAnalyticsData = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.toObject(m.metaAiAnalyticsData, o);
                    if (o.oneofs)
                        d._metaAiAnalyticsData = "metaAiAnalyticsData";
                }
                return d;
            };

            SideBySideSurveyMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SideBySideSurveyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.BotFeedbackMessage.SideBySideSurveyMetadata";
            };

            SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData = (function() {

                function SideBySideSurveyAnalyticsData(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                SideBySideSurveyAnalyticsData.prototype.tessaEvent = null;
                SideBySideSurveyAnalyticsData.prototype.tessaSessionFbid = null;
                SideBySideSurveyAnalyticsData.prototype.simonSessionFbid = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SideBySideSurveyAnalyticsData.prototype, "_tessaEvent", {
                    get: $util.oneOfGetter($oneOfFields = ["tessaEvent"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SideBySideSurveyAnalyticsData.prototype, "_tessaSessionFbid", {
                    get: $util.oneOfGetter($oneOfFields = ["tessaSessionFbid"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SideBySideSurveyAnalyticsData.prototype, "_simonSessionFbid", {
                    get: $util.oneOfGetter($oneOfFields = ["simonSessionFbid"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                SideBySideSurveyAnalyticsData.create = function create(properties) {
                    return new SideBySideSurveyAnalyticsData(properties);
                };

                SideBySideSurveyAnalyticsData.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.tessaEvent != null && Object.hasOwnProperty.call(m, "tessaEvent"))
                        w.uint32(10).string(m.tessaEvent);
                    if (m.tessaSessionFbid != null && Object.hasOwnProperty.call(m, "tessaSessionFbid"))
                        w.uint32(18).string(m.tessaSessionFbid);
                    if (m.simonSessionFbid != null && Object.hasOwnProperty.call(m, "simonSessionFbid"))
                        w.uint32(26).string(m.simonSessionFbid);
                    return w;
                };

                SideBySideSurveyAnalyticsData.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.tessaEvent = r.string();
                                break;
                            }
                        case 2: {
                                m.tessaSessionFbid = r.string();
                                break;
                            }
                        case 3: {
                                m.simonSessionFbid = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                SideBySideSurveyAnalyticsData.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData)
                        return d;
                    var m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData();
                    if (d.tessaEvent != null) {
                        m.tessaEvent = String(d.tessaEvent);
                    }
                    if (d.tessaSessionFbid != null) {
                        m.tessaSessionFbid = String(d.tessaSessionFbid);
                    }
                    if (d.simonSessionFbid != null) {
                        m.simonSessionFbid = String(d.simonSessionFbid);
                    }
                    return m;
                };

                SideBySideSurveyAnalyticsData.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.tessaEvent != null && m.hasOwnProperty("tessaEvent")) {
                        d.tessaEvent = m.tessaEvent;
                        if (o.oneofs)
                            d._tessaEvent = "tessaEvent";
                    }
                    if (m.tessaSessionFbid != null && m.hasOwnProperty("tessaSessionFbid")) {
                        d.tessaSessionFbid = m.tessaSessionFbid;
                        if (o.oneofs)
                            d._tessaSessionFbid = "tessaSessionFbid";
                    }
                    if (m.simonSessionFbid != null && m.hasOwnProperty("simonSessionFbid")) {
                        d.simonSessionFbid = m.simonSessionFbid;
                        if (o.oneofs)
                            d._simonSessionFbid = "simonSessionFbid";
                    }
                    return d;
                };

                SideBySideSurveyAnalyticsData.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                SideBySideSurveyAnalyticsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData";
                };

                return SideBySideSurveyAnalyticsData;
            })();

            SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData = (function() {

                function SidebySideSurveyMetaAiAnalyticsData(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                SidebySideSurveyMetaAiAnalyticsData.prototype.surveyId = null;
                SidebySideSurveyMetaAiAnalyticsData.prototype.primaryResponseId = null;
                SidebySideSurveyMetaAiAnalyticsData.prototype.testArmName = null;
                SidebySideSurveyMetaAiAnalyticsData.prototype.timestampMsString = null;
                SidebySideSurveyMetaAiAnalyticsData.prototype.ctaImpressionEvent = null;
                SidebySideSurveyMetaAiAnalyticsData.prototype.ctaClickEvent = null;
                SidebySideSurveyMetaAiAnalyticsData.prototype.cardImpressionEvent = null;
                SidebySideSurveyMetaAiAnalyticsData.prototype.responseEvent = null;
                SidebySideSurveyMetaAiAnalyticsData.prototype.abandonEvent = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_surveyId", {
                    get: $util.oneOfGetter($oneOfFields = ["surveyId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_primaryResponseId", {
                    get: $util.oneOfGetter($oneOfFields = ["primaryResponseId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_testArmName", {
                    get: $util.oneOfGetter($oneOfFields = ["testArmName"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_timestampMsString", {
                    get: $util.oneOfGetter($oneOfFields = ["timestampMsString"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_ctaImpressionEvent", {
                    get: $util.oneOfGetter($oneOfFields = ["ctaImpressionEvent"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_ctaClickEvent", {
                    get: $util.oneOfGetter($oneOfFields = ["ctaClickEvent"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_cardImpressionEvent", {
                    get: $util.oneOfGetter($oneOfFields = ["cardImpressionEvent"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_responseEvent", {
                    get: $util.oneOfGetter($oneOfFields = ["responseEvent"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SidebySideSurveyMetaAiAnalyticsData.prototype, "_abandonEvent", {
                    get: $util.oneOfGetter($oneOfFields = ["abandonEvent"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                SidebySideSurveyMetaAiAnalyticsData.create = function create(properties) {
                    return new SidebySideSurveyMetaAiAnalyticsData(properties);
                };

                SidebySideSurveyMetaAiAnalyticsData.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.surveyId != null && Object.hasOwnProperty.call(m, "surveyId"))
                        w.uint32(8).uint32(m.surveyId);
                    if (m.primaryResponseId != null && Object.hasOwnProperty.call(m, "primaryResponseId"))
                        w.uint32(18).string(m.primaryResponseId);
                    if (m.testArmName != null && Object.hasOwnProperty.call(m, "testArmName"))
                        w.uint32(26).string(m.testArmName);
                    if (m.timestampMsString != null && Object.hasOwnProperty.call(m, "timestampMsString"))
                        w.uint32(34).string(m.timestampMsString);
                    if (m.ctaImpressionEvent != null && Object.hasOwnProperty.call(m, "ctaImpressionEvent"))
                        $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.encode(m.ctaImpressionEvent, w.uint32(42).fork()).ldelim();
                    if (m.ctaClickEvent != null && Object.hasOwnProperty.call(m, "ctaClickEvent"))
                        $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.encode(m.ctaClickEvent, w.uint32(50).fork()).ldelim();
                    if (m.cardImpressionEvent != null && Object.hasOwnProperty.call(m, "cardImpressionEvent"))
                        $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.encode(m.cardImpressionEvent, w.uint32(58).fork()).ldelim();
                    if (m.responseEvent != null && Object.hasOwnProperty.call(m, "responseEvent"))
                        $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.encode(m.responseEvent, w.uint32(66).fork()).ldelim();
                    if (m.abandonEvent != null && Object.hasOwnProperty.call(m, "abandonEvent"))
                        $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.encode(m.abandonEvent, w.uint32(74).fork()).ldelim();
                    return w;
                };

                SidebySideSurveyMetaAiAnalyticsData.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.surveyId = r.uint32();
                                break;
                            }
                        case 2: {
                                m.primaryResponseId = r.string();
                                break;
                            }
                        case 3: {
                                m.testArmName = r.string();
                                break;
                            }
                        case 4: {
                                m.timestampMsString = r.string();
                                break;
                            }
                        case 5: {
                                m.ctaImpressionEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.decode(r, r.uint32());
                                break;
                            }
                        case 6: {
                                m.ctaClickEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.decode(r, r.uint32());
                                break;
                            }
                        case 7: {
                                m.cardImpressionEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.decode(r, r.uint32());
                                break;
                            }
                        case 8: {
                                m.responseEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.decode(r, r.uint32());
                                break;
                            }
                        case 9: {
                                m.abandonEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                SidebySideSurveyMetaAiAnalyticsData.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData)
                        return d;
                    var m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData();
                    if (d.surveyId != null) {
                        m.surveyId = d.surveyId >>> 0;
                    }
                    if (d.primaryResponseId != null) {
                        m.primaryResponseId = String(d.primaryResponseId);
                    }
                    if (d.testArmName != null) {
                        m.testArmName = String(d.testArmName);
                    }
                    if (d.timestampMsString != null) {
                        m.timestampMsString = String(d.timestampMsString);
                    }
                    if (d.ctaImpressionEvent != null) {
                        if (typeof d.ctaImpressionEvent !== "object")
                            throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaImpressionEvent: object expected");
                        m.ctaImpressionEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.fromObject(d.ctaImpressionEvent);
                    }
                    if (d.ctaClickEvent != null) {
                        if (typeof d.ctaClickEvent !== "object")
                            throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaClickEvent: object expected");
                        m.ctaClickEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.fromObject(d.ctaClickEvent);
                    }
                    if (d.cardImpressionEvent != null) {
                        if (typeof d.cardImpressionEvent !== "object")
                            throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.cardImpressionEvent: object expected");
                        m.cardImpressionEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.fromObject(d.cardImpressionEvent);
                    }
                    if (d.responseEvent != null) {
                        if (typeof d.responseEvent !== "object")
                            throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.responseEvent: object expected");
                        m.responseEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.fromObject(d.responseEvent);
                    }
                    if (d.abandonEvent != null) {
                        if (typeof d.abandonEvent !== "object")
                            throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.abandonEvent: object expected");
                        m.abandonEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.fromObject(d.abandonEvent);
                    }
                    return m;
                };

                SidebySideSurveyMetaAiAnalyticsData.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.surveyId != null && m.hasOwnProperty("surveyId")) {
                        d.surveyId = m.surveyId;
                        if (o.oneofs)
                            d._surveyId = "surveyId";
                    }
                    if (m.primaryResponseId != null && m.hasOwnProperty("primaryResponseId")) {
                        d.primaryResponseId = m.primaryResponseId;
                        if (o.oneofs)
                            d._primaryResponseId = "primaryResponseId";
                    }
                    if (m.testArmName != null && m.hasOwnProperty("testArmName")) {
                        d.testArmName = m.testArmName;
                        if (o.oneofs)
                            d._testArmName = "testArmName";
                    }
                    if (m.timestampMsString != null && m.hasOwnProperty("timestampMsString")) {
                        d.timestampMsString = m.timestampMsString;
                        if (o.oneofs)
                            d._timestampMsString = "timestampMsString";
                    }
                    if (m.ctaImpressionEvent != null && m.hasOwnProperty("ctaImpressionEvent")) {
                        d.ctaImpressionEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.toObject(m.ctaImpressionEvent, o);
                        if (o.oneofs)
                            d._ctaImpressionEvent = "ctaImpressionEvent";
                    }
                    if (m.ctaClickEvent != null && m.hasOwnProperty("ctaClickEvent")) {
                        d.ctaClickEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.toObject(m.ctaClickEvent, o);
                        if (o.oneofs)
                            d._ctaClickEvent = "ctaClickEvent";
                    }
                    if (m.cardImpressionEvent != null && m.hasOwnProperty("cardImpressionEvent")) {
                        d.cardImpressionEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.toObject(m.cardImpressionEvent, o);
                        if (o.oneofs)
                            d._cardImpressionEvent = "cardImpressionEvent";
                    }
                    if (m.responseEvent != null && m.hasOwnProperty("responseEvent")) {
                        d.responseEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.toObject(m.responseEvent, o);
                        if (o.oneofs)
                            d._responseEvent = "responseEvent";
                    }
                    if (m.abandonEvent != null && m.hasOwnProperty("abandonEvent")) {
                        d.abandonEvent = $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.toObject(m.abandonEvent, o);
                        if (o.oneofs)
                            d._abandonEvent = "abandonEvent";
                    }
                    return d;
                };

                SidebySideSurveyMetaAiAnalyticsData.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                SidebySideSurveyMetaAiAnalyticsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData";
                };

                SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData = (function() {

                    function SideBySideSurveyAbandonEventData(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    SideBySideSurveyAbandonEventData.prototype.abandonDwellTimeMsString = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(SideBySideSurveyAbandonEventData.prototype, "_abandonDwellTimeMsString", {
                        get: $util.oneOfGetter($oneOfFields = ["abandonDwellTimeMsString"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    SideBySideSurveyAbandonEventData.create = function create(properties) {
                        return new SideBySideSurveyAbandonEventData(properties);
                    };

                    SideBySideSurveyAbandonEventData.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.abandonDwellTimeMsString != null && Object.hasOwnProperty.call(m, "abandonDwellTimeMsString"))
                            w.uint32(10).string(m.abandonDwellTimeMsString);
                        return w;
                    };

                    SideBySideSurveyAbandonEventData.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.abandonDwellTimeMsString = r.string();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    SideBySideSurveyAbandonEventData.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData)
                            return d;
                        var m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData();
                        if (d.abandonDwellTimeMsString != null) {
                            m.abandonDwellTimeMsString = String(d.abandonDwellTimeMsString);
                        }
                        return m;
                    };

                    SideBySideSurveyAbandonEventData.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.abandonDwellTimeMsString != null && m.hasOwnProperty("abandonDwellTimeMsString")) {
                            d.abandonDwellTimeMsString = m.abandonDwellTimeMsString;
                            if (o.oneofs)
                                d._abandonDwellTimeMsString = "abandonDwellTimeMsString";
                        }
                        return d;
                    };

                    SideBySideSurveyAbandonEventData.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    SideBySideSurveyAbandonEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData";
                    };

                    return SideBySideSurveyAbandonEventData;
                })();

                SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData = (function() {

                    function SideBySideSurveyCTAClickEventData(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    SideBySideSurveyCTAClickEventData.prototype.isSurveyExpired = null;
                    SideBySideSurveyCTAClickEventData.prototype.clickDwellTimeMsString = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(SideBySideSurveyCTAClickEventData.prototype, "_isSurveyExpired", {
                        get: $util.oneOfGetter($oneOfFields = ["isSurveyExpired"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(SideBySideSurveyCTAClickEventData.prototype, "_clickDwellTimeMsString", {
                        get: $util.oneOfGetter($oneOfFields = ["clickDwellTimeMsString"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    SideBySideSurveyCTAClickEventData.create = function create(properties) {
                        return new SideBySideSurveyCTAClickEventData(properties);
                    };

                    SideBySideSurveyCTAClickEventData.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.isSurveyExpired != null && Object.hasOwnProperty.call(m, "isSurveyExpired"))
                            w.uint32(8).bool(m.isSurveyExpired);
                        if (m.clickDwellTimeMsString != null && Object.hasOwnProperty.call(m, "clickDwellTimeMsString"))
                            w.uint32(18).string(m.clickDwellTimeMsString);
                        return w;
                    };

                    SideBySideSurveyCTAClickEventData.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.isSurveyExpired = r.bool();
                                    break;
                                }
                            case 2: {
                                    m.clickDwellTimeMsString = r.string();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    SideBySideSurveyCTAClickEventData.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData)
                            return d;
                        var m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData();
                        if (d.isSurveyExpired != null) {
                            m.isSurveyExpired = Boolean(d.isSurveyExpired);
                        }
                        if (d.clickDwellTimeMsString != null) {
                            m.clickDwellTimeMsString = String(d.clickDwellTimeMsString);
                        }
                        return m;
                    };

                    SideBySideSurveyCTAClickEventData.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.isSurveyExpired != null && m.hasOwnProperty("isSurveyExpired")) {
                            d.isSurveyExpired = m.isSurveyExpired;
                            if (o.oneofs)
                                d._isSurveyExpired = "isSurveyExpired";
                        }
                        if (m.clickDwellTimeMsString != null && m.hasOwnProperty("clickDwellTimeMsString")) {
                            d.clickDwellTimeMsString = m.clickDwellTimeMsString;
                            if (o.oneofs)
                                d._clickDwellTimeMsString = "clickDwellTimeMsString";
                        }
                        return d;
                    };

                    SideBySideSurveyCTAClickEventData.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    SideBySideSurveyCTAClickEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData";
                    };

                    return SideBySideSurveyCTAClickEventData;
                })();

                SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData = (function() {

                    function SideBySideSurveyCTAImpressionEventData(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    SideBySideSurveyCTAImpressionEventData.prototype.isSurveyExpired = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(SideBySideSurveyCTAImpressionEventData.prototype, "_isSurveyExpired", {
                        get: $util.oneOfGetter($oneOfFields = ["isSurveyExpired"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    SideBySideSurveyCTAImpressionEventData.create = function create(properties) {
                        return new SideBySideSurveyCTAImpressionEventData(properties);
                    };

                    SideBySideSurveyCTAImpressionEventData.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.isSurveyExpired != null && Object.hasOwnProperty.call(m, "isSurveyExpired"))
                            w.uint32(8).bool(m.isSurveyExpired);
                        return w;
                    };

                    SideBySideSurveyCTAImpressionEventData.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.isSurveyExpired = r.bool();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    SideBySideSurveyCTAImpressionEventData.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData)
                            return d;
                        var m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData();
                        if (d.isSurveyExpired != null) {
                            m.isSurveyExpired = Boolean(d.isSurveyExpired);
                        }
                        return m;
                    };

                    SideBySideSurveyCTAImpressionEventData.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.isSurveyExpired != null && m.hasOwnProperty("isSurveyExpired")) {
                            d.isSurveyExpired = m.isSurveyExpired;
                            if (o.oneofs)
                                d._isSurveyExpired = "isSurveyExpired";
                        }
                        return d;
                    };

                    SideBySideSurveyCTAImpressionEventData.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    SideBySideSurveyCTAImpressionEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData";
                    };

                    return SideBySideSurveyCTAImpressionEventData;
                })();

                SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData = (function() {

                    function SideBySideSurveyCardImpressionEventData(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    SideBySideSurveyCardImpressionEventData.create = function create(properties) {
                        return new SideBySideSurveyCardImpressionEventData(properties);
                    };

                    SideBySideSurveyCardImpressionEventData.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        return w;
                    };

                    SideBySideSurveyCardImpressionEventData.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    SideBySideSurveyCardImpressionEventData.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData)
                            return d;
                        return new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData();
                    };

                    SideBySideSurveyCardImpressionEventData.toObject = function toObject() {
                        return {};
                    };

                    SideBySideSurveyCardImpressionEventData.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    SideBySideSurveyCardImpressionEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData";
                    };

                    return SideBySideSurveyCardImpressionEventData;
                })();

                SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData = (function() {

                    function SideBySideSurveyResponseEventData(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    SideBySideSurveyResponseEventData.prototype.responseDwellTimeMsString = null;
                    SideBySideSurveyResponseEventData.prototype.selectedResponseId = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(SideBySideSurveyResponseEventData.prototype, "_responseDwellTimeMsString", {
                        get: $util.oneOfGetter($oneOfFields = ["responseDwellTimeMsString"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(SideBySideSurveyResponseEventData.prototype, "_selectedResponseId", {
                        get: $util.oneOfGetter($oneOfFields = ["selectedResponseId"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    SideBySideSurveyResponseEventData.create = function create(properties) {
                        return new SideBySideSurveyResponseEventData(properties);
                    };

                    SideBySideSurveyResponseEventData.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.responseDwellTimeMsString != null && Object.hasOwnProperty.call(m, "responseDwellTimeMsString"))
                            w.uint32(10).string(m.responseDwellTimeMsString);
                        if (m.selectedResponseId != null && Object.hasOwnProperty.call(m, "selectedResponseId"))
                            w.uint32(18).string(m.selectedResponseId);
                        return w;
                    };

                    SideBySideSurveyResponseEventData.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.responseDwellTimeMsString = r.string();
                                    break;
                                }
                            case 2: {
                                    m.selectedResponseId = r.string();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    SideBySideSurveyResponseEventData.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData)
                            return d;
                        var m = new $root.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData();
                        if (d.responseDwellTimeMsString != null) {
                            m.responseDwellTimeMsString = String(d.responseDwellTimeMsString);
                        }
                        if (d.selectedResponseId != null) {
                            m.selectedResponseId = String(d.selectedResponseId);
                        }
                        return m;
                    };

                    SideBySideSurveyResponseEventData.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.responseDwellTimeMsString != null && m.hasOwnProperty("responseDwellTimeMsString")) {
                            d.responseDwellTimeMsString = m.responseDwellTimeMsString;
                            if (o.oneofs)
                                d._responseDwellTimeMsString = "responseDwellTimeMsString";
                        }
                        if (m.selectedResponseId != null && m.hasOwnProperty("selectedResponseId")) {
                            d.selectedResponseId = m.selectedResponseId;
                            if (o.oneofs)
                                d._selectedResponseId = "selectedResponseId";
                        }
                        return d;
                    };

                    SideBySideSurveyResponseEventData.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    SideBySideSurveyResponseEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData";
                    };

                    return SideBySideSurveyResponseEventData;
                })();

                return SidebySideSurveyMetaAiAnalyticsData;
            })();

            return SideBySideSurveyMetadata;
        })();

        return BotFeedbackMessage;
    })();

    proto.BotImagineMetadata = (function() {

        function BotImagineMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotImagineMetadata.prototype.imagineType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotImagineMetadata.prototype, "_imagineType", {
            get: $util.oneOfGetter($oneOfFields = ["imagineType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotImagineMetadata.create = function create(properties) {
            return new BotImagineMetadata(properties);
        };

        BotImagineMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.imagineType != null && Object.hasOwnProperty.call(m, "imagineType"))
                w.uint32(8).int32(m.imagineType);
            return w;
        };

        BotImagineMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotImagineMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.imagineType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotImagineMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotImagineMetadata)
                return d;
            var m = new $root.proto.BotImagineMetadata();
            switch (d.imagineType) {
            default:
                if (typeof d.imagineType === "number") {
                    m.imagineType = d.imagineType;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.imagineType = 0;
                break;
            case "IMAGINE":
            case 1:
                m.imagineType = 1;
                break;
            case "MEMU":
            case 2:
                m.imagineType = 2;
                break;
            case "FLASH":
            case 3:
                m.imagineType = 3;
                break;
            case "EDIT":
            case 4:
                m.imagineType = 4;
                break;
            }
            return m;
        };

        BotImagineMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.imagineType != null && m.hasOwnProperty("imagineType")) {
                d.imagineType = o.enums === String ? $root.proto.BotImagineMetadata.ImagineType[m.imagineType] === undefined ? m.imagineType : $root.proto.BotImagineMetadata.ImagineType[m.imagineType] : m.imagineType;
                if (o.oneofs)
                    d._imagineType = "imagineType";
            }
            return d;
        };

        BotImagineMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotImagineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotImagineMetadata";
        };

        BotImagineMetadata.ImagineType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "IMAGINE"] = 1;
            values[valuesById[2] = "MEMU"] = 2;
            values[valuesById[3] = "FLASH"] = 3;
            values[valuesById[4] = "EDIT"] = 4;
            return values;
        })();

        return BotImagineMetadata;
    })();

    proto.BotLinkedAccount = (function() {

        function BotLinkedAccount(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotLinkedAccount.prototype.type = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotLinkedAccount.prototype, "_type", {
            get: $util.oneOfGetter($oneOfFields = ["type"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotLinkedAccount.create = function create(properties) {
            return new BotLinkedAccount(properties);
        };

        BotLinkedAccount.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                w.uint32(8).int32(m.type);
            return w;
        };

        BotLinkedAccount.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotLinkedAccount();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.type = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotLinkedAccount.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotLinkedAccount)
                return d;
            var m = new $root.proto.BotLinkedAccount();
            switch (d.type) {
            default:
                if (typeof d.type === "number") {
                    m.type = d.type;
                    break;
                }
                break;
            case "BOT_LINKED_ACCOUNT_TYPE_1P":
            case 0:
                m.type = 0;
                break;
            }
            return m;
        };

        BotLinkedAccount.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.type != null && m.hasOwnProperty("type")) {
                d.type = o.enums === String ? $root.proto.BotLinkedAccount.BotLinkedAccountType[m.type] === undefined ? m.type : $root.proto.BotLinkedAccount.BotLinkedAccountType[m.type] : m.type;
                if (o.oneofs)
                    d._type = "type";
            }
            return d;
        };

        BotLinkedAccount.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotLinkedAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotLinkedAccount";
        };

        BotLinkedAccount.BotLinkedAccountType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "BOT_LINKED_ACCOUNT_TYPE_1P"] = 0;
            return values;
        })();

        return BotLinkedAccount;
    })();

    proto.BotLinkedAccountsMetadata = (function() {

        function BotLinkedAccountsMetadata(p) {
            this.accounts = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotLinkedAccountsMetadata.prototype.accounts = $util.emptyArray;
        BotLinkedAccountsMetadata.prototype.acAuthTokens = null;
        BotLinkedAccountsMetadata.prototype.acErrorCode = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotLinkedAccountsMetadata.prototype, "_acAuthTokens", {
            get: $util.oneOfGetter($oneOfFields = ["acAuthTokens"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotLinkedAccountsMetadata.prototype, "_acErrorCode", {
            get: $util.oneOfGetter($oneOfFields = ["acErrorCode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotLinkedAccountsMetadata.create = function create(properties) {
            return new BotLinkedAccountsMetadata(properties);
        };

        BotLinkedAccountsMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.accounts != null && m.accounts.length) {
                for (var i = 0; i < m.accounts.length; ++i)
                    $root.proto.BotLinkedAccount.encode(m.accounts[i], w.uint32(10).fork()).ldelim();
            }
            if (m.acAuthTokens != null && Object.hasOwnProperty.call(m, "acAuthTokens"))
                w.uint32(18).bytes(m.acAuthTokens);
            if (m.acErrorCode != null && Object.hasOwnProperty.call(m, "acErrorCode"))
                w.uint32(24).int32(m.acErrorCode);
            return w;
        };

        BotLinkedAccountsMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotLinkedAccountsMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.accounts && m.accounts.length))
                            m.accounts = [];
                        m.accounts.push($root.proto.BotLinkedAccount.decode(r, r.uint32()));
                        break;
                    }
                case 2: {
                        m.acAuthTokens = r.bytes();
                        break;
                    }
                case 3: {
                        m.acErrorCode = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotLinkedAccountsMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotLinkedAccountsMetadata)
                return d;
            var m = new $root.proto.BotLinkedAccountsMetadata();
            if (d.accounts) {
                if (!Array.isArray(d.accounts))
                    throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: array expected");
                m.accounts = [];
                for (var i = 0; i < d.accounts.length; ++i) {
                    if (typeof d.accounts[i] !== "object")
                        throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: object expected");
                    m.accounts[i] = $root.proto.BotLinkedAccount.fromObject(d.accounts[i]);
                }
            }
            if (d.acAuthTokens != null) {
                if (typeof d.acAuthTokens === "string")
                    $util.base64.decode(d.acAuthTokens, m.acAuthTokens = $util.newBuffer($util.base64.length(d.acAuthTokens)), 0);
                else if (d.acAuthTokens.length >= 0)
                    m.acAuthTokens = d.acAuthTokens;
            }
            if (d.acErrorCode != null) {
                m.acErrorCode = d.acErrorCode | 0;
            }
            return m;
        };

        BotLinkedAccountsMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.accounts = [];
            }
            if (m.accounts && m.accounts.length) {
                d.accounts = [];
                for (var j = 0; j < m.accounts.length; ++j) {
                    d.accounts[j] = $root.proto.BotLinkedAccount.toObject(m.accounts[j], o);
                }
            }
            if (m.acAuthTokens != null && m.hasOwnProperty("acAuthTokens")) {
                d.acAuthTokens = o.bytes === String ? $util.base64.encode(m.acAuthTokens, 0, m.acAuthTokens.length) : o.bytes === Array ? Array.prototype.slice.call(m.acAuthTokens) : m.acAuthTokens;
                if (o.oneofs)
                    d._acAuthTokens = "acAuthTokens";
            }
            if (m.acErrorCode != null && m.hasOwnProperty("acErrorCode")) {
                d.acErrorCode = m.acErrorCode;
                if (o.oneofs)
                    d._acErrorCode = "acErrorCode";
            }
            return d;
        };

        BotLinkedAccountsMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotLinkedAccountsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotLinkedAccountsMetadata";
        };

        return BotLinkedAccountsMetadata;
    })();

    proto.BotMediaMetadata = (function() {

        function BotMediaMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMediaMetadata.prototype.fileSha256 = null;
        BotMediaMetadata.prototype.mediaKey = null;
        BotMediaMetadata.prototype.fileEncSha256 = null;
        BotMediaMetadata.prototype.directPath = null;
        BotMediaMetadata.prototype.mediaKeyTimestamp = null;
        BotMediaMetadata.prototype.mimetype = null;
        BotMediaMetadata.prototype.orientationType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMediaMetadata.prototype, "_fileSha256", {
            get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMediaMetadata.prototype, "_mediaKey", {
            get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMediaMetadata.prototype, "_fileEncSha256", {
            get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMediaMetadata.prototype, "_directPath", {
            get: $util.oneOfGetter($oneOfFields = ["directPath"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMediaMetadata.prototype, "_mediaKeyTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMediaMetadata.prototype, "_mimetype", {
            get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMediaMetadata.prototype, "_orientationType", {
            get: $util.oneOfGetter($oneOfFields = ["orientationType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotMediaMetadata.create = function create(properties) {
            return new BotMediaMetadata(properties);
        };

        BotMediaMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                w.uint32(10).string(m.fileSha256);
            if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                w.uint32(18).string(m.mediaKey);
            if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                w.uint32(26).string(m.fileEncSha256);
            if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                w.uint32(34).string(m.directPath);
            if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                w.uint32(40).int64(m.mediaKeyTimestamp);
            if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                w.uint32(50).string(m.mimetype);
            if (m.orientationType != null && Object.hasOwnProperty.call(m, "orientationType"))
                w.uint32(56).int32(m.orientationType);
            return w;
        };

        BotMediaMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMediaMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.fileSha256 = r.string();
                        break;
                    }
                case 2: {
                        m.mediaKey = r.string();
                        break;
                    }
                case 3: {
                        m.fileEncSha256 = r.string();
                        break;
                    }
                case 4: {
                        m.directPath = r.string();
                        break;
                    }
                case 5: {
                        m.mediaKeyTimestamp = r.int64();
                        break;
                    }
                case 6: {
                        m.mimetype = r.string();
                        break;
                    }
                case 7: {
                        m.orientationType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMediaMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMediaMetadata)
                return d;
            var m = new $root.proto.BotMediaMetadata();
            if (d.fileSha256 != null) {
                m.fileSha256 = String(d.fileSha256);
            }
            if (d.mediaKey != null) {
                m.mediaKey = String(d.mediaKey);
            }
            if (d.fileEncSha256 != null) {
                m.fileEncSha256 = String(d.fileEncSha256);
            }
            if (d.directPath != null) {
                m.directPath = String(d.directPath);
            }
            if (d.mediaKeyTimestamp != null) {
                if ($util.Long)
                    (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                else if (typeof d.mediaKeyTimestamp === "string")
                    m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                else if (typeof d.mediaKeyTimestamp === "number")
                    m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                else if (typeof d.mediaKeyTimestamp === "object")
                    m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
            }
            if (d.mimetype != null) {
                m.mimetype = String(d.mimetype);
            }
            switch (d.orientationType) {
            default:
                if (typeof d.orientationType === "number") {
                    m.orientationType = d.orientationType;
                    break;
                }
                break;
            case "CENTER":
            case 1:
                m.orientationType = 1;
                break;
            case "LEFT":
            case 2:
                m.orientationType = 2;
                break;
            case "RIGHT":
            case 3:
                m.orientationType = 3;
                break;
            }
            return m;
        };

        BotMediaMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                d.fileSha256 = m.fileSha256;
                if (o.oneofs)
                    d._fileSha256 = "fileSha256";
            }
            if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                d.mediaKey = m.mediaKey;
                if (o.oneofs)
                    d._mediaKey = "mediaKey";
            }
            if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                d.fileEncSha256 = m.fileEncSha256;
                if (o.oneofs)
                    d._fileEncSha256 = "fileEncSha256";
            }
            if (m.directPath != null && m.hasOwnProperty("directPath")) {
                d.directPath = m.directPath;
                if (o.oneofs)
                    d._directPath = "directPath";
            }
            if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                if (typeof m.mediaKeyTimestamp === "number")
                    d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                else
                    d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                if (o.oneofs)
                    d._mediaKeyTimestamp = "mediaKeyTimestamp";
            }
            if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                d.mimetype = m.mimetype;
                if (o.oneofs)
                    d._mimetype = "mimetype";
            }
            if (m.orientationType != null && m.hasOwnProperty("orientationType")) {
                d.orientationType = o.enums === String ? $root.proto.BotMediaMetadata.OrientationType[m.orientationType] === undefined ? m.orientationType : $root.proto.BotMediaMetadata.OrientationType[m.orientationType] : m.orientationType;
                if (o.oneofs)
                    d._orientationType = "orientationType";
            }
            return d;
        };

        BotMediaMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMediaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMediaMetadata";
        };

        BotMediaMetadata.OrientationType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[1] = "CENTER"] = 1;
            values[valuesById[2] = "LEFT"] = 2;
            values[valuesById[3] = "RIGHT"] = 3;
            return values;
        })();

        return BotMediaMetadata;
    })();

    proto.BotMemoryFact = (function() {

        function BotMemoryFact(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMemoryFact.prototype.fact = null;
        BotMemoryFact.prototype.factId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMemoryFact.prototype, "_fact", {
            get: $util.oneOfGetter($oneOfFields = ["fact"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMemoryFact.prototype, "_factId", {
            get: $util.oneOfGetter($oneOfFields = ["factId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotMemoryFact.create = function create(properties) {
            return new BotMemoryFact(properties);
        };

        BotMemoryFact.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.fact != null && Object.hasOwnProperty.call(m, "fact"))
                w.uint32(10).string(m.fact);
            if (m.factId != null && Object.hasOwnProperty.call(m, "factId"))
                w.uint32(18).string(m.factId);
            return w;
        };

        BotMemoryFact.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMemoryFact();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.fact = r.string();
                        break;
                    }
                case 2: {
                        m.factId = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMemoryFact.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMemoryFact)
                return d;
            var m = new $root.proto.BotMemoryFact();
            if (d.fact != null) {
                m.fact = String(d.fact);
            }
            if (d.factId != null) {
                m.factId = String(d.factId);
            }
            return m;
        };

        BotMemoryFact.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.fact != null && m.hasOwnProperty("fact")) {
                d.fact = m.fact;
                if (o.oneofs)
                    d._fact = "fact";
            }
            if (m.factId != null && m.hasOwnProperty("factId")) {
                d.factId = m.factId;
                if (o.oneofs)
                    d._factId = "factId";
            }
            return d;
        };

        BotMemoryFact.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMemoryFact.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMemoryFact";
        };

        return BotMemoryFact;
    })();

    proto.BotMemoryMetadata = (function() {

        function BotMemoryMetadata(p) {
            this.addedFacts = [];
            this.removedFacts = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMemoryMetadata.prototype.addedFacts = $util.emptyArray;
        BotMemoryMetadata.prototype.removedFacts = $util.emptyArray;
        BotMemoryMetadata.prototype.disclaimer = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMemoryMetadata.prototype, "_disclaimer", {
            get: $util.oneOfGetter($oneOfFields = ["disclaimer"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotMemoryMetadata.create = function create(properties) {
            return new BotMemoryMetadata(properties);
        };

        BotMemoryMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.addedFacts != null && m.addedFacts.length) {
                for (var i = 0; i < m.addedFacts.length; ++i)
                    $root.proto.BotMemoryFact.encode(m.addedFacts[i], w.uint32(10).fork()).ldelim();
            }
            if (m.removedFacts != null && m.removedFacts.length) {
                for (var i = 0; i < m.removedFacts.length; ++i)
                    $root.proto.BotMemoryFact.encode(m.removedFacts[i], w.uint32(18).fork()).ldelim();
            }
            if (m.disclaimer != null && Object.hasOwnProperty.call(m, "disclaimer"))
                w.uint32(26).string(m.disclaimer);
            return w;
        };

        BotMemoryMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMemoryMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.addedFacts && m.addedFacts.length))
                            m.addedFacts = [];
                        m.addedFacts.push($root.proto.BotMemoryFact.decode(r, r.uint32()));
                        break;
                    }
                case 2: {
                        if (!(m.removedFacts && m.removedFacts.length))
                            m.removedFacts = [];
                        m.removedFacts.push($root.proto.BotMemoryFact.decode(r, r.uint32()));
                        break;
                    }
                case 3: {
                        m.disclaimer = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMemoryMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMemoryMetadata)
                return d;
            var m = new $root.proto.BotMemoryMetadata();
            if (d.addedFacts) {
                if (!Array.isArray(d.addedFacts))
                    throw TypeError(".proto.BotMemoryMetadata.addedFacts: array expected");
                m.addedFacts = [];
                for (var i = 0; i < d.addedFacts.length; ++i) {
                    if (typeof d.addedFacts[i] !== "object")
                        throw TypeError(".proto.BotMemoryMetadata.addedFacts: object expected");
                    m.addedFacts[i] = $root.proto.BotMemoryFact.fromObject(d.addedFacts[i]);
                }
            }
            if (d.removedFacts) {
                if (!Array.isArray(d.removedFacts))
                    throw TypeError(".proto.BotMemoryMetadata.removedFacts: array expected");
                m.removedFacts = [];
                for (var i = 0; i < d.removedFacts.length; ++i) {
                    if (typeof d.removedFacts[i] !== "object")
                        throw TypeError(".proto.BotMemoryMetadata.removedFacts: object expected");
                    m.removedFacts[i] = $root.proto.BotMemoryFact.fromObject(d.removedFacts[i]);
                }
            }
            if (d.disclaimer != null) {
                m.disclaimer = String(d.disclaimer);
            }
            return m;
        };

        BotMemoryMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.addedFacts = [];
                d.removedFacts = [];
            }
            if (m.addedFacts && m.addedFacts.length) {
                d.addedFacts = [];
                for (var j = 0; j < m.addedFacts.length; ++j) {
                    d.addedFacts[j] = $root.proto.BotMemoryFact.toObject(m.addedFacts[j], o);
                }
            }
            if (m.removedFacts && m.removedFacts.length) {
                d.removedFacts = [];
                for (var j = 0; j < m.removedFacts.length; ++j) {
                    d.removedFacts[j] = $root.proto.BotMemoryFact.toObject(m.removedFacts[j], o);
                }
            }
            if (m.disclaimer != null && m.hasOwnProperty("disclaimer")) {
                d.disclaimer = m.disclaimer;
                if (o.oneofs)
                    d._disclaimer = "disclaimer";
            }
            return d;
        };

        BotMemoryMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMemoryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMemoryMetadata";
        };

        return BotMemoryMetadata;
    })();

    proto.BotMemuMetadata = (function() {

        function BotMemuMetadata(p) {
            this.faceImages = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMemuMetadata.prototype.faceImages = $util.emptyArray;

        BotMemuMetadata.create = function create(properties) {
            return new BotMemuMetadata(properties);
        };

        BotMemuMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.faceImages != null && m.faceImages.length) {
                for (var i = 0; i < m.faceImages.length; ++i)
                    $root.proto.BotMediaMetadata.encode(m.faceImages[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        BotMemuMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMemuMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.faceImages && m.faceImages.length))
                            m.faceImages = [];
                        m.faceImages.push($root.proto.BotMediaMetadata.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMemuMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMemuMetadata)
                return d;
            var m = new $root.proto.BotMemuMetadata();
            if (d.faceImages) {
                if (!Array.isArray(d.faceImages))
                    throw TypeError(".proto.BotMemuMetadata.faceImages: array expected");
                m.faceImages = [];
                for (var i = 0; i < d.faceImages.length; ++i) {
                    if (typeof d.faceImages[i] !== "object")
                        throw TypeError(".proto.BotMemuMetadata.faceImages: object expected");
                    m.faceImages[i] = $root.proto.BotMediaMetadata.fromObject(d.faceImages[i]);
                }
            }
            return m;
        };

        BotMemuMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.faceImages = [];
            }
            if (m.faceImages && m.faceImages.length) {
                d.faceImages = [];
                for (var j = 0; j < m.faceImages.length; ++j) {
                    d.faceImages[j] = $root.proto.BotMediaMetadata.toObject(m.faceImages[j], o);
                }
            }
            return d;
        };

        BotMemuMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMemuMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMemuMetadata";
        };

        return BotMemuMetadata;
    })();

    proto.BotMessageOrigin = (function() {

        function BotMessageOrigin(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMessageOrigin.prototype.type = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMessageOrigin.prototype, "_type", {
            get: $util.oneOfGetter($oneOfFields = ["type"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotMessageOrigin.create = function create(properties) {
            return new BotMessageOrigin(properties);
        };

        BotMessageOrigin.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                w.uint32(8).int32(m.type);
            return w;
        };

        BotMessageOrigin.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMessageOrigin();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.type = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMessageOrigin.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMessageOrigin)
                return d;
            var m = new $root.proto.BotMessageOrigin();
            switch (d.type) {
            default:
                if (typeof d.type === "number") {
                    m.type = d.type;
                    break;
                }
                break;
            case "BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED":
            case 0:
                m.type = 0;
                break;
            }
            return m;
        };

        BotMessageOrigin.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.type != null && m.hasOwnProperty("type")) {
                d.type = o.enums === String ? $root.proto.BotMessageOrigin.BotMessageOriginType[m.type] === undefined ? m.type : $root.proto.BotMessageOrigin.BotMessageOriginType[m.type] : m.type;
                if (o.oneofs)
                    d._type = "type";
            }
            return d;
        };

        BotMessageOrigin.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMessageOrigin.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMessageOrigin";
        };

        BotMessageOrigin.BotMessageOriginType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED"] = 0;
            return values;
        })();

        return BotMessageOrigin;
    })();

    proto.BotMessageOriginMetadata = (function() {

        function BotMessageOriginMetadata(p) {
            this.origins = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMessageOriginMetadata.prototype.origins = $util.emptyArray;

        BotMessageOriginMetadata.create = function create(properties) {
            return new BotMessageOriginMetadata(properties);
        };

        BotMessageOriginMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.origins != null && m.origins.length) {
                for (var i = 0; i < m.origins.length; ++i)
                    $root.proto.BotMessageOrigin.encode(m.origins[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        BotMessageOriginMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMessageOriginMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.origins && m.origins.length))
                            m.origins = [];
                        m.origins.push($root.proto.BotMessageOrigin.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMessageOriginMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMessageOriginMetadata)
                return d;
            var m = new $root.proto.BotMessageOriginMetadata();
            if (d.origins) {
                if (!Array.isArray(d.origins))
                    throw TypeError(".proto.BotMessageOriginMetadata.origins: array expected");
                m.origins = [];
                for (var i = 0; i < d.origins.length; ++i) {
                    if (typeof d.origins[i] !== "object")
                        throw TypeError(".proto.BotMessageOriginMetadata.origins: object expected");
                    m.origins[i] = $root.proto.BotMessageOrigin.fromObject(d.origins[i]);
                }
            }
            return m;
        };

        BotMessageOriginMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.origins = [];
            }
            if (m.origins && m.origins.length) {
                d.origins = [];
                for (var j = 0; j < m.origins.length; ++j) {
                    d.origins[j] = $root.proto.BotMessageOrigin.toObject(m.origins[j], o);
                }
            }
            return d;
        };

        BotMessageOriginMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMessageOriginMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMessageOriginMetadata";
        };

        return BotMessageOriginMetadata;
    })();

    proto.BotMessageSharingInfo = (function() {

        function BotMessageSharingInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMessageSharingInfo.prototype.botEntryPointOrigin = null;
        BotMessageSharingInfo.prototype.forwardScore = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMessageSharingInfo.prototype, "_botEntryPointOrigin", {
            get: $util.oneOfGetter($oneOfFields = ["botEntryPointOrigin"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMessageSharingInfo.prototype, "_forwardScore", {
            get: $util.oneOfGetter($oneOfFields = ["forwardScore"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotMessageSharingInfo.create = function create(properties) {
            return new BotMessageSharingInfo(properties);
        };

        BotMessageSharingInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.botEntryPointOrigin != null && Object.hasOwnProperty.call(m, "botEntryPointOrigin"))
                w.uint32(8).int32(m.botEntryPointOrigin);
            if (m.forwardScore != null && Object.hasOwnProperty.call(m, "forwardScore"))
                w.uint32(16).uint32(m.forwardScore);
            return w;
        };

        BotMessageSharingInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMessageSharingInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.botEntryPointOrigin = r.int32();
                        break;
                    }
                case 2: {
                        m.forwardScore = r.uint32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMessageSharingInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMessageSharingInfo)
                return d;
            var m = new $root.proto.BotMessageSharingInfo();
            switch (d.botEntryPointOrigin) {
            default:
                if (typeof d.botEntryPointOrigin === "number") {
                    m.botEntryPointOrigin = d.botEntryPointOrigin;
                    break;
                }
                break;
            case "UNDEFINED_ENTRY_POINT":
            case 0:
                m.botEntryPointOrigin = 0;
                break;
            case "FAVICON":
            case 1:
                m.botEntryPointOrigin = 1;
                break;
            case "CHATLIST":
            case 2:
                m.botEntryPointOrigin = 2;
                break;
            case "AISEARCH_NULL_STATE_PAPER_PLANE":
            case 3:
                m.botEntryPointOrigin = 3;
                break;
            case "AISEARCH_NULL_STATE_SUGGESTION":
            case 4:
                m.botEntryPointOrigin = 4;
                break;
            case "AISEARCH_TYPE_AHEAD_SUGGESTION":
            case 5:
                m.botEntryPointOrigin = 5;
                break;
            case "AISEARCH_TYPE_AHEAD_PAPER_PLANE":
            case 6:
                m.botEntryPointOrigin = 6;
                break;
            case "AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":
            case 7:
                m.botEntryPointOrigin = 7;
                break;
            case "AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":
            case 8:
                m.botEntryPointOrigin = 8;
                break;
            case "AIVOICE_SEARCH_BAR":
            case 9:
                m.botEntryPointOrigin = 9;
                break;
            case "AIVOICE_FAVICON":
            case 10:
                m.botEntryPointOrigin = 10;
                break;
            case "AISTUDIO":
            case 11:
                m.botEntryPointOrigin = 11;
                break;
            case "DEEPLINK":
            case 12:
                m.botEntryPointOrigin = 12;
                break;
            case "NOTIFICATION":
            case 13:
                m.botEntryPointOrigin = 13;
                break;
            case "PROFILE_MESSAGE_BUTTON":
            case 14:
                m.botEntryPointOrigin = 14;
                break;
            case "FORWARD":
            case 15:
                m.botEntryPointOrigin = 15;
                break;
            case "APP_SHORTCUT":
            case 16:
                m.botEntryPointOrigin = 16;
                break;
            case "FF_FAMILY":
            case 17:
                m.botEntryPointOrigin = 17;
                break;
            case "AI_TAB":
            case 18:
                m.botEntryPointOrigin = 18;
                break;
            case "AI_HOME":
            case 19:
                m.botEntryPointOrigin = 19;
                break;
            case "AI_DEEPLINK_IMMERSIVE":
            case 20:
                m.botEntryPointOrigin = 20;
                break;
            case "AI_DEEPLINK":
            case 21:
                m.botEntryPointOrigin = 21;
                break;
            case "META_AI_CHAT_SHORTCUT_AI_STUDIO":
            case 22:
                m.botEntryPointOrigin = 22;
                break;
            case "UGC_CHAT_SHORTCUT_AI_STUDIO":
            case 23:
                m.botEntryPointOrigin = 23;
                break;
            case "NEW_CHAT_AI_STUDIO":
            case 24:
                m.botEntryPointOrigin = 24;
                break;
            case "AIVOICE_FAVICON_CALL_HISTORY":
            case 25:
                m.botEntryPointOrigin = 25;
                break;
            case "ASK_META_AI_CONTEXT_MENU":
            case 26:
                m.botEntryPointOrigin = 26;
                break;
            case "ASK_META_AI_CONTEXT_MENU_1ON1":
            case 27:
                m.botEntryPointOrigin = 27;
                break;
            case "ASK_META_AI_CONTEXT_MENU_GROUP":
            case 28:
                m.botEntryPointOrigin = 28;
                break;
            case "INVOKE_META_AI_1ON1":
            case 29:
                m.botEntryPointOrigin = 29;
                break;
            case "INVOKE_META_AI_GROUP":
            case 30:
                m.botEntryPointOrigin = 30;
                break;
            case "META_AI_FORWARD":
            case 31:
                m.botEntryPointOrigin = 31;
                break;
            case "NEW_CHAT_AI_CONTACT":
            case 32:
                m.botEntryPointOrigin = 32;
                break;
            case "MESSAGE_QUICK_ACTION_1_ON_1_CHAT":
            case 33:
                m.botEntryPointOrigin = 33;
                break;
            case "MESSAGE_QUICK_ACTION_GROUP_CHAT":
            case 34:
                m.botEntryPointOrigin = 34;
                break;
            case "ATTACHMENT_TRAY_1_ON_1_CHAT":
            case 35:
                m.botEntryPointOrigin = 35;
                break;
            case "ATTACHMENT_TRAY_GROUP_CHAT":
            case 36:
                m.botEntryPointOrigin = 36;
                break;
            case "ASK_META_AI_MEDIA_VIEWER_1ON1":
            case 37:
                m.botEntryPointOrigin = 37;
                break;
            case "ASK_META_AI_MEDIA_VIEWER_GROUP":
            case 38:
                m.botEntryPointOrigin = 38;
                break;
            }
            if (d.forwardScore != null) {
                m.forwardScore = d.forwardScore >>> 0;
            }
            return m;
        };

        BotMessageSharingInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.botEntryPointOrigin != null && m.hasOwnProperty("botEntryPointOrigin")) {
                d.botEntryPointOrigin = o.enums === String ? $root.proto.BotMetricsEntryPoint[m.botEntryPointOrigin] === undefined ? m.botEntryPointOrigin : $root.proto.BotMetricsEntryPoint[m.botEntryPointOrigin] : m.botEntryPointOrigin;
                if (o.oneofs)
                    d._botEntryPointOrigin = "botEntryPointOrigin";
            }
            if (m.forwardScore != null && m.hasOwnProperty("forwardScore")) {
                d.forwardScore = m.forwardScore;
                if (o.oneofs)
                    d._forwardScore = "forwardScore";
            }
            return d;
        };

        BotMessageSharingInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMessageSharingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMessageSharingInfo";
        };

        return BotMessageSharingInfo;
    })();

    proto.BotMetadata = (function() {

        function BotMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMetadata.prototype.avatarMetadata = null;
        BotMetadata.prototype.personaId = null;
        BotMetadata.prototype.pluginMetadata = null;
        BotMetadata.prototype.suggestedPromptMetadata = null;
        BotMetadata.prototype.invokerJid = null;
        BotMetadata.prototype.sessionMetadata = null;
        BotMetadata.prototype.memuMetadata = null;
        BotMetadata.prototype.timezone = null;
        BotMetadata.prototype.reminderMetadata = null;
        BotMetadata.prototype.modelMetadata = null;
        BotMetadata.prototype.messageDisclaimerText = null;
        BotMetadata.prototype.progressIndicatorMetadata = null;
        BotMetadata.prototype.capabilityMetadata = null;
        BotMetadata.prototype.imagineMetadata = null;
        BotMetadata.prototype.memoryMetadata = null;
        BotMetadata.prototype.renderingMetadata = null;
        BotMetadata.prototype.botMetricsMetadata = null;
        BotMetadata.prototype.botLinkedAccountsMetadata = null;
        BotMetadata.prototype.richResponseSourcesMetadata = null;
        BotMetadata.prototype.aiConversationContext = null;
        BotMetadata.prototype.botPromotionMessageMetadata = null;
        BotMetadata.prototype.botModeSelectionMetadata = null;
        BotMetadata.prototype.botQuotaMetadata = null;
        BotMetadata.prototype.botAgeCollectionMetadata = null;
        BotMetadata.prototype.conversationStarterPromptId = null;
        BotMetadata.prototype.botResponseId = null;
        BotMetadata.prototype.verificationMetadata = null;
        BotMetadata.prototype.unifiedResponseMutation = null;
        BotMetadata.prototype.botMessageOriginMetadata = null;
        BotMetadata.prototype.inThreadSurveyMetadata = null;
        BotMetadata.prototype.botThreadInfo = null;
        BotMetadata.prototype.regenerateMetadata = null;
        BotMetadata.prototype.sessionTransparencyMetadata = null;
        BotMetadata.prototype.internalMetadata = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_avatarMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["avatarMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_personaId", {
            get: $util.oneOfGetter($oneOfFields = ["personaId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_pluginMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["pluginMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_suggestedPromptMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["suggestedPromptMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_invokerJid", {
            get: $util.oneOfGetter($oneOfFields = ["invokerJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_sessionMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["sessionMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_memuMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["memuMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_timezone", {
            get: $util.oneOfGetter($oneOfFields = ["timezone"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_reminderMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["reminderMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_modelMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["modelMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_messageDisclaimerText", {
            get: $util.oneOfGetter($oneOfFields = ["messageDisclaimerText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_progressIndicatorMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["progressIndicatorMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_capabilityMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["capabilityMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_imagineMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["imagineMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_memoryMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["memoryMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_renderingMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["renderingMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botMetricsMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["botMetricsMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botLinkedAccountsMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["botLinkedAccountsMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_richResponseSourcesMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["richResponseSourcesMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_aiConversationContext", {
            get: $util.oneOfGetter($oneOfFields = ["aiConversationContext"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botPromotionMessageMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["botPromotionMessageMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botModeSelectionMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["botModeSelectionMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botQuotaMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["botQuotaMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botAgeCollectionMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["botAgeCollectionMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_conversationStarterPromptId", {
            get: $util.oneOfGetter($oneOfFields = ["conversationStarterPromptId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botResponseId", {
            get: $util.oneOfGetter($oneOfFields = ["botResponseId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_verificationMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["verificationMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_unifiedResponseMutation", {
            get: $util.oneOfGetter($oneOfFields = ["unifiedResponseMutation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botMessageOriginMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["botMessageOriginMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_inThreadSurveyMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["inThreadSurveyMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_botThreadInfo", {
            get: $util.oneOfGetter($oneOfFields = ["botThreadInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_regenerateMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["regenerateMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_sessionTransparencyMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["sessionTransparencyMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetadata.prototype, "_internalMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["internalMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotMetadata.create = function create(properties) {
            return new BotMetadata(properties);
        };

        BotMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.avatarMetadata != null && Object.hasOwnProperty.call(m, "avatarMetadata"))
                $root.proto.BotAvatarMetadata.encode(m.avatarMetadata, w.uint32(10).fork()).ldelim();
            if (m.personaId != null && Object.hasOwnProperty.call(m, "personaId"))
                w.uint32(18).string(m.personaId);
            if (m.pluginMetadata != null && Object.hasOwnProperty.call(m, "pluginMetadata"))
                $root.proto.BotPluginMetadata.encode(m.pluginMetadata, w.uint32(26).fork()).ldelim();
            if (m.suggestedPromptMetadata != null && Object.hasOwnProperty.call(m, "suggestedPromptMetadata"))
                $root.proto.BotSuggestedPromptMetadata.encode(m.suggestedPromptMetadata, w.uint32(34).fork()).ldelim();
            if (m.invokerJid != null && Object.hasOwnProperty.call(m, "invokerJid"))
                w.uint32(42).string(m.invokerJid);
            if (m.sessionMetadata != null && Object.hasOwnProperty.call(m, "sessionMetadata"))
                $root.proto.BotSessionMetadata.encode(m.sessionMetadata, w.uint32(50).fork()).ldelim();
            if (m.memuMetadata != null && Object.hasOwnProperty.call(m, "memuMetadata"))
                $root.proto.BotMemuMetadata.encode(m.memuMetadata, w.uint32(58).fork()).ldelim();
            if (m.timezone != null && Object.hasOwnProperty.call(m, "timezone"))
                w.uint32(66).string(m.timezone);
            if (m.reminderMetadata != null && Object.hasOwnProperty.call(m, "reminderMetadata"))
                $root.proto.BotReminderMetadata.encode(m.reminderMetadata, w.uint32(74).fork()).ldelim();
            if (m.modelMetadata != null && Object.hasOwnProperty.call(m, "modelMetadata"))
                $root.proto.BotModelMetadata.encode(m.modelMetadata, w.uint32(82).fork()).ldelim();
            if (m.messageDisclaimerText != null && Object.hasOwnProperty.call(m, "messageDisclaimerText"))
                w.uint32(90).string(m.messageDisclaimerText);
            if (m.progressIndicatorMetadata != null && Object.hasOwnProperty.call(m, "progressIndicatorMetadata"))
                $root.proto.BotProgressIndicatorMetadata.encode(m.progressIndicatorMetadata, w.uint32(98).fork()).ldelim();
            if (m.capabilityMetadata != null && Object.hasOwnProperty.call(m, "capabilityMetadata"))
                $root.proto.BotCapabilityMetadata.encode(m.capabilityMetadata, w.uint32(106).fork()).ldelim();
            if (m.imagineMetadata != null && Object.hasOwnProperty.call(m, "imagineMetadata"))
                $root.proto.BotImagineMetadata.encode(m.imagineMetadata, w.uint32(114).fork()).ldelim();
            if (m.memoryMetadata != null && Object.hasOwnProperty.call(m, "memoryMetadata"))
                $root.proto.BotMemoryMetadata.encode(m.memoryMetadata, w.uint32(122).fork()).ldelim();
            if (m.renderingMetadata != null && Object.hasOwnProperty.call(m, "renderingMetadata"))
                $root.proto.BotRenderingMetadata.encode(m.renderingMetadata, w.uint32(130).fork()).ldelim();
            if (m.botMetricsMetadata != null && Object.hasOwnProperty.call(m, "botMetricsMetadata"))
                $root.proto.BotMetricsMetadata.encode(m.botMetricsMetadata, w.uint32(138).fork()).ldelim();
            if (m.botLinkedAccountsMetadata != null && Object.hasOwnProperty.call(m, "botLinkedAccountsMetadata"))
                $root.proto.BotLinkedAccountsMetadata.encode(m.botLinkedAccountsMetadata, w.uint32(146).fork()).ldelim();
            if (m.richResponseSourcesMetadata != null && Object.hasOwnProperty.call(m, "richResponseSourcesMetadata"))
                $root.proto.BotSourcesMetadata.encode(m.richResponseSourcesMetadata, w.uint32(154).fork()).ldelim();
            if (m.aiConversationContext != null && Object.hasOwnProperty.call(m, "aiConversationContext"))
                w.uint32(162).bytes(m.aiConversationContext);
            if (m.botPromotionMessageMetadata != null && Object.hasOwnProperty.call(m, "botPromotionMessageMetadata"))
                $root.proto.BotPromotionMessageMetadata.encode(m.botPromotionMessageMetadata, w.uint32(170).fork()).ldelim();
            if (m.botModeSelectionMetadata != null && Object.hasOwnProperty.call(m, "botModeSelectionMetadata"))
                $root.proto.BotModeSelectionMetadata.encode(m.botModeSelectionMetadata, w.uint32(178).fork()).ldelim();
            if (m.botQuotaMetadata != null && Object.hasOwnProperty.call(m, "botQuotaMetadata"))
                $root.proto.BotQuotaMetadata.encode(m.botQuotaMetadata, w.uint32(186).fork()).ldelim();
            if (m.botAgeCollectionMetadata != null && Object.hasOwnProperty.call(m, "botAgeCollectionMetadata"))
                $root.proto.BotAgeCollectionMetadata.encode(m.botAgeCollectionMetadata, w.uint32(194).fork()).ldelim();
            if (m.conversationStarterPromptId != null && Object.hasOwnProperty.call(m, "conversationStarterPromptId"))
                w.uint32(202).string(m.conversationStarterPromptId);
            if (m.botResponseId != null && Object.hasOwnProperty.call(m, "botResponseId"))
                w.uint32(210).string(m.botResponseId);
            if (m.verificationMetadata != null && Object.hasOwnProperty.call(m, "verificationMetadata"))
                $root.proto.BotSignatureVerificationMetadata.encode(m.verificationMetadata, w.uint32(218).fork()).ldelim();
            if (m.unifiedResponseMutation != null && Object.hasOwnProperty.call(m, "unifiedResponseMutation"))
                $root.proto.BotUnifiedResponseMutation.encode(m.unifiedResponseMutation, w.uint32(226).fork()).ldelim();
            if (m.botMessageOriginMetadata != null && Object.hasOwnProperty.call(m, "botMessageOriginMetadata"))
                $root.proto.BotMessageOriginMetadata.encode(m.botMessageOriginMetadata, w.uint32(234).fork()).ldelim();
            if (m.inThreadSurveyMetadata != null && Object.hasOwnProperty.call(m, "inThreadSurveyMetadata"))
                $root.proto.InThreadSurveyMetadata.encode(m.inThreadSurveyMetadata, w.uint32(242).fork()).ldelim();
            if (m.botThreadInfo != null && Object.hasOwnProperty.call(m, "botThreadInfo"))
                $root.proto.AIThreadInfo.encode(m.botThreadInfo, w.uint32(250).fork()).ldelim();
            if (m.regenerateMetadata != null && Object.hasOwnProperty.call(m, "regenerateMetadata"))
                $root.proto.AIRegenerateMetadata.encode(m.regenerateMetadata, w.uint32(258).fork()).ldelim();
            if (m.sessionTransparencyMetadata != null && Object.hasOwnProperty.call(m, "sessionTransparencyMetadata"))
                $root.proto.SessionTransparencyMetadata.encode(m.sessionTransparencyMetadata, w.uint32(266).fork()).ldelim();
            if (m.internalMetadata != null && Object.hasOwnProperty.call(m, "internalMetadata"))
                w.uint32(7994).bytes(m.internalMetadata);
            return w;
        };

        BotMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.avatarMetadata = $root.proto.BotAvatarMetadata.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.personaId = r.string();
                        break;
                    }
                case 3: {
                        m.pluginMetadata = $root.proto.BotPluginMetadata.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.suggestedPromptMetadata = $root.proto.BotSuggestedPromptMetadata.decode(r, r.uint32());
                        break;
                    }
                case 5: {
                        m.invokerJid = r.string();
                        break;
                    }
                case 6: {
                        m.sessionMetadata = $root.proto.BotSessionMetadata.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.memuMetadata = $root.proto.BotMemuMetadata.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.timezone = r.string();
                        break;
                    }
                case 9: {
                        m.reminderMetadata = $root.proto.BotReminderMetadata.decode(r, r.uint32());
                        break;
                    }
                case 10: {
                        m.modelMetadata = $root.proto.BotModelMetadata.decode(r, r.uint32());
                        break;
                    }
                case 11: {
                        m.messageDisclaimerText = r.string();
                        break;
                    }
                case 12: {
                        m.progressIndicatorMetadata = $root.proto.BotProgressIndicatorMetadata.decode(r, r.uint32());
                        break;
                    }
                case 13: {
                        m.capabilityMetadata = $root.proto.BotCapabilityMetadata.decode(r, r.uint32());
                        break;
                    }
                case 14: {
                        m.imagineMetadata = $root.proto.BotImagineMetadata.decode(r, r.uint32());
                        break;
                    }
                case 15: {
                        m.memoryMetadata = $root.proto.BotMemoryMetadata.decode(r, r.uint32());
                        break;
                    }
                case 16: {
                        m.renderingMetadata = $root.proto.BotRenderingMetadata.decode(r, r.uint32());
                        break;
                    }
                case 17: {
                        m.botMetricsMetadata = $root.proto.BotMetricsMetadata.decode(r, r.uint32());
                        break;
                    }
                case 18: {
                        m.botLinkedAccountsMetadata = $root.proto.BotLinkedAccountsMetadata.decode(r, r.uint32());
                        break;
                    }
                case 19: {
                        m.richResponseSourcesMetadata = $root.proto.BotSourcesMetadata.decode(r, r.uint32());
                        break;
                    }
                case 20: {
                        m.aiConversationContext = r.bytes();
                        break;
                    }
                case 21: {
                        m.botPromotionMessageMetadata = $root.proto.BotPromotionMessageMetadata.decode(r, r.uint32());
                        break;
                    }
                case 22: {
                        m.botModeSelectionMetadata = $root.proto.BotModeSelectionMetadata.decode(r, r.uint32());
                        break;
                    }
                case 23: {
                        m.botQuotaMetadata = $root.proto.BotQuotaMetadata.decode(r, r.uint32());
                        break;
                    }
                case 24: {
                        m.botAgeCollectionMetadata = $root.proto.BotAgeCollectionMetadata.decode(r, r.uint32());
                        break;
                    }
                case 25: {
                        m.conversationStarterPromptId = r.string();
                        break;
                    }
                case 26: {
                        m.botResponseId = r.string();
                        break;
                    }
                case 27: {
                        m.verificationMetadata = $root.proto.BotSignatureVerificationMetadata.decode(r, r.uint32());
                        break;
                    }
                case 28: {
                        m.unifiedResponseMutation = $root.proto.BotUnifiedResponseMutation.decode(r, r.uint32());
                        break;
                    }
                case 29: {
                        m.botMessageOriginMetadata = $root.proto.BotMessageOriginMetadata.decode(r, r.uint32());
                        break;
                    }
                case 30: {
                        m.inThreadSurveyMetadata = $root.proto.InThreadSurveyMetadata.decode(r, r.uint32());
                        break;
                    }
                case 31: {
                        m.botThreadInfo = $root.proto.AIThreadInfo.decode(r, r.uint32());
                        break;
                    }
                case 32: {
                        m.regenerateMetadata = $root.proto.AIRegenerateMetadata.decode(r, r.uint32());
                        break;
                    }
                case 33: {
                        m.sessionTransparencyMetadata = $root.proto.SessionTransparencyMetadata.decode(r, r.uint32());
                        break;
                    }
                case 999: {
                        m.internalMetadata = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMetadata)
                return d;
            var m = new $root.proto.BotMetadata();
            if (d.avatarMetadata != null) {
                if (typeof d.avatarMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.avatarMetadata: object expected");
                m.avatarMetadata = $root.proto.BotAvatarMetadata.fromObject(d.avatarMetadata);
            }
            if (d.personaId != null) {
                m.personaId = String(d.personaId);
            }
            if (d.pluginMetadata != null) {
                if (typeof d.pluginMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.pluginMetadata: object expected");
                m.pluginMetadata = $root.proto.BotPluginMetadata.fromObject(d.pluginMetadata);
            }
            if (d.suggestedPromptMetadata != null) {
                if (typeof d.suggestedPromptMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.suggestedPromptMetadata: object expected");
                m.suggestedPromptMetadata = $root.proto.BotSuggestedPromptMetadata.fromObject(d.suggestedPromptMetadata);
            }
            if (d.invokerJid != null) {
                m.invokerJid = String(d.invokerJid);
            }
            if (d.sessionMetadata != null) {
                if (typeof d.sessionMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.sessionMetadata: object expected");
                m.sessionMetadata = $root.proto.BotSessionMetadata.fromObject(d.sessionMetadata);
            }
            if (d.memuMetadata != null) {
                if (typeof d.memuMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.memuMetadata: object expected");
                m.memuMetadata = $root.proto.BotMemuMetadata.fromObject(d.memuMetadata);
            }
            if (d.timezone != null) {
                m.timezone = String(d.timezone);
            }
            if (d.reminderMetadata != null) {
                if (typeof d.reminderMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.reminderMetadata: object expected");
                m.reminderMetadata = $root.proto.BotReminderMetadata.fromObject(d.reminderMetadata);
            }
            if (d.modelMetadata != null) {
                if (typeof d.modelMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.modelMetadata: object expected");
                m.modelMetadata = $root.proto.BotModelMetadata.fromObject(d.modelMetadata);
            }
            if (d.messageDisclaimerText != null) {
                m.messageDisclaimerText = String(d.messageDisclaimerText);
            }
            if (d.progressIndicatorMetadata != null) {
                if (typeof d.progressIndicatorMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.progressIndicatorMetadata: object expected");
                m.progressIndicatorMetadata = $root.proto.BotProgressIndicatorMetadata.fromObject(d.progressIndicatorMetadata);
            }
            if (d.capabilityMetadata != null) {
                if (typeof d.capabilityMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.capabilityMetadata: object expected");
                m.capabilityMetadata = $root.proto.BotCapabilityMetadata.fromObject(d.capabilityMetadata);
            }
            if (d.imagineMetadata != null) {
                if (typeof d.imagineMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.imagineMetadata: object expected");
                m.imagineMetadata = $root.proto.BotImagineMetadata.fromObject(d.imagineMetadata);
            }
            if (d.memoryMetadata != null) {
                if (typeof d.memoryMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.memoryMetadata: object expected");
                m.memoryMetadata = $root.proto.BotMemoryMetadata.fromObject(d.memoryMetadata);
            }
            if (d.renderingMetadata != null) {
                if (typeof d.renderingMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.renderingMetadata: object expected");
                m.renderingMetadata = $root.proto.BotRenderingMetadata.fromObject(d.renderingMetadata);
            }
            if (d.botMetricsMetadata != null) {
                if (typeof d.botMetricsMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.botMetricsMetadata: object expected");
                m.botMetricsMetadata = $root.proto.BotMetricsMetadata.fromObject(d.botMetricsMetadata);
            }
            if (d.botLinkedAccountsMetadata != null) {
                if (typeof d.botLinkedAccountsMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.botLinkedAccountsMetadata: object expected");
                m.botLinkedAccountsMetadata = $root.proto.BotLinkedAccountsMetadata.fromObject(d.botLinkedAccountsMetadata);
            }
            if (d.richResponseSourcesMetadata != null) {
                if (typeof d.richResponseSourcesMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.richResponseSourcesMetadata: object expected");
                m.richResponseSourcesMetadata = $root.proto.BotSourcesMetadata.fromObject(d.richResponseSourcesMetadata);
            }
            if (d.aiConversationContext != null) {
                if (typeof d.aiConversationContext === "string")
                    $util.base64.decode(d.aiConversationContext, m.aiConversationContext = $util.newBuffer($util.base64.length(d.aiConversationContext)), 0);
                else if (d.aiConversationContext.length >= 0)
                    m.aiConversationContext = d.aiConversationContext;
            }
            if (d.botPromotionMessageMetadata != null) {
                if (typeof d.botPromotionMessageMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.botPromotionMessageMetadata: object expected");
                m.botPromotionMessageMetadata = $root.proto.BotPromotionMessageMetadata.fromObject(d.botPromotionMessageMetadata);
            }
            if (d.botModeSelectionMetadata != null) {
                if (typeof d.botModeSelectionMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.botModeSelectionMetadata: object expected");
                m.botModeSelectionMetadata = $root.proto.BotModeSelectionMetadata.fromObject(d.botModeSelectionMetadata);
            }
            if (d.botQuotaMetadata != null) {
                if (typeof d.botQuotaMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.botQuotaMetadata: object expected");
                m.botQuotaMetadata = $root.proto.BotQuotaMetadata.fromObject(d.botQuotaMetadata);
            }
            if (d.botAgeCollectionMetadata != null) {
                if (typeof d.botAgeCollectionMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.botAgeCollectionMetadata: object expected");
                m.botAgeCollectionMetadata = $root.proto.BotAgeCollectionMetadata.fromObject(d.botAgeCollectionMetadata);
            }
            if (d.conversationStarterPromptId != null) {
                m.conversationStarterPromptId = String(d.conversationStarterPromptId);
            }
            if (d.botResponseId != null) {
                m.botResponseId = String(d.botResponseId);
            }
            if (d.verificationMetadata != null) {
                if (typeof d.verificationMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.verificationMetadata: object expected");
                m.verificationMetadata = $root.proto.BotSignatureVerificationMetadata.fromObject(d.verificationMetadata);
            }
            if (d.unifiedResponseMutation != null) {
                if (typeof d.unifiedResponseMutation !== "object")
                    throw TypeError(".proto.BotMetadata.unifiedResponseMutation: object expected");
                m.unifiedResponseMutation = $root.proto.BotUnifiedResponseMutation.fromObject(d.unifiedResponseMutation);
            }
            if (d.botMessageOriginMetadata != null) {
                if (typeof d.botMessageOriginMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.botMessageOriginMetadata: object expected");
                m.botMessageOriginMetadata = $root.proto.BotMessageOriginMetadata.fromObject(d.botMessageOriginMetadata);
            }
            if (d.inThreadSurveyMetadata != null) {
                if (typeof d.inThreadSurveyMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.inThreadSurveyMetadata: object expected");
                m.inThreadSurveyMetadata = $root.proto.InThreadSurveyMetadata.fromObject(d.inThreadSurveyMetadata);
            }
            if (d.botThreadInfo != null) {
                if (typeof d.botThreadInfo !== "object")
                    throw TypeError(".proto.BotMetadata.botThreadInfo: object expected");
                m.botThreadInfo = $root.proto.AIThreadInfo.fromObject(d.botThreadInfo);
            }
            if (d.regenerateMetadata != null) {
                if (typeof d.regenerateMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.regenerateMetadata: object expected");
                m.regenerateMetadata = $root.proto.AIRegenerateMetadata.fromObject(d.regenerateMetadata);
            }
            if (d.sessionTransparencyMetadata != null) {
                if (typeof d.sessionTransparencyMetadata !== "object")
                    throw TypeError(".proto.BotMetadata.sessionTransparencyMetadata: object expected");
                m.sessionTransparencyMetadata = $root.proto.SessionTransparencyMetadata.fromObject(d.sessionTransparencyMetadata);
            }
            if (d.internalMetadata != null) {
                if (typeof d.internalMetadata === "string")
                    $util.base64.decode(d.internalMetadata, m.internalMetadata = $util.newBuffer($util.base64.length(d.internalMetadata)), 0);
                else if (d.internalMetadata.length >= 0)
                    m.internalMetadata = d.internalMetadata;
            }
            return m;
        };

        BotMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.avatarMetadata != null && m.hasOwnProperty("avatarMetadata")) {
                d.avatarMetadata = $root.proto.BotAvatarMetadata.toObject(m.avatarMetadata, o);
                if (o.oneofs)
                    d._avatarMetadata = "avatarMetadata";
            }
            if (m.personaId != null && m.hasOwnProperty("personaId")) {
                d.personaId = m.personaId;
                if (o.oneofs)
                    d._personaId = "personaId";
            }
            if (m.pluginMetadata != null && m.hasOwnProperty("pluginMetadata")) {
                d.pluginMetadata = $root.proto.BotPluginMetadata.toObject(m.pluginMetadata, o);
                if (o.oneofs)
                    d._pluginMetadata = "pluginMetadata";
            }
            if (m.suggestedPromptMetadata != null && m.hasOwnProperty("suggestedPromptMetadata")) {
                d.suggestedPromptMetadata = $root.proto.BotSuggestedPromptMetadata.toObject(m.suggestedPromptMetadata, o);
                if (o.oneofs)
                    d._suggestedPromptMetadata = "suggestedPromptMetadata";
            }
            if (m.invokerJid != null && m.hasOwnProperty("invokerJid")) {
                d.invokerJid = m.invokerJid;
                if (o.oneofs)
                    d._invokerJid = "invokerJid";
            }
            if (m.sessionMetadata != null && m.hasOwnProperty("sessionMetadata")) {
                d.sessionMetadata = $root.proto.BotSessionMetadata.toObject(m.sessionMetadata, o);
                if (o.oneofs)
                    d._sessionMetadata = "sessionMetadata";
            }
            if (m.memuMetadata != null && m.hasOwnProperty("memuMetadata")) {
                d.memuMetadata = $root.proto.BotMemuMetadata.toObject(m.memuMetadata, o);
                if (o.oneofs)
                    d._memuMetadata = "memuMetadata";
            }
            if (m.timezone != null && m.hasOwnProperty("timezone")) {
                d.timezone = m.timezone;
                if (o.oneofs)
                    d._timezone = "timezone";
            }
            if (m.reminderMetadata != null && m.hasOwnProperty("reminderMetadata")) {
                d.reminderMetadata = $root.proto.BotReminderMetadata.toObject(m.reminderMetadata, o);
                if (o.oneofs)
                    d._reminderMetadata = "reminderMetadata";
            }
            if (m.modelMetadata != null && m.hasOwnProperty("modelMetadata")) {
                d.modelMetadata = $root.proto.BotModelMetadata.toObject(m.modelMetadata, o);
                if (o.oneofs)
                    d._modelMetadata = "modelMetadata";
            }
            if (m.messageDisclaimerText != null && m.hasOwnProperty("messageDisclaimerText")) {
                d.messageDisclaimerText = m.messageDisclaimerText;
                if (o.oneofs)
                    d._messageDisclaimerText = "messageDisclaimerText";
            }
            if (m.progressIndicatorMetadata != null && m.hasOwnProperty("progressIndicatorMetadata")) {
                d.progressIndicatorMetadata = $root.proto.BotProgressIndicatorMetadata.toObject(m.progressIndicatorMetadata, o);
                if (o.oneofs)
                    d._progressIndicatorMetadata = "progressIndicatorMetadata";
            }
            if (m.capabilityMetadata != null && m.hasOwnProperty("capabilityMetadata")) {
                d.capabilityMetadata = $root.proto.BotCapabilityMetadata.toObject(m.capabilityMetadata, o);
                if (o.oneofs)
                    d._capabilityMetadata = "capabilityMetadata";
            }
            if (m.imagineMetadata != null && m.hasOwnProperty("imagineMetadata")) {
                d.imagineMetadata = $root.proto.BotImagineMetadata.toObject(m.imagineMetadata, o);
                if (o.oneofs)
                    d._imagineMetadata = "imagineMetadata";
            }
            if (m.memoryMetadata != null && m.hasOwnProperty("memoryMetadata")) {
                d.memoryMetadata = $root.proto.BotMemoryMetadata.toObject(m.memoryMetadata, o);
                if (o.oneofs)
                    d._memoryMetadata = "memoryMetadata";
            }
            if (m.renderingMetadata != null && m.hasOwnProperty("renderingMetadata")) {
                d.renderingMetadata = $root.proto.BotRenderingMetadata.toObject(m.renderingMetadata, o);
                if (o.oneofs)
                    d._renderingMetadata = "renderingMetadata";
            }
            if (m.botMetricsMetadata != null && m.hasOwnProperty("botMetricsMetadata")) {
                d.botMetricsMetadata = $root.proto.BotMetricsMetadata.toObject(m.botMetricsMetadata, o);
                if (o.oneofs)
                    d._botMetricsMetadata = "botMetricsMetadata";
            }
            if (m.botLinkedAccountsMetadata != null && m.hasOwnProperty("botLinkedAccountsMetadata")) {
                d.botLinkedAccountsMetadata = $root.proto.BotLinkedAccountsMetadata.toObject(m.botLinkedAccountsMetadata, o);
                if (o.oneofs)
                    d._botLinkedAccountsMetadata = "botLinkedAccountsMetadata";
            }
            if (m.richResponseSourcesMetadata != null && m.hasOwnProperty("richResponseSourcesMetadata")) {
                d.richResponseSourcesMetadata = $root.proto.BotSourcesMetadata.toObject(m.richResponseSourcesMetadata, o);
                if (o.oneofs)
                    d._richResponseSourcesMetadata = "richResponseSourcesMetadata";
            }
            if (m.aiConversationContext != null && m.hasOwnProperty("aiConversationContext")) {
                d.aiConversationContext = o.bytes === String ? $util.base64.encode(m.aiConversationContext, 0, m.aiConversationContext.length) : o.bytes === Array ? Array.prototype.slice.call(m.aiConversationContext) : m.aiConversationContext;
                if (o.oneofs)
                    d._aiConversationContext = "aiConversationContext";
            }
            if (m.botPromotionMessageMetadata != null && m.hasOwnProperty("botPromotionMessageMetadata")) {
                d.botPromotionMessageMetadata = $root.proto.BotPromotionMessageMetadata.toObject(m.botPromotionMessageMetadata, o);
                if (o.oneofs)
                    d._botPromotionMessageMetadata = "botPromotionMessageMetadata";
            }
            if (m.botModeSelectionMetadata != null && m.hasOwnProperty("botModeSelectionMetadata")) {
                d.botModeSelectionMetadata = $root.proto.BotModeSelectionMetadata.toObject(m.botModeSelectionMetadata, o);
                if (o.oneofs)
                    d._botModeSelectionMetadata = "botModeSelectionMetadata";
            }
            if (m.botQuotaMetadata != null && m.hasOwnProperty("botQuotaMetadata")) {
                d.botQuotaMetadata = $root.proto.BotQuotaMetadata.toObject(m.botQuotaMetadata, o);
                if (o.oneofs)
                    d._botQuotaMetadata = "botQuotaMetadata";
            }
            if (m.botAgeCollectionMetadata != null && m.hasOwnProperty("botAgeCollectionMetadata")) {
                d.botAgeCollectionMetadata = $root.proto.BotAgeCollectionMetadata.toObject(m.botAgeCollectionMetadata, o);
                if (o.oneofs)
                    d._botAgeCollectionMetadata = "botAgeCollectionMetadata";
            }
            if (m.conversationStarterPromptId != null && m.hasOwnProperty("conversationStarterPromptId")) {
                d.conversationStarterPromptId = m.conversationStarterPromptId;
                if (o.oneofs)
                    d._conversationStarterPromptId = "conversationStarterPromptId";
            }
            if (m.botResponseId != null && m.hasOwnProperty("botResponseId")) {
                d.botResponseId = m.botResponseId;
                if (o.oneofs)
                    d._botResponseId = "botResponseId";
            }
            if (m.verificationMetadata != null && m.hasOwnProperty("verificationMetadata")) {
                d.verificationMetadata = $root.proto.BotSignatureVerificationMetadata.toObject(m.verificationMetadata, o);
                if (o.oneofs)
                    d._verificationMetadata = "verificationMetadata";
            }
            if (m.unifiedResponseMutation != null && m.hasOwnProperty("unifiedResponseMutation")) {
                d.unifiedResponseMutation = $root.proto.BotUnifiedResponseMutation.toObject(m.unifiedResponseMutation, o);
                if (o.oneofs)
                    d._unifiedResponseMutation = "unifiedResponseMutation";
            }
            if (m.botMessageOriginMetadata != null && m.hasOwnProperty("botMessageOriginMetadata")) {
                d.botMessageOriginMetadata = $root.proto.BotMessageOriginMetadata.toObject(m.botMessageOriginMetadata, o);
                if (o.oneofs)
                    d._botMessageOriginMetadata = "botMessageOriginMetadata";
            }
            if (m.inThreadSurveyMetadata != null && m.hasOwnProperty("inThreadSurveyMetadata")) {
                d.inThreadSurveyMetadata = $root.proto.InThreadSurveyMetadata.toObject(m.inThreadSurveyMetadata, o);
                if (o.oneofs)
                    d._inThreadSurveyMetadata = "inThreadSurveyMetadata";
            }
            if (m.botThreadInfo != null && m.hasOwnProperty("botThreadInfo")) {
                d.botThreadInfo = $root.proto.AIThreadInfo.toObject(m.botThreadInfo, o);
                if (o.oneofs)
                    d._botThreadInfo = "botThreadInfo";
            }
            if (m.regenerateMetadata != null && m.hasOwnProperty("regenerateMetadata")) {
                d.regenerateMetadata = $root.proto.AIRegenerateMetadata.toObject(m.regenerateMetadata, o);
                if (o.oneofs)
                    d._regenerateMetadata = "regenerateMetadata";
            }
            if (m.sessionTransparencyMetadata != null && m.hasOwnProperty("sessionTransparencyMetadata")) {
                d.sessionTransparencyMetadata = $root.proto.SessionTransparencyMetadata.toObject(m.sessionTransparencyMetadata, o);
                if (o.oneofs)
                    d._sessionTransparencyMetadata = "sessionTransparencyMetadata";
            }
            if (m.internalMetadata != null && m.hasOwnProperty("internalMetadata")) {
                d.internalMetadata = o.bytes === String ? $util.base64.encode(m.internalMetadata, 0, m.internalMetadata.length) : o.bytes === Array ? Array.prototype.slice.call(m.internalMetadata) : m.internalMetadata;
                if (o.oneofs)
                    d._internalMetadata = "internalMetadata";
            }
            return d;
        };

        BotMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMetadata";
        };

        return BotMetadata;
    })();

    proto.BotMetricsEntryPoint = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UNDEFINED_ENTRY_POINT"] = 0;
        values[valuesById[1] = "FAVICON"] = 1;
        values[valuesById[2] = "CHATLIST"] = 2;
        values[valuesById[3] = "AISEARCH_NULL_STATE_PAPER_PLANE"] = 3;
        values[valuesById[4] = "AISEARCH_NULL_STATE_SUGGESTION"] = 4;
        values[valuesById[5] = "AISEARCH_TYPE_AHEAD_SUGGESTION"] = 5;
        values[valuesById[6] = "AISEARCH_TYPE_AHEAD_PAPER_PLANE"] = 6;
        values[valuesById[7] = "AISEARCH_TYPE_AHEAD_RESULT_CHATLIST"] = 7;
        values[valuesById[8] = "AISEARCH_TYPE_AHEAD_RESULT_MESSAGES"] = 8;
        values[valuesById[9] = "AIVOICE_SEARCH_BAR"] = 9;
        values[valuesById[10] = "AIVOICE_FAVICON"] = 10;
        values[valuesById[11] = "AISTUDIO"] = 11;
        values[valuesById[12] = "DEEPLINK"] = 12;
        values[valuesById[13] = "NOTIFICATION"] = 13;
        values[valuesById[14] = "PROFILE_MESSAGE_BUTTON"] = 14;
        values[valuesById[15] = "FORWARD"] = 15;
        values[valuesById[16] = "APP_SHORTCUT"] = 16;
        values[valuesById[17] = "FF_FAMILY"] = 17;
        values[valuesById[18] = "AI_TAB"] = 18;
        values[valuesById[19] = "AI_HOME"] = 19;
        values[valuesById[20] = "AI_DEEPLINK_IMMERSIVE"] = 20;
        values[valuesById[21] = "AI_DEEPLINK"] = 21;
        values[valuesById[22] = "META_AI_CHAT_SHORTCUT_AI_STUDIO"] = 22;
        values[valuesById[23] = "UGC_CHAT_SHORTCUT_AI_STUDIO"] = 23;
        values[valuesById[24] = "NEW_CHAT_AI_STUDIO"] = 24;
        values[valuesById[25] = "AIVOICE_FAVICON_CALL_HISTORY"] = 25;
        values[valuesById[26] = "ASK_META_AI_CONTEXT_MENU"] = 26;
        values[valuesById[27] = "ASK_META_AI_CONTEXT_MENU_1ON1"] = 27;
        values[valuesById[28] = "ASK_META_AI_CONTEXT_MENU_GROUP"] = 28;
        values[valuesById[29] = "INVOKE_META_AI_1ON1"] = 29;
        values[valuesById[30] = "INVOKE_META_AI_GROUP"] = 30;
        values[valuesById[31] = "META_AI_FORWARD"] = 31;
        values[valuesById[32] = "NEW_CHAT_AI_CONTACT"] = 32;
        values[valuesById[33] = "MESSAGE_QUICK_ACTION_1_ON_1_CHAT"] = 33;
        values[valuesById[34] = "MESSAGE_QUICK_ACTION_GROUP_CHAT"] = 34;
        values[valuesById[35] = "ATTACHMENT_TRAY_1_ON_1_CHAT"] = 35;
        values[valuesById[36] = "ATTACHMENT_TRAY_GROUP_CHAT"] = 36;
        values[valuesById[37] = "ASK_META_AI_MEDIA_VIEWER_1ON1"] = 37;
        values[valuesById[38] = "ASK_META_AI_MEDIA_VIEWER_GROUP"] = 38;
        return values;
    })();

    proto.BotMetricsMetadata = (function() {

        function BotMetricsMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotMetricsMetadata.prototype.destinationId = null;
        BotMetricsMetadata.prototype.destinationEntryPoint = null;
        BotMetricsMetadata.prototype.threadOrigin = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetricsMetadata.prototype, "_destinationId", {
            get: $util.oneOfGetter($oneOfFields = ["destinationId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetricsMetadata.prototype, "_destinationEntryPoint", {
            get: $util.oneOfGetter($oneOfFields = ["destinationEntryPoint"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotMetricsMetadata.prototype, "_threadOrigin", {
            get: $util.oneOfGetter($oneOfFields = ["threadOrigin"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotMetricsMetadata.create = function create(properties) {
            return new BotMetricsMetadata(properties);
        };

        BotMetricsMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.destinationId != null && Object.hasOwnProperty.call(m, "destinationId"))
                w.uint32(10).string(m.destinationId);
            if (m.destinationEntryPoint != null && Object.hasOwnProperty.call(m, "destinationEntryPoint"))
                w.uint32(16).int32(m.destinationEntryPoint);
            if (m.threadOrigin != null && Object.hasOwnProperty.call(m, "threadOrigin"))
                w.uint32(24).int32(m.threadOrigin);
            return w;
        };

        BotMetricsMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotMetricsMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.destinationId = r.string();
                        break;
                    }
                case 2: {
                        m.destinationEntryPoint = r.int32();
                        break;
                    }
                case 3: {
                        m.threadOrigin = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotMetricsMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotMetricsMetadata)
                return d;
            var m = new $root.proto.BotMetricsMetadata();
            if (d.destinationId != null) {
                m.destinationId = String(d.destinationId);
            }
            switch (d.destinationEntryPoint) {
            default:
                if (typeof d.destinationEntryPoint === "number") {
                    m.destinationEntryPoint = d.destinationEntryPoint;
                    break;
                }
                break;
            case "UNDEFINED_ENTRY_POINT":
            case 0:
                m.destinationEntryPoint = 0;
                break;
            case "FAVICON":
            case 1:
                m.destinationEntryPoint = 1;
                break;
            case "CHATLIST":
            case 2:
                m.destinationEntryPoint = 2;
                break;
            case "AISEARCH_NULL_STATE_PAPER_PLANE":
            case 3:
                m.destinationEntryPoint = 3;
                break;
            case "AISEARCH_NULL_STATE_SUGGESTION":
            case 4:
                m.destinationEntryPoint = 4;
                break;
            case "AISEARCH_TYPE_AHEAD_SUGGESTION":
            case 5:
                m.destinationEntryPoint = 5;
                break;
            case "AISEARCH_TYPE_AHEAD_PAPER_PLANE":
            case 6:
                m.destinationEntryPoint = 6;
                break;
            case "AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":
            case 7:
                m.destinationEntryPoint = 7;
                break;
            case "AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":
            case 8:
                m.destinationEntryPoint = 8;
                break;
            case "AIVOICE_SEARCH_BAR":
            case 9:
                m.destinationEntryPoint = 9;
                break;
            case "AIVOICE_FAVICON":
            case 10:
                m.destinationEntryPoint = 10;
                break;
            case "AISTUDIO":
            case 11:
                m.destinationEntryPoint = 11;
                break;
            case "DEEPLINK":
            case 12:
                m.destinationEntryPoint = 12;
                break;
            case "NOTIFICATION":
            case 13:
                m.destinationEntryPoint = 13;
                break;
            case "PROFILE_MESSAGE_BUTTON":
            case 14:
                m.destinationEntryPoint = 14;
                break;
            case "FORWARD":
            case 15:
                m.destinationEntryPoint = 15;
                break;
            case "APP_SHORTCUT":
            case 16:
                m.destinationEntryPoint = 16;
                break;
            case "FF_FAMILY":
            case 17:
                m.destinationEntryPoint = 17;
                break;
            case "AI_TAB":
            case 18:
                m.destinationEntryPoint = 18;
                break;
            case "AI_HOME":
            case 19:
                m.destinationEntryPoint = 19;
                break;
            case "AI_DEEPLINK_IMMERSIVE":
            case 20:
                m.destinationEntryPoint = 20;
                break;
            case "AI_DEEPLINK":
            case 21:
                m.destinationEntryPoint = 21;
                break;
            case "META_AI_CHAT_SHORTCUT_AI_STUDIO":
            case 22:
                m.destinationEntryPoint = 22;
                break;
            case "UGC_CHAT_SHORTCUT_AI_STUDIO":
            case 23:
                m.destinationEntryPoint = 23;
                break;
            case "NEW_CHAT_AI_STUDIO":
            case 24:
                m.destinationEntryPoint = 24;
                break;
            case "AIVOICE_FAVICON_CALL_HISTORY":
            case 25:
                m.destinationEntryPoint = 25;
                break;
            case "ASK_META_AI_CONTEXT_MENU":
            case 26:
                m.destinationEntryPoint = 26;
                break;
            case "ASK_META_AI_CONTEXT_MENU_1ON1":
            case 27:
                m.destinationEntryPoint = 27;
                break;
            case "ASK_META_AI_CONTEXT_MENU_GROUP":
            case 28:
                m.destinationEntryPoint = 28;
                break;
            case "INVOKE_META_AI_1ON1":
            case 29:
                m.destinationEntryPoint = 29;
                break;
            case "INVOKE_META_AI_GROUP":
            case 30:
                m.destinationEntryPoint = 30;
                break;
            case "META_AI_FORWARD":
            case 31:
                m.destinationEntryPoint = 31;
                break;
            case "NEW_CHAT_AI_CONTACT":
            case 32:
                m.destinationEntryPoint = 32;
                break;
            case "MESSAGE_QUICK_ACTION_1_ON_1_CHAT":
            case 33:
                m.destinationEntryPoint = 33;
                break;
            case "MESSAGE_QUICK_ACTION_GROUP_CHAT":
            case 34:
                m.destinationEntryPoint = 34;
                break;
            case "ATTACHMENT_TRAY_1_ON_1_CHAT":
            case 35:
                m.destinationEntryPoint = 35;
                break;
            case "ATTACHMENT_TRAY_GROUP_CHAT":
            case 36:
                m.destinationEntryPoint = 36;
                break;
            case "ASK_META_AI_MEDIA_VIEWER_1ON1":
            case 37:
                m.destinationEntryPoint = 37;
                break;
            case "ASK_META_AI_MEDIA_VIEWER_GROUP":
            case 38:
                m.destinationEntryPoint = 38;
                break;
            }
            switch (d.threadOrigin) {
            default:
                if (typeof d.threadOrigin === "number") {
                    m.threadOrigin = d.threadOrigin;
                    break;
                }
                break;
            case "AI_TAB_THREAD":
            case 1:
                m.threadOrigin = 1;
                break;
            case "AI_HOME_THREAD":
            case 2:
                m.threadOrigin = 2;
                break;
            case "AI_DEEPLINK_IMMERSIVE_THREAD":
            case 3:
                m.threadOrigin = 3;
                break;
            case "AI_DEEPLINK_THREAD":
            case 4:
                m.threadOrigin = 4;
                break;
            case "ASK_META_AI_CONTEXT_MENU_THREAD":
            case 5:
                m.threadOrigin = 5;
                break;
            }
            return m;
        };

        BotMetricsMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.destinationId != null && m.hasOwnProperty("destinationId")) {
                d.destinationId = m.destinationId;
                if (o.oneofs)
                    d._destinationId = "destinationId";
            }
            if (m.destinationEntryPoint != null && m.hasOwnProperty("destinationEntryPoint")) {
                d.destinationEntryPoint = o.enums === String ? $root.proto.BotMetricsEntryPoint[m.destinationEntryPoint] === undefined ? m.destinationEntryPoint : $root.proto.BotMetricsEntryPoint[m.destinationEntryPoint] : m.destinationEntryPoint;
                if (o.oneofs)
                    d._destinationEntryPoint = "destinationEntryPoint";
            }
            if (m.threadOrigin != null && m.hasOwnProperty("threadOrigin")) {
                d.threadOrigin = o.enums === String ? $root.proto.BotMetricsThreadEntryPoint[m.threadOrigin] === undefined ? m.threadOrigin : $root.proto.BotMetricsThreadEntryPoint[m.threadOrigin] : m.threadOrigin;
                if (o.oneofs)
                    d._threadOrigin = "threadOrigin";
            }
            return d;
        };

        BotMetricsMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotMetricsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotMetricsMetadata";
        };

        return BotMetricsMetadata;
    })();

    proto.BotMetricsThreadEntryPoint = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[1] = "AI_TAB_THREAD"] = 1;
        values[valuesById[2] = "AI_HOME_THREAD"] = 2;
        values[valuesById[3] = "AI_DEEPLINK_IMMERSIVE_THREAD"] = 3;
        values[valuesById[4] = "AI_DEEPLINK_THREAD"] = 4;
        values[valuesById[5] = "ASK_META_AI_CONTEXT_MENU_THREAD"] = 5;
        return values;
    })();

    proto.BotModeSelectionMetadata = (function() {

        function BotModeSelectionMetadata(p) {
            this.mode = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotModeSelectionMetadata.prototype.mode = $util.emptyArray;

        BotModeSelectionMetadata.create = function create(properties) {
            return new BotModeSelectionMetadata(properties);
        };

        BotModeSelectionMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.mode != null && m.mode.length) {
                w.uint32(10).fork();
                for (var i = 0; i < m.mode.length; ++i)
                    w.int32(m.mode[i]);
                w.ldelim();
            }
            return w;
        };

        BotModeSelectionMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotModeSelectionMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.mode && m.mode.length))
                            m.mode = [];
                        if ((t & 7) === 2) {
                            var c2 = r.uint32() + r.pos;
                            while (r.pos < c2)
                                m.mode.push(r.int32());
                        } else
                            m.mode.push(r.int32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotModeSelectionMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotModeSelectionMetadata)
                return d;
            var m = new $root.proto.BotModeSelectionMetadata();
            if (d.mode) {
                if (!Array.isArray(d.mode))
                    throw TypeError(".proto.BotModeSelectionMetadata.mode: array expected");
                m.mode = [];
                for (var i = 0; i < d.mode.length; ++i) {
                    switch (d.mode[i]) {
                    default:
                        if (typeof d.mode[i] === "number") {
                            m.mode[i] = d.mode[i];
                            break;
                        }
                    case "UNKNOWN_MODE":
                    case 0:
                        m.mode[i] = 0;
                        break;
                    case "REASONING_MODE":
                    case 1:
                        m.mode[i] = 1;
                        break;
                    }
                }
            }
            return m;
        };

        BotModeSelectionMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.mode = [];
            }
            if (m.mode && m.mode.length) {
                d.mode = [];
                for (var j = 0; j < m.mode.length; ++j) {
                    d.mode[j] = o.enums === String ? $root.proto.BotModeSelectionMetadata.BotUserSelectionMode[m.mode[j]] === undefined ? m.mode[j] : $root.proto.BotModeSelectionMetadata.BotUserSelectionMode[m.mode[j]] : m.mode[j];
                }
            }
            return d;
        };

        BotModeSelectionMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotModeSelectionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotModeSelectionMetadata";
        };

        BotModeSelectionMetadata.BotUserSelectionMode = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_MODE"] = 0;
            values[valuesById[1] = "REASONING_MODE"] = 1;
            return values;
        })();

        return BotModeSelectionMetadata;
    })();

    proto.BotModelMetadata = (function() {

        function BotModelMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotModelMetadata.prototype.modelType = null;
        BotModelMetadata.prototype.premiumModelStatus = null;
        BotModelMetadata.prototype.modelNameOverride = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotModelMetadata.prototype, "_modelType", {
            get: $util.oneOfGetter($oneOfFields = ["modelType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotModelMetadata.prototype, "_premiumModelStatus", {
            get: $util.oneOfGetter($oneOfFields = ["premiumModelStatus"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotModelMetadata.prototype, "_modelNameOverride", {
            get: $util.oneOfGetter($oneOfFields = ["modelNameOverride"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotModelMetadata.create = function create(properties) {
            return new BotModelMetadata(properties);
        };

        BotModelMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.modelType != null && Object.hasOwnProperty.call(m, "modelType"))
                w.uint32(8).int32(m.modelType);
            if (m.premiumModelStatus != null && Object.hasOwnProperty.call(m, "premiumModelStatus"))
                w.uint32(16).int32(m.premiumModelStatus);
            if (m.modelNameOverride != null && Object.hasOwnProperty.call(m, "modelNameOverride"))
                w.uint32(26).string(m.modelNameOverride);
            return w;
        };

        BotModelMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotModelMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.modelType = r.int32();
                        break;
                    }
                case 2: {
                        m.premiumModelStatus = r.int32();
                        break;
                    }
                case 3: {
                        m.modelNameOverride = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotModelMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotModelMetadata)
                return d;
            var m = new $root.proto.BotModelMetadata();
            switch (d.modelType) {
            default:
                if (typeof d.modelType === "number") {
                    m.modelType = d.modelType;
                    break;
                }
                break;
            case "UNKNOWN_TYPE":
            case 0:
                m.modelType = 0;
                break;
            case "LLAMA_PROD":
            case 1:
                m.modelType = 1;
                break;
            case "LLAMA_PROD_PREMIUM":
            case 2:
                m.modelType = 2;
                break;
            }
            switch (d.premiumModelStatus) {
            default:
                if (typeof d.premiumModelStatus === "number") {
                    m.premiumModelStatus = d.premiumModelStatus;
                    break;
                }
                break;
            case "UNKNOWN_STATUS":
            case 0:
                m.premiumModelStatus = 0;
                break;
            case "AVAILABLE":
            case 1:
                m.premiumModelStatus = 1;
                break;
            case "QUOTA_EXCEED_LIMIT":
            case 2:
                m.premiumModelStatus = 2;
                break;
            }
            if (d.modelNameOverride != null) {
                m.modelNameOverride = String(d.modelNameOverride);
            }
            return m;
        };

        BotModelMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.modelType != null && m.hasOwnProperty("modelType")) {
                d.modelType = o.enums === String ? $root.proto.BotModelMetadata.ModelType[m.modelType] === undefined ? m.modelType : $root.proto.BotModelMetadata.ModelType[m.modelType] : m.modelType;
                if (o.oneofs)
                    d._modelType = "modelType";
            }
            if (m.premiumModelStatus != null && m.hasOwnProperty("premiumModelStatus")) {
                d.premiumModelStatus = o.enums === String ? $root.proto.BotModelMetadata.PremiumModelStatus[m.premiumModelStatus] === undefined ? m.premiumModelStatus : $root.proto.BotModelMetadata.PremiumModelStatus[m.premiumModelStatus] : m.premiumModelStatus;
                if (o.oneofs)
                    d._premiumModelStatus = "premiumModelStatus";
            }
            if (m.modelNameOverride != null && m.hasOwnProperty("modelNameOverride")) {
                d.modelNameOverride = m.modelNameOverride;
                if (o.oneofs)
                    d._modelNameOverride = "modelNameOverride";
            }
            return d;
        };

        BotModelMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotModelMetadata";
        };

        BotModelMetadata.ModelType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_TYPE"] = 0;
            values[valuesById[1] = "LLAMA_PROD"] = 1;
            values[valuesById[2] = "LLAMA_PROD_PREMIUM"] = 2;
            return values;
        })();

        BotModelMetadata.PremiumModelStatus = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_STATUS"] = 0;
            values[valuesById[1] = "AVAILABLE"] = 1;
            values[valuesById[2] = "QUOTA_EXCEED_LIMIT"] = 2;
            return values;
        })();

        return BotModelMetadata;
    })();

    proto.BotPluginMetadata = (function() {

        function BotPluginMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotPluginMetadata.prototype.provider = null;
        BotPluginMetadata.prototype.pluginType = null;
        BotPluginMetadata.prototype.thumbnailCdnUrl = null;
        BotPluginMetadata.prototype.profilePhotoCdnUrl = null;
        BotPluginMetadata.prototype.searchProviderUrl = null;
        BotPluginMetadata.prototype.referenceIndex = null;
        BotPluginMetadata.prototype.expectedLinksCount = null;
        BotPluginMetadata.prototype.searchQuery = null;
        BotPluginMetadata.prototype.parentPluginMessageKey = null;
        BotPluginMetadata.prototype.deprecatedField = null;
        BotPluginMetadata.prototype.parentPluginType = null;
        BotPluginMetadata.prototype.faviconCdnUrl = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_provider", {
            get: $util.oneOfGetter($oneOfFields = ["provider"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_pluginType", {
            get: $util.oneOfGetter($oneOfFields = ["pluginType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_thumbnailCdnUrl", {
            get: $util.oneOfGetter($oneOfFields = ["thumbnailCdnUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_profilePhotoCdnUrl", {
            get: $util.oneOfGetter($oneOfFields = ["profilePhotoCdnUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_searchProviderUrl", {
            get: $util.oneOfGetter($oneOfFields = ["searchProviderUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_referenceIndex", {
            get: $util.oneOfGetter($oneOfFields = ["referenceIndex"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_expectedLinksCount", {
            get: $util.oneOfGetter($oneOfFields = ["expectedLinksCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_searchQuery", {
            get: $util.oneOfGetter($oneOfFields = ["searchQuery"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_parentPluginMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["parentPluginMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_deprecatedField", {
            get: $util.oneOfGetter($oneOfFields = ["deprecatedField"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_parentPluginType", {
            get: $util.oneOfGetter($oneOfFields = ["parentPluginType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPluginMetadata.prototype, "_faviconCdnUrl", {
            get: $util.oneOfGetter($oneOfFields = ["faviconCdnUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotPluginMetadata.create = function create(properties) {
            return new BotPluginMetadata(properties);
        };

        BotPluginMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.provider != null && Object.hasOwnProperty.call(m, "provider"))
                w.uint32(8).int32(m.provider);
            if (m.pluginType != null && Object.hasOwnProperty.call(m, "pluginType"))
                w.uint32(16).int32(m.pluginType);
            if (m.thumbnailCdnUrl != null && Object.hasOwnProperty.call(m, "thumbnailCdnUrl"))
                w.uint32(26).string(m.thumbnailCdnUrl);
            if (m.profilePhotoCdnUrl != null && Object.hasOwnProperty.call(m, "profilePhotoCdnUrl"))
                w.uint32(34).string(m.profilePhotoCdnUrl);
            if (m.searchProviderUrl != null && Object.hasOwnProperty.call(m, "searchProviderUrl"))
                w.uint32(42).string(m.searchProviderUrl);
            if (m.referenceIndex != null && Object.hasOwnProperty.call(m, "referenceIndex"))
                w.uint32(48).uint32(m.referenceIndex);
            if (m.expectedLinksCount != null && Object.hasOwnProperty.call(m, "expectedLinksCount"))
                w.uint32(56).uint32(m.expectedLinksCount);
            if (m.searchQuery != null && Object.hasOwnProperty.call(m, "searchQuery"))
                w.uint32(74).string(m.searchQuery);
            if (m.parentPluginMessageKey != null && Object.hasOwnProperty.call(m, "parentPluginMessageKey"))
                $root.proto.MessageKey.encode(m.parentPluginMessageKey, w.uint32(82).fork()).ldelim();
            if (m.deprecatedField != null && Object.hasOwnProperty.call(m, "deprecatedField"))
                w.uint32(88).int32(m.deprecatedField);
            if (m.parentPluginType != null && Object.hasOwnProperty.call(m, "parentPluginType"))
                w.uint32(96).int32(m.parentPluginType);
            if (m.faviconCdnUrl != null && Object.hasOwnProperty.call(m, "faviconCdnUrl"))
                w.uint32(106).string(m.faviconCdnUrl);
            return w;
        };

        BotPluginMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotPluginMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.provider = r.int32();
                        break;
                    }
                case 2: {
                        m.pluginType = r.int32();
                        break;
                    }
                case 3: {
                        m.thumbnailCdnUrl = r.string();
                        break;
                    }
                case 4: {
                        m.profilePhotoCdnUrl = r.string();
                        break;
                    }
                case 5: {
                        m.searchProviderUrl = r.string();
                        break;
                    }
                case 6: {
                        m.referenceIndex = r.uint32();
                        break;
                    }
                case 7: {
                        m.expectedLinksCount = r.uint32();
                        break;
                    }
                case 9: {
                        m.searchQuery = r.string();
                        break;
                    }
                case 10: {
                        m.parentPluginMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 11: {
                        m.deprecatedField = r.int32();
                        break;
                    }
                case 12: {
                        m.parentPluginType = r.int32();
                        break;
                    }
                case 13: {
                        m.faviconCdnUrl = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotPluginMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotPluginMetadata)
                return d;
            var m = new $root.proto.BotPluginMetadata();
            switch (d.provider) {
            default:
                if (typeof d.provider === "number") {
                    m.provider = d.provider;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.provider = 0;
                break;
            case "BING":
            case 1:
                m.provider = 1;
                break;
            case "GOOGLE":
            case 2:
                m.provider = 2;
                break;
            case "SUPPORT":
            case 3:
                m.provider = 3;
                break;
            }
            switch (d.pluginType) {
            default:
                if (typeof d.pluginType === "number") {
                    m.pluginType = d.pluginType;
                    break;
                }
                break;
            case "UNKNOWN_PLUGIN":
            case 0:
                m.pluginType = 0;
                break;
            case "REELS":
            case 1:
                m.pluginType = 1;
                break;
            case "SEARCH":
            case 2:
                m.pluginType = 2;
                break;
            }
            if (d.thumbnailCdnUrl != null) {
                m.thumbnailCdnUrl = String(d.thumbnailCdnUrl);
            }
            if (d.profilePhotoCdnUrl != null) {
                m.profilePhotoCdnUrl = String(d.profilePhotoCdnUrl);
            }
            if (d.searchProviderUrl != null) {
                m.searchProviderUrl = String(d.searchProviderUrl);
            }
            if (d.referenceIndex != null) {
                m.referenceIndex = d.referenceIndex >>> 0;
            }
            if (d.expectedLinksCount != null) {
                m.expectedLinksCount = d.expectedLinksCount >>> 0;
            }
            if (d.searchQuery != null) {
                m.searchQuery = String(d.searchQuery);
            }
            if (d.parentPluginMessageKey != null) {
                if (typeof d.parentPluginMessageKey !== "object")
                    throw TypeError(".proto.BotPluginMetadata.parentPluginMessageKey: object expected");
                m.parentPluginMessageKey = $root.proto.MessageKey.fromObject(d.parentPluginMessageKey);
            }
            switch (d.deprecatedField) {
            default:
                if (typeof d.deprecatedField === "number") {
                    m.deprecatedField = d.deprecatedField;
                    break;
                }
                break;
            case "UNKNOWN_PLUGIN":
            case 0:
                m.deprecatedField = 0;
                break;
            case "REELS":
            case 1:
                m.deprecatedField = 1;
                break;
            case "SEARCH":
            case 2:
                m.deprecatedField = 2;
                break;
            }
            switch (d.parentPluginType) {
            default:
                if (typeof d.parentPluginType === "number") {
                    m.parentPluginType = d.parentPluginType;
                    break;
                }
                break;
            case "UNKNOWN_PLUGIN":
            case 0:
                m.parentPluginType = 0;
                break;
            case "REELS":
            case 1:
                m.parentPluginType = 1;
                break;
            case "SEARCH":
            case 2:
                m.parentPluginType = 2;
                break;
            }
            if (d.faviconCdnUrl != null) {
                m.faviconCdnUrl = String(d.faviconCdnUrl);
            }
            return m;
        };

        BotPluginMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.provider != null && m.hasOwnProperty("provider")) {
                d.provider = o.enums === String ? $root.proto.BotPluginMetadata.SearchProvider[m.provider] === undefined ? m.provider : $root.proto.BotPluginMetadata.SearchProvider[m.provider] : m.provider;
                if (o.oneofs)
                    d._provider = "provider";
            }
            if (m.pluginType != null && m.hasOwnProperty("pluginType")) {
                d.pluginType = o.enums === String ? $root.proto.BotPluginMetadata.PluginType[m.pluginType] === undefined ? m.pluginType : $root.proto.BotPluginMetadata.PluginType[m.pluginType] : m.pluginType;
                if (o.oneofs)
                    d._pluginType = "pluginType";
            }
            if (m.thumbnailCdnUrl != null && m.hasOwnProperty("thumbnailCdnUrl")) {
                d.thumbnailCdnUrl = m.thumbnailCdnUrl;
                if (o.oneofs)
                    d._thumbnailCdnUrl = "thumbnailCdnUrl";
            }
            if (m.profilePhotoCdnUrl != null && m.hasOwnProperty("profilePhotoCdnUrl")) {
                d.profilePhotoCdnUrl = m.profilePhotoCdnUrl;
                if (o.oneofs)
                    d._profilePhotoCdnUrl = "profilePhotoCdnUrl";
            }
            if (m.searchProviderUrl != null && m.hasOwnProperty("searchProviderUrl")) {
                d.searchProviderUrl = m.searchProviderUrl;
                if (o.oneofs)
                    d._searchProviderUrl = "searchProviderUrl";
            }
            if (m.referenceIndex != null && m.hasOwnProperty("referenceIndex")) {
                d.referenceIndex = m.referenceIndex;
                if (o.oneofs)
                    d._referenceIndex = "referenceIndex";
            }
            if (m.expectedLinksCount != null && m.hasOwnProperty("expectedLinksCount")) {
                d.expectedLinksCount = m.expectedLinksCount;
                if (o.oneofs)
                    d._expectedLinksCount = "expectedLinksCount";
            }
            if (m.searchQuery != null && m.hasOwnProperty("searchQuery")) {
                d.searchQuery = m.searchQuery;
                if (o.oneofs)
                    d._searchQuery = "searchQuery";
            }
            if (m.parentPluginMessageKey != null && m.hasOwnProperty("parentPluginMessageKey")) {
                d.parentPluginMessageKey = $root.proto.MessageKey.toObject(m.parentPluginMessageKey, o);
                if (o.oneofs)
                    d._parentPluginMessageKey = "parentPluginMessageKey";
            }
            if (m.deprecatedField != null && m.hasOwnProperty("deprecatedField")) {
                d.deprecatedField = o.enums === String ? $root.proto.BotPluginMetadata.PluginType[m.deprecatedField] === undefined ? m.deprecatedField : $root.proto.BotPluginMetadata.PluginType[m.deprecatedField] : m.deprecatedField;
                if (o.oneofs)
                    d._deprecatedField = "deprecatedField";
            }
            if (m.parentPluginType != null && m.hasOwnProperty("parentPluginType")) {
                d.parentPluginType = o.enums === String ? $root.proto.BotPluginMetadata.PluginType[m.parentPluginType] === undefined ? m.parentPluginType : $root.proto.BotPluginMetadata.PluginType[m.parentPluginType] : m.parentPluginType;
                if (o.oneofs)
                    d._parentPluginType = "parentPluginType";
            }
            if (m.faviconCdnUrl != null && m.hasOwnProperty("faviconCdnUrl")) {
                d.faviconCdnUrl = m.faviconCdnUrl;
                if (o.oneofs)
                    d._faviconCdnUrl = "faviconCdnUrl";
            }
            return d;
        };

        BotPluginMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotPluginMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotPluginMetadata";
        };

        BotPluginMetadata.PluginType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_PLUGIN"] = 0;
            values[valuesById[1] = "REELS"] = 1;
            values[valuesById[2] = "SEARCH"] = 2;
            return values;
        })();

        BotPluginMetadata.SearchProvider = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "BING"] = 1;
            values[valuesById[2] = "GOOGLE"] = 2;
            values[valuesById[3] = "SUPPORT"] = 3;
            return values;
        })();

        return BotPluginMetadata;
    })();

    proto.BotProgressIndicatorMetadata = (function() {

        function BotProgressIndicatorMetadata(p) {
            this.stepsMetadata = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotProgressIndicatorMetadata.prototype.progressDescription = null;
        BotProgressIndicatorMetadata.prototype.stepsMetadata = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotProgressIndicatorMetadata.prototype, "_progressDescription", {
            get: $util.oneOfGetter($oneOfFields = ["progressDescription"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotProgressIndicatorMetadata.create = function create(properties) {
            return new BotProgressIndicatorMetadata(properties);
        };

        BotProgressIndicatorMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.progressDescription != null && Object.hasOwnProperty.call(m, "progressDescription"))
                w.uint32(10).string(m.progressDescription);
            if (m.stepsMetadata != null && m.stepsMetadata.length) {
                for (var i = 0; i < m.stepsMetadata.length; ++i)
                    $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.encode(m.stepsMetadata[i], w.uint32(18).fork()).ldelim();
            }
            return w;
        };

        BotProgressIndicatorMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotProgressIndicatorMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.progressDescription = r.string();
                        break;
                    }
                case 2: {
                        if (!(m.stepsMetadata && m.stepsMetadata.length))
                            m.stepsMetadata = [];
                        m.stepsMetadata.push($root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotProgressIndicatorMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotProgressIndicatorMetadata)
                return d;
            var m = new $root.proto.BotProgressIndicatorMetadata();
            if (d.progressDescription != null) {
                m.progressDescription = String(d.progressDescription);
            }
            if (d.stepsMetadata) {
                if (!Array.isArray(d.stepsMetadata))
                    throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: array expected");
                m.stepsMetadata = [];
                for (var i = 0; i < d.stepsMetadata.length; ++i) {
                    if (typeof d.stepsMetadata[i] !== "object")
                        throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: object expected");
                    m.stepsMetadata[i] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.fromObject(d.stepsMetadata[i]);
                }
            }
            return m;
        };

        BotProgressIndicatorMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.stepsMetadata = [];
            }
            if (m.progressDescription != null && m.hasOwnProperty("progressDescription")) {
                d.progressDescription = m.progressDescription;
                if (o.oneofs)
                    d._progressDescription = "progressDescription";
            }
            if (m.stepsMetadata && m.stepsMetadata.length) {
                d.stepsMetadata = [];
                for (var j = 0; j < m.stepsMetadata.length; ++j) {
                    d.stepsMetadata[j] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.toObject(m.stepsMetadata[j], o);
                }
            }
            return d;
        };

        BotProgressIndicatorMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotProgressIndicatorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotProgressIndicatorMetadata";
        };

        BotProgressIndicatorMetadata.BotPlanningStepMetadata = (function() {

            function BotPlanningStepMetadata(p) {
                this.sourcesMetadata = [];
                this.sections = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BotPlanningStepMetadata.prototype.statusTitle = null;
            BotPlanningStepMetadata.prototype.statusBody = null;
            BotPlanningStepMetadata.prototype.sourcesMetadata = $util.emptyArray;
            BotPlanningStepMetadata.prototype.status = null;
            BotPlanningStepMetadata.prototype.isReasoning = null;
            BotPlanningStepMetadata.prototype.isEnhancedSearch = null;
            BotPlanningStepMetadata.prototype.sections = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotPlanningStepMetadata.prototype, "_statusTitle", {
                get: $util.oneOfGetter($oneOfFields = ["statusTitle"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotPlanningStepMetadata.prototype, "_statusBody", {
                get: $util.oneOfGetter($oneOfFields = ["statusBody"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotPlanningStepMetadata.prototype, "_status", {
                get: $util.oneOfGetter($oneOfFields = ["status"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotPlanningStepMetadata.prototype, "_isReasoning", {
                get: $util.oneOfGetter($oneOfFields = ["isReasoning"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotPlanningStepMetadata.prototype, "_isEnhancedSearch", {
                get: $util.oneOfGetter($oneOfFields = ["isEnhancedSearch"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BotPlanningStepMetadata.create = function create(properties) {
                return new BotPlanningStepMetadata(properties);
            };

            BotPlanningStepMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.statusTitle != null && Object.hasOwnProperty.call(m, "statusTitle"))
                    w.uint32(10).string(m.statusTitle);
                if (m.statusBody != null && Object.hasOwnProperty.call(m, "statusBody"))
                    w.uint32(18).string(m.statusBody);
                if (m.sourcesMetadata != null && m.sourcesMetadata.length) {
                    for (var i = 0; i < m.sourcesMetadata.length; ++i)
                        $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.encode(m.sourcesMetadata[i], w.uint32(26).fork()).ldelim();
                }
                if (m.status != null && Object.hasOwnProperty.call(m, "status"))
                    w.uint32(32).int32(m.status);
                if (m.isReasoning != null && Object.hasOwnProperty.call(m, "isReasoning"))
                    w.uint32(40).bool(m.isReasoning);
                if (m.isEnhancedSearch != null && Object.hasOwnProperty.call(m, "isEnhancedSearch"))
                    w.uint32(48).bool(m.isEnhancedSearch);
                if (m.sections != null && m.sections.length) {
                    for (var i = 0; i < m.sections.length; ++i)
                        $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.encode(m.sections[i], w.uint32(58).fork()).ldelim();
                }
                return w;
            };

            BotPlanningStepMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.statusTitle = r.string();
                            break;
                        }
                    case 2: {
                            m.statusBody = r.string();
                            break;
                        }
                    case 3: {
                            if (!(m.sourcesMetadata && m.sourcesMetadata.length))
                                m.sourcesMetadata = [];
                            m.sourcesMetadata.push($root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.decode(r, r.uint32()));
                            break;
                        }
                    case 4: {
                            m.status = r.int32();
                            break;
                        }
                    case 5: {
                            m.isReasoning = r.bool();
                            break;
                        }
                    case 6: {
                            m.isEnhancedSearch = r.bool();
                            break;
                        }
                    case 7: {
                            if (!(m.sections && m.sections.length))
                                m.sections = [];
                            m.sections.push($root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BotPlanningStepMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata)
                    return d;
                var m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata();
                if (d.statusTitle != null) {
                    m.statusTitle = String(d.statusTitle);
                }
                if (d.statusBody != null) {
                    m.statusBody = String(d.statusBody);
                }
                if (d.sourcesMetadata) {
                    if (!Array.isArray(d.sourcesMetadata))
                        throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: array expected");
                    m.sourcesMetadata = [];
                    for (var i = 0; i < d.sourcesMetadata.length; ++i) {
                        if (typeof d.sourcesMetadata[i] !== "object")
                            throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: object expected");
                        m.sourcesMetadata[i] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.fromObject(d.sourcesMetadata[i]);
                    }
                }
                switch (d.status) {
                default:
                    if (typeof d.status === "number") {
                        m.status = d.status;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.status = 0;
                    break;
                case "PLANNED":
                case 1:
                    m.status = 1;
                    break;
                case "EXECUTING":
                case 2:
                    m.status = 2;
                    break;
                case "FINISHED":
                case 3:
                    m.status = 3;
                    break;
                }
                if (d.isReasoning != null) {
                    m.isReasoning = Boolean(d.isReasoning);
                }
                if (d.isEnhancedSearch != null) {
                    m.isEnhancedSearch = Boolean(d.isEnhancedSearch);
                }
                if (d.sections) {
                    if (!Array.isArray(d.sections))
                        throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sections: array expected");
                    m.sections = [];
                    for (var i = 0; i < d.sections.length; ++i) {
                        if (typeof d.sections[i] !== "object")
                            throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sections: object expected");
                        m.sections[i] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.fromObject(d.sections[i]);
                    }
                }
                return m;
            };

            BotPlanningStepMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.sourcesMetadata = [];
                    d.sections = [];
                }
                if (m.statusTitle != null && m.hasOwnProperty("statusTitle")) {
                    d.statusTitle = m.statusTitle;
                    if (o.oneofs)
                        d._statusTitle = "statusTitle";
                }
                if (m.statusBody != null && m.hasOwnProperty("statusBody")) {
                    d.statusBody = m.statusBody;
                    if (o.oneofs)
                        d._statusBody = "statusBody";
                }
                if (m.sourcesMetadata && m.sourcesMetadata.length) {
                    d.sourcesMetadata = [];
                    for (var j = 0; j < m.sourcesMetadata.length; ++j) {
                        d.sourcesMetadata[j] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.toObject(m.sourcesMetadata[j], o);
                    }
                }
                if (m.status != null && m.hasOwnProperty("status")) {
                    d.status = o.enums === String ? $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.PlanningStepStatus[m.status] === undefined ? m.status : $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.PlanningStepStatus[m.status] : m.status;
                    if (o.oneofs)
                        d._status = "status";
                }
                if (m.isReasoning != null && m.hasOwnProperty("isReasoning")) {
                    d.isReasoning = m.isReasoning;
                    if (o.oneofs)
                        d._isReasoning = "isReasoning";
                }
                if (m.isEnhancedSearch != null && m.hasOwnProperty("isEnhancedSearch")) {
                    d.isEnhancedSearch = m.isEnhancedSearch;
                    if (o.oneofs)
                        d._isEnhancedSearch = "isEnhancedSearch";
                }
                if (m.sections && m.sections.length) {
                    d.sections = [];
                    for (var j = 0; j < m.sections.length; ++j) {
                        d.sections[j] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.toObject(m.sections[j], o);
                    }
                }
                return d;
            };

            BotPlanningStepMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BotPlanningStepMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata";
            };

            BotPlanningStepMetadata.BotPlanningSearchSourceMetadata = (function() {

                function BotPlanningSearchSourceMetadata(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                BotPlanningSearchSourceMetadata.prototype.title = null;
                BotPlanningSearchSourceMetadata.prototype.provider = null;
                BotPlanningSearchSourceMetadata.prototype.sourceUrl = null;
                BotPlanningSearchSourceMetadata.prototype.favIconUrl = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningSearchSourceMetadata.prototype, "_title", {
                    get: $util.oneOfGetter($oneOfFields = ["title"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningSearchSourceMetadata.prototype, "_provider", {
                    get: $util.oneOfGetter($oneOfFields = ["provider"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningSearchSourceMetadata.prototype, "_sourceUrl", {
                    get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningSearchSourceMetadata.prototype, "_favIconUrl", {
                    get: $util.oneOfGetter($oneOfFields = ["favIconUrl"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                BotPlanningSearchSourceMetadata.create = function create(properties) {
                    return new BotPlanningSearchSourceMetadata(properties);
                };

                BotPlanningSearchSourceMetadata.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                        w.uint32(10).string(m.title);
                    if (m.provider != null && Object.hasOwnProperty.call(m, "provider"))
                        w.uint32(16).int32(m.provider);
                    if (m.sourceUrl != null && Object.hasOwnProperty.call(m, "sourceUrl"))
                        w.uint32(26).string(m.sourceUrl);
                    if (m.favIconUrl != null && Object.hasOwnProperty.call(m, "favIconUrl"))
                        w.uint32(34).string(m.favIconUrl);
                    return w;
                };

                BotPlanningSearchSourceMetadata.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.title = r.string();
                                break;
                            }
                        case 2: {
                                m.provider = r.int32();
                                break;
                            }
                        case 3: {
                                m.sourceUrl = r.string();
                                break;
                            }
                        case 4: {
                                m.favIconUrl = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                BotPlanningSearchSourceMetadata.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata)
                        return d;
                    var m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata();
                    if (d.title != null) {
                        m.title = String(d.title);
                    }
                    switch (d.provider) {
                    default:
                        if (typeof d.provider === "number") {
                            m.provider = d.provider;
                            break;
                        }
                        break;
                    case "UNKNOWN_PROVIDER":
                    case 0:
                        m.provider = 0;
                        break;
                    case "OTHER":
                    case 1:
                        m.provider = 1;
                        break;
                    case "GOOGLE":
                    case 2:
                        m.provider = 2;
                        break;
                    case "BING":
                    case 3:
                        m.provider = 3;
                        break;
                    }
                    if (d.sourceUrl != null) {
                        m.sourceUrl = String(d.sourceUrl);
                    }
                    if (d.favIconUrl != null) {
                        m.favIconUrl = String(d.favIconUrl);
                    }
                    return m;
                };

                BotPlanningSearchSourceMetadata.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.title != null && m.hasOwnProperty("title")) {
                        d.title = m.title;
                        if (o.oneofs)
                            d._title = "title";
                    }
                    if (m.provider != null && m.hasOwnProperty("provider")) {
                        d.provider = o.enums === String ? $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[m.provider] === undefined ? m.provider : $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[m.provider] : m.provider;
                        if (o.oneofs)
                            d._provider = "provider";
                    }
                    if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) {
                        d.sourceUrl = m.sourceUrl;
                        if (o.oneofs)
                            d._sourceUrl = "sourceUrl";
                    }
                    if (m.favIconUrl != null && m.hasOwnProperty("favIconUrl")) {
                        d.favIconUrl = m.favIconUrl;
                        if (o.oneofs)
                            d._favIconUrl = "favIconUrl";
                    }
                    return d;
                };

                BotPlanningSearchSourceMetadata.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                BotPlanningSearchSourceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata";
                };

                return BotPlanningSearchSourceMetadata;
            })();

            BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata = (function() {

                function BotPlanningSearchSourcesMetadata(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                BotPlanningSearchSourcesMetadata.prototype.sourceTitle = null;
                BotPlanningSearchSourcesMetadata.prototype.provider = null;
                BotPlanningSearchSourcesMetadata.prototype.sourceUrl = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningSearchSourcesMetadata.prototype, "_sourceTitle", {
                    get: $util.oneOfGetter($oneOfFields = ["sourceTitle"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningSearchSourcesMetadata.prototype, "_provider", {
                    get: $util.oneOfGetter($oneOfFields = ["provider"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningSearchSourcesMetadata.prototype, "_sourceUrl", {
                    get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                BotPlanningSearchSourcesMetadata.create = function create(properties) {
                    return new BotPlanningSearchSourcesMetadata(properties);
                };

                BotPlanningSearchSourcesMetadata.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.sourceTitle != null && Object.hasOwnProperty.call(m, "sourceTitle"))
                        w.uint32(10).string(m.sourceTitle);
                    if (m.provider != null && Object.hasOwnProperty.call(m, "provider"))
                        w.uint32(16).int32(m.provider);
                    if (m.sourceUrl != null && Object.hasOwnProperty.call(m, "sourceUrl"))
                        w.uint32(26).string(m.sourceUrl);
                    return w;
                };

                BotPlanningSearchSourcesMetadata.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.sourceTitle = r.string();
                                break;
                            }
                        case 2: {
                                m.provider = r.int32();
                                break;
                            }
                        case 3: {
                                m.sourceUrl = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                BotPlanningSearchSourcesMetadata.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata)
                        return d;
                    var m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata();
                    if (d.sourceTitle != null) {
                        m.sourceTitle = String(d.sourceTitle);
                    }
                    switch (d.provider) {
                    default:
                        if (typeof d.provider === "number") {
                            m.provider = d.provider;
                            break;
                        }
                        break;
                    case "UNKNOWN":
                    case 0:
                        m.provider = 0;
                        break;
                    case "OTHER":
                    case 1:
                        m.provider = 1;
                        break;
                    case "GOOGLE":
                    case 2:
                        m.provider = 2;
                        break;
                    case "BING":
                    case 3:
                        m.provider = 3;
                        break;
                    }
                    if (d.sourceUrl != null) {
                        m.sourceUrl = String(d.sourceUrl);
                    }
                    return m;
                };

                BotPlanningSearchSourcesMetadata.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.sourceTitle != null && m.hasOwnProperty("sourceTitle")) {
                        d.sourceTitle = m.sourceTitle;
                        if (o.oneofs)
                            d._sourceTitle = "sourceTitle";
                    }
                    if (m.provider != null && m.hasOwnProperty("provider")) {
                        d.provider = o.enums === String ? $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[m.provider] === undefined ? m.provider : $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[m.provider] : m.provider;
                        if (o.oneofs)
                            d._provider = "provider";
                    }
                    if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) {
                        d.sourceUrl = m.sourceUrl;
                        if (o.oneofs)
                            d._sourceUrl = "sourceUrl";
                    }
                    return d;
                };

                BotPlanningSearchSourcesMetadata.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                BotPlanningSearchSourcesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata";
                };

                BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "UNKNOWN"] = 0;
                    values[valuesById[1] = "OTHER"] = 1;
                    values[valuesById[2] = "GOOGLE"] = 2;
                    values[valuesById[3] = "BING"] = 3;
                    return values;
                })();

                return BotPlanningSearchSourcesMetadata;
            })();

            BotPlanningStepMetadata.BotPlanningStepSectionMetadata = (function() {

                function BotPlanningStepSectionMetadata(p) {
                    this.sourcesMetadata = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                BotPlanningStepSectionMetadata.prototype.sectionTitle = null;
                BotPlanningStepSectionMetadata.prototype.sectionBody = null;
                BotPlanningStepSectionMetadata.prototype.sourcesMetadata = $util.emptyArray;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningStepSectionMetadata.prototype, "_sectionTitle", {
                    get: $util.oneOfGetter($oneOfFields = ["sectionTitle"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(BotPlanningStepSectionMetadata.prototype, "_sectionBody", {
                    get: $util.oneOfGetter($oneOfFields = ["sectionBody"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                BotPlanningStepSectionMetadata.create = function create(properties) {
                    return new BotPlanningStepSectionMetadata(properties);
                };

                BotPlanningStepSectionMetadata.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.sectionTitle != null && Object.hasOwnProperty.call(m, "sectionTitle"))
                        w.uint32(10).string(m.sectionTitle);
                    if (m.sectionBody != null && Object.hasOwnProperty.call(m, "sectionBody"))
                        w.uint32(18).string(m.sectionBody);
                    if (m.sourcesMetadata != null && m.sourcesMetadata.length) {
                        for (var i = 0; i < m.sourcesMetadata.length; ++i)
                            $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.encode(m.sourcesMetadata[i], w.uint32(26).fork()).ldelim();
                    }
                    return w;
                };

                BotPlanningStepSectionMetadata.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.sectionTitle = r.string();
                                break;
                            }
                        case 2: {
                                m.sectionBody = r.string();
                                break;
                            }
                        case 3: {
                                if (!(m.sourcesMetadata && m.sourcesMetadata.length))
                                    m.sourcesMetadata = [];
                                m.sourcesMetadata.push($root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.decode(r, r.uint32()));
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                BotPlanningStepSectionMetadata.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata)
                        return d;
                    var m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata();
                    if (d.sectionTitle != null) {
                        m.sectionTitle = String(d.sectionTitle);
                    }
                    if (d.sectionBody != null) {
                        m.sectionBody = String(d.sectionBody);
                    }
                    if (d.sourcesMetadata) {
                        if (!Array.isArray(d.sourcesMetadata))
                            throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: array expected");
                        m.sourcesMetadata = [];
                        for (var i = 0; i < d.sourcesMetadata.length; ++i) {
                            if (typeof d.sourcesMetadata[i] !== "object")
                                throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: object expected");
                            m.sourcesMetadata[i] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.fromObject(d.sourcesMetadata[i]);
                        }
                    }
                    return m;
                };

                BotPlanningStepSectionMetadata.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.sourcesMetadata = [];
                    }
                    if (m.sectionTitle != null && m.hasOwnProperty("sectionTitle")) {
                        d.sectionTitle = m.sectionTitle;
                        if (o.oneofs)
                            d._sectionTitle = "sectionTitle";
                    }
                    if (m.sectionBody != null && m.hasOwnProperty("sectionBody")) {
                        d.sectionBody = m.sectionBody;
                        if (o.oneofs)
                            d._sectionBody = "sectionBody";
                    }
                    if (m.sourcesMetadata && m.sourcesMetadata.length) {
                        d.sourcesMetadata = [];
                        for (var j = 0; j < m.sourcesMetadata.length; ++j) {
                            d.sourcesMetadata[j] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.toObject(m.sourcesMetadata[j], o);
                        }
                    }
                    return d;
                };

                BotPlanningStepSectionMetadata.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                BotPlanningStepSectionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata";
                };

                return BotPlanningStepSectionMetadata;
            })();

            BotPlanningStepMetadata.BotSearchSourceProvider = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN_PROVIDER"] = 0;
                values[valuesById[1] = "OTHER"] = 1;
                values[valuesById[2] = "GOOGLE"] = 2;
                values[valuesById[3] = "BING"] = 3;
                return values;
            })();

            BotPlanningStepMetadata.PlanningStepStatus = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "PLANNED"] = 1;
                values[valuesById[2] = "EXECUTING"] = 2;
                values[valuesById[3] = "FINISHED"] = 3;
                return values;
            })();

            return BotPlanningStepMetadata;
        })();

        return BotProgressIndicatorMetadata;
    })();

    proto.BotPromotionMessageMetadata = (function() {

        function BotPromotionMessageMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotPromotionMessageMetadata.prototype.promotionType = null;
        BotPromotionMessageMetadata.prototype.buttonTitle = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPromotionMessageMetadata.prototype, "_promotionType", {
            get: $util.oneOfGetter($oneOfFields = ["promotionType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPromotionMessageMetadata.prototype, "_buttonTitle", {
            get: $util.oneOfGetter($oneOfFields = ["buttonTitle"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotPromotionMessageMetadata.create = function create(properties) {
            return new BotPromotionMessageMetadata(properties);
        };

        BotPromotionMessageMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.promotionType != null && Object.hasOwnProperty.call(m, "promotionType"))
                w.uint32(8).int32(m.promotionType);
            if (m.buttonTitle != null && Object.hasOwnProperty.call(m, "buttonTitle"))
                w.uint32(18).string(m.buttonTitle);
            return w;
        };

        BotPromotionMessageMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotPromotionMessageMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.promotionType = r.int32();
                        break;
                    }
                case 2: {
                        m.buttonTitle = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotPromotionMessageMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotPromotionMessageMetadata)
                return d;
            var m = new $root.proto.BotPromotionMessageMetadata();
            switch (d.promotionType) {
            default:
                if (typeof d.promotionType === "number") {
                    m.promotionType = d.promotionType;
                    break;
                }
                break;
            case "UNKNOWN_TYPE":
            case 0:
                m.promotionType = 0;
                break;
            case "C50":
            case 1:
                m.promotionType = 1;
                break;
            case "SURVEY_PLATFORM":
            case 2:
                m.promotionType = 2;
                break;
            }
            if (d.buttonTitle != null) {
                m.buttonTitle = String(d.buttonTitle);
            }
            return m;
        };

        BotPromotionMessageMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.promotionType != null && m.hasOwnProperty("promotionType")) {
                d.promotionType = o.enums === String ? $root.proto.BotPromotionMessageMetadata.BotPromotionType[m.promotionType] === undefined ? m.promotionType : $root.proto.BotPromotionMessageMetadata.BotPromotionType[m.promotionType] : m.promotionType;
                if (o.oneofs)
                    d._promotionType = "promotionType";
            }
            if (m.buttonTitle != null && m.hasOwnProperty("buttonTitle")) {
                d.buttonTitle = m.buttonTitle;
                if (o.oneofs)
                    d._buttonTitle = "buttonTitle";
            }
            return d;
        };

        BotPromotionMessageMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotPromotionMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotPromotionMessageMetadata";
        };

        BotPromotionMessageMetadata.BotPromotionType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_TYPE"] = 0;
            values[valuesById[1] = "C50"] = 1;
            values[valuesById[2] = "SURVEY_PLATFORM"] = 2;
            return values;
        })();

        return BotPromotionMessageMetadata;
    })();

    proto.BotPromptSuggestion = (function() {

        function BotPromptSuggestion(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotPromptSuggestion.prototype.prompt = null;
        BotPromptSuggestion.prototype.promptId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPromptSuggestion.prototype, "_prompt", {
            get: $util.oneOfGetter($oneOfFields = ["prompt"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotPromptSuggestion.prototype, "_promptId", {
            get: $util.oneOfGetter($oneOfFields = ["promptId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotPromptSuggestion.create = function create(properties) {
            return new BotPromptSuggestion(properties);
        };

        BotPromptSuggestion.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.prompt != null && Object.hasOwnProperty.call(m, "prompt"))
                w.uint32(10).string(m.prompt);
            if (m.promptId != null && Object.hasOwnProperty.call(m, "promptId"))
                w.uint32(18).string(m.promptId);
            return w;
        };

        BotPromptSuggestion.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotPromptSuggestion();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.prompt = r.string();
                        break;
                    }
                case 2: {
                        m.promptId = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotPromptSuggestion.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotPromptSuggestion)
                return d;
            var m = new $root.proto.BotPromptSuggestion();
            if (d.prompt != null) {
                m.prompt = String(d.prompt);
            }
            if (d.promptId != null) {
                m.promptId = String(d.promptId);
            }
            return m;
        };

        BotPromptSuggestion.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.prompt != null && m.hasOwnProperty("prompt")) {
                d.prompt = m.prompt;
                if (o.oneofs)
                    d._prompt = "prompt";
            }
            if (m.promptId != null && m.hasOwnProperty("promptId")) {
                d.promptId = m.promptId;
                if (o.oneofs)
                    d._promptId = "promptId";
            }
            return d;
        };

        BotPromptSuggestion.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotPromptSuggestion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotPromptSuggestion";
        };

        return BotPromptSuggestion;
    })();

    proto.BotPromptSuggestions = (function() {

        function BotPromptSuggestions(p) {
            this.suggestions = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotPromptSuggestions.prototype.suggestions = $util.emptyArray;

        BotPromptSuggestions.create = function create(properties) {
            return new BotPromptSuggestions(properties);
        };

        BotPromptSuggestions.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.suggestions != null && m.suggestions.length) {
                for (var i = 0; i < m.suggestions.length; ++i)
                    $root.proto.BotPromptSuggestion.encode(m.suggestions[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        BotPromptSuggestions.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotPromptSuggestions();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.suggestions && m.suggestions.length))
                            m.suggestions = [];
                        m.suggestions.push($root.proto.BotPromptSuggestion.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotPromptSuggestions.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotPromptSuggestions)
                return d;
            var m = new $root.proto.BotPromptSuggestions();
            if (d.suggestions) {
                if (!Array.isArray(d.suggestions))
                    throw TypeError(".proto.BotPromptSuggestions.suggestions: array expected");
                m.suggestions = [];
                for (var i = 0; i < d.suggestions.length; ++i) {
                    if (typeof d.suggestions[i] !== "object")
                        throw TypeError(".proto.BotPromptSuggestions.suggestions: object expected");
                    m.suggestions[i] = $root.proto.BotPromptSuggestion.fromObject(d.suggestions[i]);
                }
            }
            return m;
        };

        BotPromptSuggestions.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.suggestions = [];
            }
            if (m.suggestions && m.suggestions.length) {
                d.suggestions = [];
                for (var j = 0; j < m.suggestions.length; ++j) {
                    d.suggestions[j] = $root.proto.BotPromptSuggestion.toObject(m.suggestions[j], o);
                }
            }
            return d;
        };

        BotPromptSuggestions.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotPromptSuggestions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotPromptSuggestions";
        };

        return BotPromptSuggestions;
    })();

    proto.BotQuotaMetadata = (function() {

        function BotQuotaMetadata(p) {
            this.botFeatureQuotaMetadata = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotQuotaMetadata.prototype.botFeatureQuotaMetadata = $util.emptyArray;

        BotQuotaMetadata.create = function create(properties) {
            return new BotQuotaMetadata(properties);
        };

        BotQuotaMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.botFeatureQuotaMetadata != null && m.botFeatureQuotaMetadata.length) {
                for (var i = 0; i < m.botFeatureQuotaMetadata.length; ++i)
                    $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.encode(m.botFeatureQuotaMetadata[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        BotQuotaMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotQuotaMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.botFeatureQuotaMetadata && m.botFeatureQuotaMetadata.length))
                            m.botFeatureQuotaMetadata = [];
                        m.botFeatureQuotaMetadata.push($root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotQuotaMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotQuotaMetadata)
                return d;
            var m = new $root.proto.BotQuotaMetadata();
            if (d.botFeatureQuotaMetadata) {
                if (!Array.isArray(d.botFeatureQuotaMetadata))
                    throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: array expected");
                m.botFeatureQuotaMetadata = [];
                for (var i = 0; i < d.botFeatureQuotaMetadata.length; ++i) {
                    if (typeof d.botFeatureQuotaMetadata[i] !== "object")
                        throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: object expected");
                    m.botFeatureQuotaMetadata[i] = $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.fromObject(d.botFeatureQuotaMetadata[i]);
                }
            }
            return m;
        };

        BotQuotaMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.botFeatureQuotaMetadata = [];
            }
            if (m.botFeatureQuotaMetadata && m.botFeatureQuotaMetadata.length) {
                d.botFeatureQuotaMetadata = [];
                for (var j = 0; j < m.botFeatureQuotaMetadata.length; ++j) {
                    d.botFeatureQuotaMetadata[j] = $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.toObject(m.botFeatureQuotaMetadata[j], o);
                }
            }
            return d;
        };

        BotQuotaMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotQuotaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotQuotaMetadata";
        };

        BotQuotaMetadata.BotFeatureQuotaMetadata = (function() {

            function BotFeatureQuotaMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BotFeatureQuotaMetadata.prototype.featureType = null;
            BotFeatureQuotaMetadata.prototype.remainingQuota = null;
            BotFeatureQuotaMetadata.prototype.expirationTimestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotFeatureQuotaMetadata.prototype, "_featureType", {
                get: $util.oneOfGetter($oneOfFields = ["featureType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotFeatureQuotaMetadata.prototype, "_remainingQuota", {
                get: $util.oneOfGetter($oneOfFields = ["remainingQuota"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotFeatureQuotaMetadata.prototype, "_expirationTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["expirationTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BotFeatureQuotaMetadata.create = function create(properties) {
                return new BotFeatureQuotaMetadata(properties);
            };

            BotFeatureQuotaMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.featureType != null && Object.hasOwnProperty.call(m, "featureType"))
                    w.uint32(8).int32(m.featureType);
                if (m.remainingQuota != null && Object.hasOwnProperty.call(m, "remainingQuota"))
                    w.uint32(16).uint32(m.remainingQuota);
                if (m.expirationTimestamp != null && Object.hasOwnProperty.call(m, "expirationTimestamp"))
                    w.uint32(24).uint64(m.expirationTimestamp);
                return w;
            };

            BotFeatureQuotaMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.featureType = r.int32();
                            break;
                        }
                    case 2: {
                            m.remainingQuota = r.uint32();
                            break;
                        }
                    case 3: {
                            m.expirationTimestamp = r.uint64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BotFeatureQuotaMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata)
                    return d;
                var m = new $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata();
                switch (d.featureType) {
                default:
                    if (typeof d.featureType === "number") {
                        m.featureType = d.featureType;
                        break;
                    }
                    break;
                case "UNKNOWN_FEATURE":
                case 0:
                    m.featureType = 0;
                    break;
                case "REASONING_FEATURE":
                case 1:
                    m.featureType = 1;
                    break;
                }
                if (d.remainingQuota != null) {
                    m.remainingQuota = d.remainingQuota >>> 0;
                }
                if (d.expirationTimestamp != null) {
                    if ($util.Long)
                        (m.expirationTimestamp = $util.Long.fromValue(d.expirationTimestamp)).unsigned = true;
                    else if (typeof d.expirationTimestamp === "string")
                        m.expirationTimestamp = parseInt(d.expirationTimestamp, 10);
                    else if (typeof d.expirationTimestamp === "number")
                        m.expirationTimestamp = d.expirationTimestamp;
                    else if (typeof d.expirationTimestamp === "object")
                        m.expirationTimestamp = new $util.LongBits(d.expirationTimestamp.low >>> 0, d.expirationTimestamp.high >>> 0).toNumber(true);
                }
                return m;
            };

            BotFeatureQuotaMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.featureType != null && m.hasOwnProperty("featureType")) {
                    d.featureType = o.enums === String ? $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[m.featureType] === undefined ? m.featureType : $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[m.featureType] : m.featureType;
                    if (o.oneofs)
                        d._featureType = "featureType";
                }
                if (m.remainingQuota != null && m.hasOwnProperty("remainingQuota")) {
                    d.remainingQuota = m.remainingQuota;
                    if (o.oneofs)
                        d._remainingQuota = "remainingQuota";
                }
                if (m.expirationTimestamp != null && m.hasOwnProperty("expirationTimestamp")) {
                    if (typeof m.expirationTimestamp === "number")
                        d.expirationTimestamp = o.longs === String ? String(m.expirationTimestamp) : m.expirationTimestamp;
                    else
                        d.expirationTimestamp = o.longs === String ? longToString(m.expirationTimestamp, true) : o.longs === Number ? longToNumber(m.expirationTimestamp, true) : m.expirationTimestamp;
                    if (o.oneofs)
                        d._expirationTimestamp = "expirationTimestamp";
                }
                return d;
            };

            BotFeatureQuotaMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BotFeatureQuotaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.BotQuotaMetadata.BotFeatureQuotaMetadata";
            };

            BotFeatureQuotaMetadata.BotFeatureType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN_FEATURE"] = 0;
                values[valuesById[1] = "REASONING_FEATURE"] = 1;
                return values;
            })();

            return BotFeatureQuotaMetadata;
        })();

        return BotQuotaMetadata;
    })();

    proto.BotReminderMetadata = (function() {

        function BotReminderMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotReminderMetadata.prototype.requestMessageKey = null;
        BotReminderMetadata.prototype.action = null;
        BotReminderMetadata.prototype.name = null;
        BotReminderMetadata.prototype.nextTriggerTimestamp = null;
        BotReminderMetadata.prototype.frequency = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotReminderMetadata.prototype, "_requestMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["requestMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotReminderMetadata.prototype, "_action", {
            get: $util.oneOfGetter($oneOfFields = ["action"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotReminderMetadata.prototype, "_name", {
            get: $util.oneOfGetter($oneOfFields = ["name"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotReminderMetadata.prototype, "_nextTriggerTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["nextTriggerTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotReminderMetadata.prototype, "_frequency", {
            get: $util.oneOfGetter($oneOfFields = ["frequency"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotReminderMetadata.create = function create(properties) {
            return new BotReminderMetadata(properties);
        };

        BotReminderMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.requestMessageKey != null && Object.hasOwnProperty.call(m, "requestMessageKey"))
                $root.proto.MessageKey.encode(m.requestMessageKey, w.uint32(10).fork()).ldelim();
            if (m.action != null && Object.hasOwnProperty.call(m, "action"))
                w.uint32(16).int32(m.action);
            if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                w.uint32(26).string(m.name);
            if (m.nextTriggerTimestamp != null && Object.hasOwnProperty.call(m, "nextTriggerTimestamp"))
                w.uint32(32).uint64(m.nextTriggerTimestamp);
            if (m.frequency != null && Object.hasOwnProperty.call(m, "frequency"))
                w.uint32(40).int32(m.frequency);
            return w;
        };

        BotReminderMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotReminderMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.requestMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.action = r.int32();
                        break;
                    }
                case 3: {
                        m.name = r.string();
                        break;
                    }
                case 4: {
                        m.nextTriggerTimestamp = r.uint64();
                        break;
                    }
                case 5: {
                        m.frequency = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotReminderMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotReminderMetadata)
                return d;
            var m = new $root.proto.BotReminderMetadata();
            if (d.requestMessageKey != null) {
                if (typeof d.requestMessageKey !== "object")
                    throw TypeError(".proto.BotReminderMetadata.requestMessageKey: object expected");
                m.requestMessageKey = $root.proto.MessageKey.fromObject(d.requestMessageKey);
            }
            switch (d.action) {
            default:
                if (typeof d.action === "number") {
                    m.action = d.action;
                    break;
                }
                break;
            case "NOTIFY":
            case 1:
                m.action = 1;
                break;
            case "CREATE":
            case 2:
                m.action = 2;
                break;
            case "DELETE":
            case 3:
                m.action = 3;
                break;
            case "UPDATE":
            case 4:
                m.action = 4;
                break;
            }
            if (d.name != null) {
                m.name = String(d.name);
            }
            if (d.nextTriggerTimestamp != null) {
                if ($util.Long)
                    (m.nextTriggerTimestamp = $util.Long.fromValue(d.nextTriggerTimestamp)).unsigned = true;
                else if (typeof d.nextTriggerTimestamp === "string")
                    m.nextTriggerTimestamp = parseInt(d.nextTriggerTimestamp, 10);
                else if (typeof d.nextTriggerTimestamp === "number")
                    m.nextTriggerTimestamp = d.nextTriggerTimestamp;
                else if (typeof d.nextTriggerTimestamp === "object")
                    m.nextTriggerTimestamp = new $util.LongBits(d.nextTriggerTimestamp.low >>> 0, d.nextTriggerTimestamp.high >>> 0).toNumber(true);
            }
            switch (d.frequency) {
            default:
                if (typeof d.frequency === "number") {
                    m.frequency = d.frequency;
                    break;
                }
                break;
            case "ONCE":
            case 1:
                m.frequency = 1;
                break;
            case "DAILY":
            case 2:
                m.frequency = 2;
                break;
            case "WEEKLY":
            case 3:
                m.frequency = 3;
                break;
            case "BIWEEKLY":
            case 4:
                m.frequency = 4;
                break;
            case "MONTHLY":
            case 5:
                m.frequency = 5;
                break;
            }
            return m;
        };

        BotReminderMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.requestMessageKey != null && m.hasOwnProperty("requestMessageKey")) {
                d.requestMessageKey = $root.proto.MessageKey.toObject(m.requestMessageKey, o);
                if (o.oneofs)
                    d._requestMessageKey = "requestMessageKey";
            }
            if (m.action != null && m.hasOwnProperty("action")) {
                d.action = o.enums === String ? $root.proto.BotReminderMetadata.ReminderAction[m.action] === undefined ? m.action : $root.proto.BotReminderMetadata.ReminderAction[m.action] : m.action;
                if (o.oneofs)
                    d._action = "action";
            }
            if (m.name != null && m.hasOwnProperty("name")) {
                d.name = m.name;
                if (o.oneofs)
                    d._name = "name";
            }
            if (m.nextTriggerTimestamp != null && m.hasOwnProperty("nextTriggerTimestamp")) {
                if (typeof m.nextTriggerTimestamp === "number")
                    d.nextTriggerTimestamp = o.longs === String ? String(m.nextTriggerTimestamp) : m.nextTriggerTimestamp;
                else
                    d.nextTriggerTimestamp = o.longs === String ? longToString(m.nextTriggerTimestamp, true) : o.longs === Number ? longToNumber(m.nextTriggerTimestamp, true) : m.nextTriggerTimestamp;
                if (o.oneofs)
                    d._nextTriggerTimestamp = "nextTriggerTimestamp";
            }
            if (m.frequency != null && m.hasOwnProperty("frequency")) {
                d.frequency = o.enums === String ? $root.proto.BotReminderMetadata.ReminderFrequency[m.frequency] === undefined ? m.frequency : $root.proto.BotReminderMetadata.ReminderFrequency[m.frequency] : m.frequency;
                if (o.oneofs)
                    d._frequency = "frequency";
            }
            return d;
        };

        BotReminderMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotReminderMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotReminderMetadata";
        };

        BotReminderMetadata.ReminderAction = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[1] = "NOTIFY"] = 1;
            values[valuesById[2] = "CREATE"] = 2;
            values[valuesById[3] = "DELETE"] = 3;
            values[valuesById[4] = "UPDATE"] = 4;
            return values;
        })();

        BotReminderMetadata.ReminderFrequency = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[1] = "ONCE"] = 1;
            values[valuesById[2] = "DAILY"] = 2;
            values[valuesById[3] = "WEEKLY"] = 3;
            values[valuesById[4] = "BIWEEKLY"] = 4;
            values[valuesById[5] = "MONTHLY"] = 5;
            return values;
        })();

        return BotReminderMetadata;
    })();

    proto.BotRenderingMetadata = (function() {

        function BotRenderingMetadata(p) {
            this.keywords = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotRenderingMetadata.prototype.keywords = $util.emptyArray;

        BotRenderingMetadata.create = function create(properties) {
            return new BotRenderingMetadata(properties);
        };

        BotRenderingMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.keywords != null && m.keywords.length) {
                for (var i = 0; i < m.keywords.length; ++i)
                    $root.proto.BotRenderingMetadata.Keyword.encode(m.keywords[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        BotRenderingMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotRenderingMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.keywords && m.keywords.length))
                            m.keywords = [];
                        m.keywords.push($root.proto.BotRenderingMetadata.Keyword.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotRenderingMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotRenderingMetadata)
                return d;
            var m = new $root.proto.BotRenderingMetadata();
            if (d.keywords) {
                if (!Array.isArray(d.keywords))
                    throw TypeError(".proto.BotRenderingMetadata.keywords: array expected");
                m.keywords = [];
                for (var i = 0; i < d.keywords.length; ++i) {
                    if (typeof d.keywords[i] !== "object")
                        throw TypeError(".proto.BotRenderingMetadata.keywords: object expected");
                    m.keywords[i] = $root.proto.BotRenderingMetadata.Keyword.fromObject(d.keywords[i]);
                }
            }
            return m;
        };

        BotRenderingMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.keywords = [];
            }
            if (m.keywords && m.keywords.length) {
                d.keywords = [];
                for (var j = 0; j < m.keywords.length; ++j) {
                    d.keywords[j] = $root.proto.BotRenderingMetadata.Keyword.toObject(m.keywords[j], o);
                }
            }
            return d;
        };

        BotRenderingMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotRenderingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotRenderingMetadata";
        };

        BotRenderingMetadata.Keyword = (function() {

            function Keyword(p) {
                this.associatedPrompts = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            Keyword.prototype.value = null;
            Keyword.prototype.associatedPrompts = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Keyword.prototype, "_value", {
                get: $util.oneOfGetter($oneOfFields = ["value"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Keyword.create = function create(properties) {
                return new Keyword(properties);
            };

            Keyword.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.value != null && Object.hasOwnProperty.call(m, "value"))
                    w.uint32(10).string(m.value);
                if (m.associatedPrompts != null && m.associatedPrompts.length) {
                    for (var i = 0; i < m.associatedPrompts.length; ++i)
                        w.uint32(18).string(m.associatedPrompts[i]);
                }
                return w;
            };

            Keyword.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotRenderingMetadata.Keyword();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.value = r.string();
                            break;
                        }
                    case 2: {
                            if (!(m.associatedPrompts && m.associatedPrompts.length))
                                m.associatedPrompts = [];
                            m.associatedPrompts.push(r.string());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            Keyword.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.BotRenderingMetadata.Keyword)
                    return d;
                var m = new $root.proto.BotRenderingMetadata.Keyword();
                if (d.value != null) {
                    m.value = String(d.value);
                }
                if (d.associatedPrompts) {
                    if (!Array.isArray(d.associatedPrompts))
                        throw TypeError(".proto.BotRenderingMetadata.Keyword.associatedPrompts: array expected");
                    m.associatedPrompts = [];
                    for (var i = 0; i < d.associatedPrompts.length; ++i) {
                        m.associatedPrompts[i] = String(d.associatedPrompts[i]);
                    }
                }
                return m;
            };

            Keyword.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.associatedPrompts = [];
                }
                if (m.value != null && m.hasOwnProperty("value")) {
                    d.value = m.value;
                    if (o.oneofs)
                        d._value = "value";
                }
                if (m.associatedPrompts && m.associatedPrompts.length) {
                    d.associatedPrompts = [];
                    for (var j = 0; j < m.associatedPrompts.length; ++j) {
                        d.associatedPrompts[j] = m.associatedPrompts[j];
                    }
                }
                return d;
            };

            Keyword.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            Keyword.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.BotRenderingMetadata.Keyword";
            };

            return Keyword;
        })();

        return BotRenderingMetadata;
    })();

    proto.BotSessionMetadata = (function() {

        function BotSessionMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotSessionMetadata.prototype.sessionId = null;
        BotSessionMetadata.prototype.sessionSource = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotSessionMetadata.prototype, "_sessionId", {
            get: $util.oneOfGetter($oneOfFields = ["sessionId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotSessionMetadata.prototype, "_sessionSource", {
            get: $util.oneOfGetter($oneOfFields = ["sessionSource"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotSessionMetadata.create = function create(properties) {
            return new BotSessionMetadata(properties);
        };

        BotSessionMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.sessionId != null && Object.hasOwnProperty.call(m, "sessionId"))
                w.uint32(10).string(m.sessionId);
            if (m.sessionSource != null && Object.hasOwnProperty.call(m, "sessionSource"))
                w.uint32(16).int32(m.sessionSource);
            return w;
        };

        BotSessionMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotSessionMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.sessionId = r.string();
                        break;
                    }
                case 2: {
                        m.sessionSource = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotSessionMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotSessionMetadata)
                return d;
            var m = new $root.proto.BotSessionMetadata();
            if (d.sessionId != null) {
                m.sessionId = String(d.sessionId);
            }
            switch (d.sessionSource) {
            default:
                if (typeof d.sessionSource === "number") {
                    m.sessionSource = d.sessionSource;
                    break;
                }
                break;
            case "NONE":
            case 0:
                m.sessionSource = 0;
                break;
            case "NULL_STATE":
            case 1:
                m.sessionSource = 1;
                break;
            case "TYPEAHEAD":
            case 2:
                m.sessionSource = 2;
                break;
            case "USER_INPUT":
            case 3:
                m.sessionSource = 3;
                break;
            case "EMU_FLASH":
            case 4:
                m.sessionSource = 4;
                break;
            case "EMU_FLASH_FOLLOWUP":
            case 5:
                m.sessionSource = 5;
                break;
            case "VOICE":
            case 6:
                m.sessionSource = 6;
                break;
            }
            return m;
        };

        BotSessionMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.sessionId != null && m.hasOwnProperty("sessionId")) {
                d.sessionId = m.sessionId;
                if (o.oneofs)
                    d._sessionId = "sessionId";
            }
            if (m.sessionSource != null && m.hasOwnProperty("sessionSource")) {
                d.sessionSource = o.enums === String ? $root.proto.BotSessionSource[m.sessionSource] === undefined ? m.sessionSource : $root.proto.BotSessionSource[m.sessionSource] : m.sessionSource;
                if (o.oneofs)
                    d._sessionSource = "sessionSource";
            }
            return d;
        };

        BotSessionMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotSessionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotSessionMetadata";
        };

        return BotSessionMetadata;
    })();

    proto.BotSessionSource = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "NONE"] = 0;
        values[valuesById[1] = "NULL_STATE"] = 1;
        values[valuesById[2] = "TYPEAHEAD"] = 2;
        values[valuesById[3] = "USER_INPUT"] = 3;
        values[valuesById[4] = "EMU_FLASH"] = 4;
        values[valuesById[5] = "EMU_FLASH_FOLLOWUP"] = 5;
        values[valuesById[6] = "VOICE"] = 6;
        return values;
    })();

    proto.BotSignatureVerificationMetadata = (function() {

        function BotSignatureVerificationMetadata(p) {
            this.proofs = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotSignatureVerificationMetadata.prototype.proofs = $util.emptyArray;

        BotSignatureVerificationMetadata.create = function create(properties) {
            return new BotSignatureVerificationMetadata(properties);
        };

        BotSignatureVerificationMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.proofs != null && m.proofs.length) {
                for (var i = 0; i < m.proofs.length; ++i)
                    $root.proto.BotSignatureVerificationUseCaseProof.encode(m.proofs[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        BotSignatureVerificationMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotSignatureVerificationMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.proofs && m.proofs.length))
                            m.proofs = [];
                        m.proofs.push($root.proto.BotSignatureVerificationUseCaseProof.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotSignatureVerificationMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotSignatureVerificationMetadata)
                return d;
            var m = new $root.proto.BotSignatureVerificationMetadata();
            if (d.proofs) {
                if (!Array.isArray(d.proofs))
                    throw TypeError(".proto.BotSignatureVerificationMetadata.proofs: array expected");
                m.proofs = [];
                for (var i = 0; i < d.proofs.length; ++i) {
                    if (typeof d.proofs[i] !== "object")
                        throw TypeError(".proto.BotSignatureVerificationMetadata.proofs: object expected");
                    m.proofs[i] = $root.proto.BotSignatureVerificationUseCaseProof.fromObject(d.proofs[i]);
                }
            }
            return m;
        };

        BotSignatureVerificationMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.proofs = [];
            }
            if (m.proofs && m.proofs.length) {
                d.proofs = [];
                for (var j = 0; j < m.proofs.length; ++j) {
                    d.proofs[j] = $root.proto.BotSignatureVerificationUseCaseProof.toObject(m.proofs[j], o);
                }
            }
            return d;
        };

        BotSignatureVerificationMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotSignatureVerificationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotSignatureVerificationMetadata";
        };

        return BotSignatureVerificationMetadata;
    })();

    proto.BotSignatureVerificationUseCaseProof = (function() {

        function BotSignatureVerificationUseCaseProof(p) {
            this.certificateChain = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotSignatureVerificationUseCaseProof.prototype.version = null;
        BotSignatureVerificationUseCaseProof.prototype.useCase = null;
        BotSignatureVerificationUseCaseProof.prototype.signature = null;
        BotSignatureVerificationUseCaseProof.prototype.certificateChain = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotSignatureVerificationUseCaseProof.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotSignatureVerificationUseCaseProof.prototype, "_useCase", {
            get: $util.oneOfGetter($oneOfFields = ["useCase"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotSignatureVerificationUseCaseProof.prototype, "_signature", {
            get: $util.oneOfGetter($oneOfFields = ["signature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotSignatureVerificationUseCaseProof.create = function create(properties) {
            return new BotSignatureVerificationUseCaseProof(properties);
        };

        BotSignatureVerificationUseCaseProof.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                w.uint32(8).int32(m.version);
            if (m.useCase != null && Object.hasOwnProperty.call(m, "useCase"))
                w.uint32(16).int32(m.useCase);
            if (m.signature != null && Object.hasOwnProperty.call(m, "signature"))
                w.uint32(26).bytes(m.signature);
            if (m.certificateChain != null && m.certificateChain.length) {
                for (var i = 0; i < m.certificateChain.length; ++i)
                    w.uint32(34).bytes(m.certificateChain[i]);
            }
            return w;
        };

        BotSignatureVerificationUseCaseProof.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotSignatureVerificationUseCaseProof();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.version = r.int32();
                        break;
                    }
                case 2: {
                        m.useCase = r.int32();
                        break;
                    }
                case 3: {
                        m.signature = r.bytes();
                        break;
                    }
                case 4: {
                        if (!(m.certificateChain && m.certificateChain.length))
                            m.certificateChain = [];
                        m.certificateChain.push(r.bytes());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotSignatureVerificationUseCaseProof.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotSignatureVerificationUseCaseProof)
                return d;
            var m = new $root.proto.BotSignatureVerificationUseCaseProof();
            if (d.version != null) {
                m.version = d.version | 0;
            }
            switch (d.useCase) {
            default:
                if (typeof d.useCase === "number") {
                    m.useCase = d.useCase;
                    break;
                }
                break;
            case "UNSPECIFIED":
            case 0:
                m.useCase = 0;
                break;
            case "WA_BOT_MSG":
            case 1:
                m.useCase = 1;
                break;
            }
            if (d.signature != null) {
                if (typeof d.signature === "string")
                    $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0);
                else if (d.signature.length >= 0)
                    m.signature = d.signature;
            }
            if (d.certificateChain) {
                if (!Array.isArray(d.certificateChain))
                    throw TypeError(".proto.BotSignatureVerificationUseCaseProof.certificateChain: array expected");
                m.certificateChain = [];
                for (var i = 0; i < d.certificateChain.length; ++i) {
                    if (typeof d.certificateChain[i] === "string")
                        $util.base64.decode(d.certificateChain[i], m.certificateChain[i] = $util.newBuffer($util.base64.length(d.certificateChain[i])), 0);
                    else if (d.certificateChain[i].length >= 0)
                        m.certificateChain[i] = d.certificateChain[i];
                }
            }
            return m;
        };

        BotSignatureVerificationUseCaseProof.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.certificateChain = [];
            }
            if (m.version != null && m.hasOwnProperty("version")) {
                d.version = m.version;
                if (o.oneofs)
                    d._version = "version";
            }
            if (m.useCase != null && m.hasOwnProperty("useCase")) {
                d.useCase = o.enums === String ? $root.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[m.useCase] === undefined ? m.useCase : $root.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[m.useCase] : m.useCase;
                if (o.oneofs)
                    d._useCase = "useCase";
            }
            if (m.signature != null && m.hasOwnProperty("signature")) {
                d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature;
                if (o.oneofs)
                    d._signature = "signature";
            }
            if (m.certificateChain && m.certificateChain.length) {
                d.certificateChain = [];
                for (var j = 0; j < m.certificateChain.length; ++j) {
                    d.certificateChain[j] = o.bytes === String ? $util.base64.encode(m.certificateChain[j], 0, m.certificateChain[j].length) : o.bytes === Array ? Array.prototype.slice.call(m.certificateChain[j]) : m.certificateChain[j];
                }
            }
            return d;
        };

        BotSignatureVerificationUseCaseProof.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotSignatureVerificationUseCaseProof.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotSignatureVerificationUseCaseProof";
        };

        BotSignatureVerificationUseCaseProof.BotSignatureUseCase = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNSPECIFIED"] = 0;
            values[valuesById[1] = "WA_BOT_MSG"] = 1;
            return values;
        })();

        return BotSignatureVerificationUseCaseProof;
    })();

    proto.BotSourcesMetadata = (function() {

        function BotSourcesMetadata(p) {
            this.sources = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotSourcesMetadata.prototype.sources = $util.emptyArray;

        BotSourcesMetadata.create = function create(properties) {
            return new BotSourcesMetadata(properties);
        };

        BotSourcesMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.sources != null && m.sources.length) {
                for (var i = 0; i < m.sources.length; ++i)
                    $root.proto.BotSourcesMetadata.BotSourceItem.encode(m.sources[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        BotSourcesMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotSourcesMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.sources && m.sources.length))
                            m.sources = [];
                        m.sources.push($root.proto.BotSourcesMetadata.BotSourceItem.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotSourcesMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotSourcesMetadata)
                return d;
            var m = new $root.proto.BotSourcesMetadata();
            if (d.sources) {
                if (!Array.isArray(d.sources))
                    throw TypeError(".proto.BotSourcesMetadata.sources: array expected");
                m.sources = [];
                for (var i = 0; i < d.sources.length; ++i) {
                    if (typeof d.sources[i] !== "object")
                        throw TypeError(".proto.BotSourcesMetadata.sources: object expected");
                    m.sources[i] = $root.proto.BotSourcesMetadata.BotSourceItem.fromObject(d.sources[i]);
                }
            }
            return m;
        };

        BotSourcesMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.sources = [];
            }
            if (m.sources && m.sources.length) {
                d.sources = [];
                for (var j = 0; j < m.sources.length; ++j) {
                    d.sources[j] = $root.proto.BotSourcesMetadata.BotSourceItem.toObject(m.sources[j], o);
                }
            }
            return d;
        };

        BotSourcesMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotSourcesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotSourcesMetadata";
        };

        BotSourcesMetadata.BotSourceItem = (function() {

            function BotSourceItem(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BotSourceItem.prototype.provider = null;
            BotSourceItem.prototype.thumbnailCdnUrl = null;
            BotSourceItem.prototype.sourceProviderUrl = null;
            BotSourceItem.prototype.sourceQuery = null;
            BotSourceItem.prototype.faviconCdnUrl = null;
            BotSourceItem.prototype.citationNumber = null;
            BotSourceItem.prototype.sourceTitle = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotSourceItem.prototype, "_provider", {
                get: $util.oneOfGetter($oneOfFields = ["provider"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotSourceItem.prototype, "_thumbnailCdnUrl", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailCdnUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotSourceItem.prototype, "_sourceProviderUrl", {
                get: $util.oneOfGetter($oneOfFields = ["sourceProviderUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotSourceItem.prototype, "_sourceQuery", {
                get: $util.oneOfGetter($oneOfFields = ["sourceQuery"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotSourceItem.prototype, "_faviconCdnUrl", {
                get: $util.oneOfGetter($oneOfFields = ["faviconCdnUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotSourceItem.prototype, "_citationNumber", {
                get: $util.oneOfGetter($oneOfFields = ["citationNumber"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotSourceItem.prototype, "_sourceTitle", {
                get: $util.oneOfGetter($oneOfFields = ["sourceTitle"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BotSourceItem.create = function create(properties) {
                return new BotSourceItem(properties);
            };

            BotSourceItem.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.provider != null && Object.hasOwnProperty.call(m, "provider"))
                    w.uint32(8).int32(m.provider);
                if (m.thumbnailCdnUrl != null && Object.hasOwnProperty.call(m, "thumbnailCdnUrl"))
                    w.uint32(18).string(m.thumbnailCdnUrl);
                if (m.sourceProviderUrl != null && Object.hasOwnProperty.call(m, "sourceProviderUrl"))
                    w.uint32(26).string(m.sourceProviderUrl);
                if (m.sourceQuery != null && Object.hasOwnProperty.call(m, "sourceQuery"))
                    w.uint32(34).string(m.sourceQuery);
                if (m.faviconCdnUrl != null && Object.hasOwnProperty.call(m, "faviconCdnUrl"))
                    w.uint32(42).string(m.faviconCdnUrl);
                if (m.citationNumber != null && Object.hasOwnProperty.call(m, "citationNumber"))
                    w.uint32(48).uint32(m.citationNumber);
                if (m.sourceTitle != null && Object.hasOwnProperty.call(m, "sourceTitle"))
                    w.uint32(58).string(m.sourceTitle);
                return w;
            };

            BotSourceItem.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotSourcesMetadata.BotSourceItem();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.provider = r.int32();
                            break;
                        }
                    case 2: {
                            m.thumbnailCdnUrl = r.string();
                            break;
                        }
                    case 3: {
                            m.sourceProviderUrl = r.string();
                            break;
                        }
                    case 4: {
                            m.sourceQuery = r.string();
                            break;
                        }
                    case 5: {
                            m.faviconCdnUrl = r.string();
                            break;
                        }
                    case 6: {
                            m.citationNumber = r.uint32();
                            break;
                        }
                    case 7: {
                            m.sourceTitle = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BotSourceItem.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.BotSourcesMetadata.BotSourceItem)
                    return d;
                var m = new $root.proto.BotSourcesMetadata.BotSourceItem();
                switch (d.provider) {
                default:
                    if (typeof d.provider === "number") {
                        m.provider = d.provider;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.provider = 0;
                    break;
                case "BING":
                case 1:
                    m.provider = 1;
                    break;
                case "GOOGLE":
                case 2:
                    m.provider = 2;
                    break;
                case "SUPPORT":
                case 3:
                    m.provider = 3;
                    break;
                case "OTHER":
                case 4:
                    m.provider = 4;
                    break;
                }
                if (d.thumbnailCdnUrl != null) {
                    m.thumbnailCdnUrl = String(d.thumbnailCdnUrl);
                }
                if (d.sourceProviderUrl != null) {
                    m.sourceProviderUrl = String(d.sourceProviderUrl);
                }
                if (d.sourceQuery != null) {
                    m.sourceQuery = String(d.sourceQuery);
                }
                if (d.faviconCdnUrl != null) {
                    m.faviconCdnUrl = String(d.faviconCdnUrl);
                }
                if (d.citationNumber != null) {
                    m.citationNumber = d.citationNumber >>> 0;
                }
                if (d.sourceTitle != null) {
                    m.sourceTitle = String(d.sourceTitle);
                }
                return m;
            };

            BotSourceItem.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.provider != null && m.hasOwnProperty("provider")) {
                    d.provider = o.enums === String ? $root.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[m.provider] === undefined ? m.provider : $root.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[m.provider] : m.provider;
                    if (o.oneofs)
                        d._provider = "provider";
                }
                if (m.thumbnailCdnUrl != null && m.hasOwnProperty("thumbnailCdnUrl")) {
                    d.thumbnailCdnUrl = m.thumbnailCdnUrl;
                    if (o.oneofs)
                        d._thumbnailCdnUrl = "thumbnailCdnUrl";
                }
                if (m.sourceProviderUrl != null && m.hasOwnProperty("sourceProviderUrl")) {
                    d.sourceProviderUrl = m.sourceProviderUrl;
                    if (o.oneofs)
                        d._sourceProviderUrl = "sourceProviderUrl";
                }
                if (m.sourceQuery != null && m.hasOwnProperty("sourceQuery")) {
                    d.sourceQuery = m.sourceQuery;
                    if (o.oneofs)
                        d._sourceQuery = "sourceQuery";
                }
                if (m.faviconCdnUrl != null && m.hasOwnProperty("faviconCdnUrl")) {
                    d.faviconCdnUrl = m.faviconCdnUrl;
                    if (o.oneofs)
                        d._faviconCdnUrl = "faviconCdnUrl";
                }
                if (m.citationNumber != null && m.hasOwnProperty("citationNumber")) {
                    d.citationNumber = m.citationNumber;
                    if (o.oneofs)
                        d._citationNumber = "citationNumber";
                }
                if (m.sourceTitle != null && m.hasOwnProperty("sourceTitle")) {
                    d.sourceTitle = m.sourceTitle;
                    if (o.oneofs)
                        d._sourceTitle = "sourceTitle";
                }
                return d;
            };

            BotSourceItem.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BotSourceItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.BotSourcesMetadata.BotSourceItem";
            };

            BotSourceItem.SourceProvider = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "BING"] = 1;
                values[valuesById[2] = "GOOGLE"] = 2;
                values[valuesById[3] = "SUPPORT"] = 3;
                values[valuesById[4] = "OTHER"] = 4;
                return values;
            })();

            return BotSourceItem;
        })();

        return BotSourcesMetadata;
    })();

    proto.BotSuggestedPromptMetadata = (function() {

        function BotSuggestedPromptMetadata(p) {
            this.suggestedPrompts = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotSuggestedPromptMetadata.prototype.suggestedPrompts = $util.emptyArray;
        BotSuggestedPromptMetadata.prototype.selectedPromptIndex = null;
        BotSuggestedPromptMetadata.prototype.promptSuggestions = null;
        BotSuggestedPromptMetadata.prototype.selectedPromptId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotSuggestedPromptMetadata.prototype, "_selectedPromptIndex", {
            get: $util.oneOfGetter($oneOfFields = ["selectedPromptIndex"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotSuggestedPromptMetadata.prototype, "_promptSuggestions", {
            get: $util.oneOfGetter($oneOfFields = ["promptSuggestions"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotSuggestedPromptMetadata.prototype, "_selectedPromptId", {
            get: $util.oneOfGetter($oneOfFields = ["selectedPromptId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotSuggestedPromptMetadata.create = function create(properties) {
            return new BotSuggestedPromptMetadata(properties);
        };

        BotSuggestedPromptMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.suggestedPrompts != null && m.suggestedPrompts.length) {
                for (var i = 0; i < m.suggestedPrompts.length; ++i)
                    w.uint32(10).string(m.suggestedPrompts[i]);
            }
            if (m.selectedPromptIndex != null && Object.hasOwnProperty.call(m, "selectedPromptIndex"))
                w.uint32(16).uint32(m.selectedPromptIndex);
            if (m.promptSuggestions != null && Object.hasOwnProperty.call(m, "promptSuggestions"))
                $root.proto.BotPromptSuggestions.encode(m.promptSuggestions, w.uint32(26).fork()).ldelim();
            if (m.selectedPromptId != null && Object.hasOwnProperty.call(m, "selectedPromptId"))
                w.uint32(34).string(m.selectedPromptId);
            return w;
        };

        BotSuggestedPromptMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotSuggestedPromptMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.suggestedPrompts && m.suggestedPrompts.length))
                            m.suggestedPrompts = [];
                        m.suggestedPrompts.push(r.string());
                        break;
                    }
                case 2: {
                        m.selectedPromptIndex = r.uint32();
                        break;
                    }
                case 3: {
                        m.promptSuggestions = $root.proto.BotPromptSuggestions.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.selectedPromptId = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotSuggestedPromptMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotSuggestedPromptMetadata)
                return d;
            var m = new $root.proto.BotSuggestedPromptMetadata();
            if (d.suggestedPrompts) {
                if (!Array.isArray(d.suggestedPrompts))
                    throw TypeError(".proto.BotSuggestedPromptMetadata.suggestedPrompts: array expected");
                m.suggestedPrompts = [];
                for (var i = 0; i < d.suggestedPrompts.length; ++i) {
                    m.suggestedPrompts[i] = String(d.suggestedPrompts[i]);
                }
            }
            if (d.selectedPromptIndex != null) {
                m.selectedPromptIndex = d.selectedPromptIndex >>> 0;
            }
            if (d.promptSuggestions != null) {
                if (typeof d.promptSuggestions !== "object")
                    throw TypeError(".proto.BotSuggestedPromptMetadata.promptSuggestions: object expected");
                m.promptSuggestions = $root.proto.BotPromptSuggestions.fromObject(d.promptSuggestions);
            }
            if (d.selectedPromptId != null) {
                m.selectedPromptId = String(d.selectedPromptId);
            }
            return m;
        };

        BotSuggestedPromptMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.suggestedPrompts = [];
            }
            if (m.suggestedPrompts && m.suggestedPrompts.length) {
                d.suggestedPrompts = [];
                for (var j = 0; j < m.suggestedPrompts.length; ++j) {
                    d.suggestedPrompts[j] = m.suggestedPrompts[j];
                }
            }
            if (m.selectedPromptIndex != null && m.hasOwnProperty("selectedPromptIndex")) {
                d.selectedPromptIndex = m.selectedPromptIndex;
                if (o.oneofs)
                    d._selectedPromptIndex = "selectedPromptIndex";
            }
            if (m.promptSuggestions != null && m.hasOwnProperty("promptSuggestions")) {
                d.promptSuggestions = $root.proto.BotPromptSuggestions.toObject(m.promptSuggestions, o);
                if (o.oneofs)
                    d._promptSuggestions = "promptSuggestions";
            }
            if (m.selectedPromptId != null && m.hasOwnProperty("selectedPromptId")) {
                d.selectedPromptId = m.selectedPromptId;
                if (o.oneofs)
                    d._selectedPromptId = "selectedPromptId";
            }
            return d;
        };

        BotSuggestedPromptMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotSuggestedPromptMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotSuggestedPromptMetadata";
        };

        return BotSuggestedPromptMetadata;
    })();

    proto.BotUnifiedResponseMutation = (function() {

        function BotUnifiedResponseMutation(p) {
            this.mediaDetailsMetadataList = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        BotUnifiedResponseMutation.prototype.sbsMetadata = null;
        BotUnifiedResponseMutation.prototype.mediaDetailsMetadataList = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(BotUnifiedResponseMutation.prototype, "_sbsMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["sbsMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        BotUnifiedResponseMutation.create = function create(properties) {
            return new BotUnifiedResponseMutation(properties);
        };

        BotUnifiedResponseMutation.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.sbsMetadata != null && Object.hasOwnProperty.call(m, "sbsMetadata"))
                $root.proto.BotUnifiedResponseMutation.SideBySideMetadata.encode(m.sbsMetadata, w.uint32(10).fork()).ldelim();
            if (m.mediaDetailsMetadataList != null && m.mediaDetailsMetadataList.length) {
                for (var i = 0; i < m.mediaDetailsMetadataList.length; ++i)
                    $root.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.encode(m.mediaDetailsMetadataList[i], w.uint32(18).fork()).ldelim();
            }
            return w;
        };

        BotUnifiedResponseMutation.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotUnifiedResponseMutation();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.sbsMetadata = $root.proto.BotUnifiedResponseMutation.SideBySideMetadata.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        if (!(m.mediaDetailsMetadataList && m.mediaDetailsMetadataList.length))
                            m.mediaDetailsMetadataList = [];
                        m.mediaDetailsMetadataList.push($root.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        BotUnifiedResponseMutation.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.BotUnifiedResponseMutation)
                return d;
            var m = new $root.proto.BotUnifiedResponseMutation();
            if (d.sbsMetadata != null) {
                if (typeof d.sbsMetadata !== "object")
                    throw TypeError(".proto.BotUnifiedResponseMutation.sbsMetadata: object expected");
                m.sbsMetadata = $root.proto.BotUnifiedResponseMutation.SideBySideMetadata.fromObject(d.sbsMetadata);
            }
            if (d.mediaDetailsMetadataList) {
                if (!Array.isArray(d.mediaDetailsMetadataList))
                    throw TypeError(".proto.BotUnifiedResponseMutation.mediaDetailsMetadataList: array expected");
                m.mediaDetailsMetadataList = [];
                for (var i = 0; i < d.mediaDetailsMetadataList.length; ++i) {
                    if (typeof d.mediaDetailsMetadataList[i] !== "object")
                        throw TypeError(".proto.BotUnifiedResponseMutation.mediaDetailsMetadataList: object expected");
                    m.mediaDetailsMetadataList[i] = $root.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.fromObject(d.mediaDetailsMetadataList[i]);
                }
            }
            return m;
        };

        BotUnifiedResponseMutation.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.mediaDetailsMetadataList = [];
            }
            if (m.sbsMetadata != null && m.hasOwnProperty("sbsMetadata")) {
                d.sbsMetadata = $root.proto.BotUnifiedResponseMutation.SideBySideMetadata.toObject(m.sbsMetadata, o);
                if (o.oneofs)
                    d._sbsMetadata = "sbsMetadata";
            }
            if (m.mediaDetailsMetadataList && m.mediaDetailsMetadataList.length) {
                d.mediaDetailsMetadataList = [];
                for (var j = 0; j < m.mediaDetailsMetadataList.length; ++j) {
                    d.mediaDetailsMetadataList[j] = $root.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.toObject(m.mediaDetailsMetadataList[j], o);
                }
            }
            return d;
        };

        BotUnifiedResponseMutation.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        BotUnifiedResponseMutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.BotUnifiedResponseMutation";
        };

        BotUnifiedResponseMutation.MediaDetailsMetadata = (function() {

            function MediaDetailsMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MediaDetailsMetadata.prototype.id = null;
            MediaDetailsMetadata.prototype.highResMedia = null;
            MediaDetailsMetadata.prototype.previewMedia = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MediaDetailsMetadata.prototype, "_id", {
                get: $util.oneOfGetter($oneOfFields = ["id"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MediaDetailsMetadata.prototype, "_highResMedia", {
                get: $util.oneOfGetter($oneOfFields = ["highResMedia"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MediaDetailsMetadata.prototype, "_previewMedia", {
                get: $util.oneOfGetter($oneOfFields = ["previewMedia"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MediaDetailsMetadata.create = function create(properties) {
                return new MediaDetailsMetadata(properties);
            };

            MediaDetailsMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                    w.uint32(10).string(m.id);
                if (m.highResMedia != null && Object.hasOwnProperty.call(m, "highResMedia"))
                    $root.proto.BotMediaMetadata.encode(m.highResMedia, w.uint32(18).fork()).ldelim();
                if (m.previewMedia != null && Object.hasOwnProperty.call(m, "previewMedia"))
                    $root.proto.BotMediaMetadata.encode(m.previewMedia, w.uint32(26).fork()).ldelim();
                return w;
            };

            MediaDetailsMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotUnifiedResponseMutation.MediaDetailsMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.id = r.string();
                            break;
                        }
                    case 2: {
                            m.highResMedia = $root.proto.BotMediaMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.previewMedia = $root.proto.BotMediaMetadata.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MediaDetailsMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.BotUnifiedResponseMutation.MediaDetailsMetadata)
                    return d;
                var m = new $root.proto.BotUnifiedResponseMutation.MediaDetailsMetadata();
                if (d.id != null) {
                    m.id = String(d.id);
                }
                if (d.highResMedia != null) {
                    if (typeof d.highResMedia !== "object")
                        throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.highResMedia: object expected");
                    m.highResMedia = $root.proto.BotMediaMetadata.fromObject(d.highResMedia);
                }
                if (d.previewMedia != null) {
                    if (typeof d.previewMedia !== "object")
                        throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.previewMedia: object expected");
                    m.previewMedia = $root.proto.BotMediaMetadata.fromObject(d.previewMedia);
                }
                return m;
            };

            MediaDetailsMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.id != null && m.hasOwnProperty("id")) {
                    d.id = m.id;
                    if (o.oneofs)
                        d._id = "id";
                }
                if (m.highResMedia != null && m.hasOwnProperty("highResMedia")) {
                    d.highResMedia = $root.proto.BotMediaMetadata.toObject(m.highResMedia, o);
                    if (o.oneofs)
                        d._highResMedia = "highResMedia";
                }
                if (m.previewMedia != null && m.hasOwnProperty("previewMedia")) {
                    d.previewMedia = $root.proto.BotMediaMetadata.toObject(m.previewMedia, o);
                    if (o.oneofs)
                        d._previewMedia = "previewMedia";
                }
                return d;
            };

            MediaDetailsMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MediaDetailsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.BotUnifiedResponseMutation.MediaDetailsMetadata";
            };

            return MediaDetailsMetadata;
        })();

        BotUnifiedResponseMutation.SideBySideMetadata = (function() {

            function SideBySideMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SideBySideMetadata.prototype.primaryResponseId = null;
            SideBySideMetadata.prototype.surveyCtaHasRendered = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideMetadata.prototype, "_primaryResponseId", {
                get: $util.oneOfGetter($oneOfFields = ["primaryResponseId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SideBySideMetadata.prototype, "_surveyCtaHasRendered", {
                get: $util.oneOfGetter($oneOfFields = ["surveyCtaHasRendered"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SideBySideMetadata.create = function create(properties) {
                return new SideBySideMetadata(properties);
            };

            SideBySideMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.primaryResponseId != null && Object.hasOwnProperty.call(m, "primaryResponseId"))
                    w.uint32(10).string(m.primaryResponseId);
                if (m.surveyCtaHasRendered != null && Object.hasOwnProperty.call(m, "surveyCtaHasRendered"))
                    w.uint32(16).bool(m.surveyCtaHasRendered);
                return w;
            };

            SideBySideMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotUnifiedResponseMutation.SideBySideMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.primaryResponseId = r.string();
                            break;
                        }
                    case 2: {
                            m.surveyCtaHasRendered = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SideBySideMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.BotUnifiedResponseMutation.SideBySideMetadata)
                    return d;
                var m = new $root.proto.BotUnifiedResponseMutation.SideBySideMetadata();
                if (d.primaryResponseId != null) {
                    m.primaryResponseId = String(d.primaryResponseId);
                }
                if (d.surveyCtaHasRendered != null) {
                    m.surveyCtaHasRendered = Boolean(d.surveyCtaHasRendered);
                }
                return m;
            };

            SideBySideMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.primaryResponseId != null && m.hasOwnProperty("primaryResponseId")) {
                    d.primaryResponseId = m.primaryResponseId;
                    if (o.oneofs)
                        d._primaryResponseId = "primaryResponseId";
                }
                if (m.surveyCtaHasRendered != null && m.hasOwnProperty("surveyCtaHasRendered")) {
                    d.surveyCtaHasRendered = m.surveyCtaHasRendered;
                    if (o.oneofs)
                        d._surveyCtaHasRendered = "surveyCtaHasRendered";
                }
                return d;
            };

            SideBySideMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SideBySideMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.BotUnifiedResponseMutation.SideBySideMetadata";
            };

            return SideBySideMetadata;
        })();

        return BotUnifiedResponseMutation;
    })();

    proto.CallLogRecord = (function() {

        function CallLogRecord(p) {
            this.participants = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        CallLogRecord.prototype.callResult = null;
        CallLogRecord.prototype.isDndMode = null;
        CallLogRecord.prototype.silenceReason = null;
        CallLogRecord.prototype.duration = null;
        CallLogRecord.prototype.startTime = null;
        CallLogRecord.prototype.isIncoming = null;
        CallLogRecord.prototype.isVideo = null;
        CallLogRecord.prototype.isCallLink = null;
        CallLogRecord.prototype.callLinkToken = null;
        CallLogRecord.prototype.scheduledCallId = null;
        CallLogRecord.prototype.callId = null;
        CallLogRecord.prototype.callCreatorJid = null;
        CallLogRecord.prototype.groupJid = null;
        CallLogRecord.prototype.participants = $util.emptyArray;
        CallLogRecord.prototype.callType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_callResult", {
            get: $util.oneOfGetter($oneOfFields = ["callResult"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_isDndMode", {
            get: $util.oneOfGetter($oneOfFields = ["isDndMode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_silenceReason", {
            get: $util.oneOfGetter($oneOfFields = ["silenceReason"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_duration", {
            get: $util.oneOfGetter($oneOfFields = ["duration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_startTime", {
            get: $util.oneOfGetter($oneOfFields = ["startTime"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_isIncoming", {
            get: $util.oneOfGetter($oneOfFields = ["isIncoming"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_isVideo", {
            get: $util.oneOfGetter($oneOfFields = ["isVideo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_isCallLink", {
            get: $util.oneOfGetter($oneOfFields = ["isCallLink"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_callLinkToken", {
            get: $util.oneOfGetter($oneOfFields = ["callLinkToken"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_scheduledCallId", {
            get: $util.oneOfGetter($oneOfFields = ["scheduledCallId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_callId", {
            get: $util.oneOfGetter($oneOfFields = ["callId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_callCreatorJid", {
            get: $util.oneOfGetter($oneOfFields = ["callCreatorJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_groupJid", {
            get: $util.oneOfGetter($oneOfFields = ["groupJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CallLogRecord.prototype, "_callType", {
            get: $util.oneOfGetter($oneOfFields = ["callType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        CallLogRecord.create = function create(properties) {
            return new CallLogRecord(properties);
        };

        CallLogRecord.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.callResult != null && Object.hasOwnProperty.call(m, "callResult"))
                w.uint32(8).int32(m.callResult);
            if (m.isDndMode != null && Object.hasOwnProperty.call(m, "isDndMode"))
                w.uint32(16).bool(m.isDndMode);
            if (m.silenceReason != null && Object.hasOwnProperty.call(m, "silenceReason"))
                w.uint32(24).int32(m.silenceReason);
            if (m.duration != null && Object.hasOwnProperty.call(m, "duration"))
                w.uint32(32).int64(m.duration);
            if (m.startTime != null && Object.hasOwnProperty.call(m, "startTime"))
                w.uint32(40).int64(m.startTime);
            if (m.isIncoming != null && Object.hasOwnProperty.call(m, "isIncoming"))
                w.uint32(48).bool(m.isIncoming);
            if (m.isVideo != null && Object.hasOwnProperty.call(m, "isVideo"))
                w.uint32(56).bool(m.isVideo);
            if (m.isCallLink != null && Object.hasOwnProperty.call(m, "isCallLink"))
                w.uint32(64).bool(m.isCallLink);
            if (m.callLinkToken != null && Object.hasOwnProperty.call(m, "callLinkToken"))
                w.uint32(74).string(m.callLinkToken);
            if (m.scheduledCallId != null && Object.hasOwnProperty.call(m, "scheduledCallId"))
                w.uint32(82).string(m.scheduledCallId);
            if (m.callId != null && Object.hasOwnProperty.call(m, "callId"))
                w.uint32(90).string(m.callId);
            if (m.callCreatorJid != null && Object.hasOwnProperty.call(m, "callCreatorJid"))
                w.uint32(98).string(m.callCreatorJid);
            if (m.groupJid != null && Object.hasOwnProperty.call(m, "groupJid"))
                w.uint32(106).string(m.groupJid);
            if (m.participants != null && m.participants.length) {
                for (var i = 0; i < m.participants.length; ++i)
                    $root.proto.CallLogRecord.ParticipantInfo.encode(m.participants[i], w.uint32(114).fork()).ldelim();
            }
            if (m.callType != null && Object.hasOwnProperty.call(m, "callType"))
                w.uint32(120).int32(m.callType);
            return w;
        };

        CallLogRecord.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CallLogRecord();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.callResult = r.int32();
                        break;
                    }
                case 2: {
                        m.isDndMode = r.bool();
                        break;
                    }
                case 3: {
                        m.silenceReason = r.int32();
                        break;
                    }
                case 4: {
                        m.duration = r.int64();
                        break;
                    }
                case 5: {
                        m.startTime = r.int64();
                        break;
                    }
                case 6: {
                        m.isIncoming = r.bool();
                        break;
                    }
                case 7: {
                        m.isVideo = r.bool();
                        break;
                    }
                case 8: {
                        m.isCallLink = r.bool();
                        break;
                    }
                case 9: {
                        m.callLinkToken = r.string();
                        break;
                    }
                case 10: {
                        m.scheduledCallId = r.string();
                        break;
                    }
                case 11: {
                        m.callId = r.string();
                        break;
                    }
                case 12: {
                        m.callCreatorJid = r.string();
                        break;
                    }
                case 13: {
                        m.groupJid = r.string();
                        break;
                    }
                case 14: {
                        if (!(m.participants && m.participants.length))
                            m.participants = [];
                        m.participants.push($root.proto.CallLogRecord.ParticipantInfo.decode(r, r.uint32()));
                        break;
                    }
                case 15: {
                        m.callType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        CallLogRecord.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.CallLogRecord)
                return d;
            var m = new $root.proto.CallLogRecord();
            switch (d.callResult) {
            default:
                if (typeof d.callResult === "number") {
                    m.callResult = d.callResult;
                    break;
                }
                break;
            case "CONNECTED":
            case 0:
                m.callResult = 0;
                break;
            case "REJECTED":
            case 1:
                m.callResult = 1;
                break;
            case "CANCELLED":
            case 2:
                m.callResult = 2;
                break;
            case "ACCEPTEDELSEWHERE":
            case 3:
                m.callResult = 3;
                break;
            case "MISSED":
            case 4:
                m.callResult = 4;
                break;
            case "INVALID":
            case 5:
                m.callResult = 5;
                break;
            case "UNAVAILABLE":
            case 6:
                m.callResult = 6;
                break;
            case "UPCOMING":
            case 7:
                m.callResult = 7;
                break;
            case "FAILED":
            case 8:
                m.callResult = 8;
                break;
            case "ABANDONED":
            case 9:
                m.callResult = 9;
                break;
            case "ONGOING":
            case 10:
                m.callResult = 10;
                break;
            }
            if (d.isDndMode != null) {
                m.isDndMode = Boolean(d.isDndMode);
            }
            switch (d.silenceReason) {
            default:
                if (typeof d.silenceReason === "number") {
                    m.silenceReason = d.silenceReason;
                    break;
                }
                break;
            case "NONE":
            case 0:
                m.silenceReason = 0;
                break;
            case "SCHEDULED":
            case 1:
                m.silenceReason = 1;
                break;
            case "PRIVACY":
            case 2:
                m.silenceReason = 2;
                break;
            case "LIGHTWEIGHT":
            case 3:
                m.silenceReason = 3;
                break;
            }
            if (d.duration != null) {
                if ($util.Long)
                    (m.duration = $util.Long.fromValue(d.duration)).unsigned = false;
                else if (typeof d.duration === "string")
                    m.duration = parseInt(d.duration, 10);
                else if (typeof d.duration === "number")
                    m.duration = d.duration;
                else if (typeof d.duration === "object")
                    m.duration = new $util.LongBits(d.duration.low >>> 0, d.duration.high >>> 0).toNumber();
            }
            if (d.startTime != null) {
                if ($util.Long)
                    (m.startTime = $util.Long.fromValue(d.startTime)).unsigned = false;
                else if (typeof d.startTime === "string")
                    m.startTime = parseInt(d.startTime, 10);
                else if (typeof d.startTime === "number")
                    m.startTime = d.startTime;
                else if (typeof d.startTime === "object")
                    m.startTime = new $util.LongBits(d.startTime.low >>> 0, d.startTime.high >>> 0).toNumber();
            }
            if (d.isIncoming != null) {
                m.isIncoming = Boolean(d.isIncoming);
            }
            if (d.isVideo != null) {
                m.isVideo = Boolean(d.isVideo);
            }
            if (d.isCallLink != null) {
                m.isCallLink = Boolean(d.isCallLink);
            }
            if (d.callLinkToken != null) {
                m.callLinkToken = String(d.callLinkToken);
            }
            if (d.scheduledCallId != null) {
                m.scheduledCallId = String(d.scheduledCallId);
            }
            if (d.callId != null) {
                m.callId = String(d.callId);
            }
            if (d.callCreatorJid != null) {
                m.callCreatorJid = String(d.callCreatorJid);
            }
            if (d.groupJid != null) {
                m.groupJid = String(d.groupJid);
            }
            if (d.participants) {
                if (!Array.isArray(d.participants))
                    throw TypeError(".proto.CallLogRecord.participants: array expected");
                m.participants = [];
                for (var i = 0; i < d.participants.length; ++i) {
                    if (typeof d.participants[i] !== "object")
                        throw TypeError(".proto.CallLogRecord.participants: object expected");
                    m.participants[i] = $root.proto.CallLogRecord.ParticipantInfo.fromObject(d.participants[i]);
                }
            }
            switch (d.callType) {
            default:
                if (typeof d.callType === "number") {
                    m.callType = d.callType;
                    break;
                }
                break;
            case "REGULAR":
            case 0:
                m.callType = 0;
                break;
            case "SCHEDULED_CALL":
            case 1:
                m.callType = 1;
                break;
            case "VOICE_CHAT":
            case 2:
                m.callType = 2;
                break;
            }
            return m;
        };

        CallLogRecord.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.participants = [];
            }
            if (m.callResult != null && m.hasOwnProperty("callResult")) {
                d.callResult = o.enums === String ? $root.proto.CallLogRecord.CallResult[m.callResult] === undefined ? m.callResult : $root.proto.CallLogRecord.CallResult[m.callResult] : m.callResult;
                if (o.oneofs)
                    d._callResult = "callResult";
            }
            if (m.isDndMode != null && m.hasOwnProperty("isDndMode")) {
                d.isDndMode = m.isDndMode;
                if (o.oneofs)
                    d._isDndMode = "isDndMode";
            }
            if (m.silenceReason != null && m.hasOwnProperty("silenceReason")) {
                d.silenceReason = o.enums === String ? $root.proto.CallLogRecord.SilenceReason[m.silenceReason] === undefined ? m.silenceReason : $root.proto.CallLogRecord.SilenceReason[m.silenceReason] : m.silenceReason;
                if (o.oneofs)
                    d._silenceReason = "silenceReason";
            }
            if (m.duration != null && m.hasOwnProperty("duration")) {
                if (typeof m.duration === "number")
                    d.duration = o.longs === String ? String(m.duration) : m.duration;
                else
                    d.duration = o.longs === String ? longToString(m.duration) : o.longs === Number ? longToNumber(m.duration) : m.duration;
                if (o.oneofs)
                    d._duration = "duration";
            }
            if (m.startTime != null && m.hasOwnProperty("startTime")) {
                if (typeof m.startTime === "number")
                    d.startTime = o.longs === String ? String(m.startTime) : m.startTime;
                else
                    d.startTime = o.longs === String ? longToString(m.startTime) : o.longs === Number ? longToNumber(m.startTime) : m.startTime;
                if (o.oneofs)
                    d._startTime = "startTime";
            }
            if (m.isIncoming != null && m.hasOwnProperty("isIncoming")) {
                d.isIncoming = m.isIncoming;
                if (o.oneofs)
                    d._isIncoming = "isIncoming";
            }
            if (m.isVideo != null && m.hasOwnProperty("isVideo")) {
                d.isVideo = m.isVideo;
                if (o.oneofs)
                    d._isVideo = "isVideo";
            }
            if (m.isCallLink != null && m.hasOwnProperty("isCallLink")) {
                d.isCallLink = m.isCallLink;
                if (o.oneofs)
                    d._isCallLink = "isCallLink";
            }
            if (m.callLinkToken != null && m.hasOwnProperty("callLinkToken")) {
                d.callLinkToken = m.callLinkToken;
                if (o.oneofs)
                    d._callLinkToken = "callLinkToken";
            }
            if (m.scheduledCallId != null && m.hasOwnProperty("scheduledCallId")) {
                d.scheduledCallId = m.scheduledCallId;
                if (o.oneofs)
                    d._scheduledCallId = "scheduledCallId";
            }
            if (m.callId != null && m.hasOwnProperty("callId")) {
                d.callId = m.callId;
                if (o.oneofs)
                    d._callId = "callId";
            }
            if (m.callCreatorJid != null && m.hasOwnProperty("callCreatorJid")) {
                d.callCreatorJid = m.callCreatorJid;
                if (o.oneofs)
                    d._callCreatorJid = "callCreatorJid";
            }
            if (m.groupJid != null && m.hasOwnProperty("groupJid")) {
                d.groupJid = m.groupJid;
                if (o.oneofs)
                    d._groupJid = "groupJid";
            }
            if (m.participants && m.participants.length) {
                d.participants = [];
                for (var j = 0; j < m.participants.length; ++j) {
                    d.participants[j] = $root.proto.CallLogRecord.ParticipantInfo.toObject(m.participants[j], o);
                }
            }
            if (m.callType != null && m.hasOwnProperty("callType")) {
                d.callType = o.enums === String ? $root.proto.CallLogRecord.CallType[m.callType] === undefined ? m.callType : $root.proto.CallLogRecord.CallType[m.callType] : m.callType;
                if (o.oneofs)
                    d._callType = "callType";
            }
            return d;
        };

        CallLogRecord.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        CallLogRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.CallLogRecord";
        };

        CallLogRecord.CallResult = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "CONNECTED"] = 0;
            values[valuesById[1] = "REJECTED"] = 1;
            values[valuesById[2] = "CANCELLED"] = 2;
            values[valuesById[3] = "ACCEPTEDELSEWHERE"] = 3;
            values[valuesById[4] = "MISSED"] = 4;
            values[valuesById[5] = "INVALID"] = 5;
            values[valuesById[6] = "UNAVAILABLE"] = 6;
            values[valuesById[7] = "UPCOMING"] = 7;
            values[valuesById[8] = "FAILED"] = 8;
            values[valuesById[9] = "ABANDONED"] = 9;
            values[valuesById[10] = "ONGOING"] = 10;
            return values;
        })();

        CallLogRecord.CallType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "REGULAR"] = 0;
            values[valuesById[1] = "SCHEDULED_CALL"] = 1;
            values[valuesById[2] = "VOICE_CHAT"] = 2;
            return values;
        })();

        CallLogRecord.ParticipantInfo = (function() {

            function ParticipantInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ParticipantInfo.prototype.userJid = null;
            ParticipantInfo.prototype.callResult = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ParticipantInfo.prototype, "_userJid", {
                get: $util.oneOfGetter($oneOfFields = ["userJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ParticipantInfo.prototype, "_callResult", {
                get: $util.oneOfGetter($oneOfFields = ["callResult"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ParticipantInfo.create = function create(properties) {
                return new ParticipantInfo(properties);
            };

            ParticipantInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.userJid != null && Object.hasOwnProperty.call(m, "userJid"))
                    w.uint32(10).string(m.userJid);
                if (m.callResult != null && Object.hasOwnProperty.call(m, "callResult"))
                    w.uint32(16).int32(m.callResult);
                return w;
            };

            ParticipantInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CallLogRecord.ParticipantInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.userJid = r.string();
                            break;
                        }
                    case 2: {
                            m.callResult = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ParticipantInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.CallLogRecord.ParticipantInfo)
                    return d;
                var m = new $root.proto.CallLogRecord.ParticipantInfo();
                if (d.userJid != null) {
                    m.userJid = String(d.userJid);
                }
                switch (d.callResult) {
                default:
                    if (typeof d.callResult === "number") {
                        m.callResult = d.callResult;
                        break;
                    }
                    break;
                case "CONNECTED":
                case 0:
                    m.callResult = 0;
                    break;
                case "REJECTED":
                case 1:
                    m.callResult = 1;
                    break;
                case "CANCELLED":
                case 2:
                    m.callResult = 2;
                    break;
                case "ACCEPTEDELSEWHERE":
                case 3:
                    m.callResult = 3;
                    break;
                case "MISSED":
                case 4:
                    m.callResult = 4;
                    break;
                case "INVALID":
                case 5:
                    m.callResult = 5;
                    break;
                case "UNAVAILABLE":
                case 6:
                    m.callResult = 6;
                    break;
                case "UPCOMING":
                case 7:
                    m.callResult = 7;
                    break;
                case "FAILED":
                case 8:
                    m.callResult = 8;
                    break;
                case "ABANDONED":
                case 9:
                    m.callResult = 9;
                    break;
                case "ONGOING":
                case 10:
                    m.callResult = 10;
                    break;
                }
                return m;
            };

            ParticipantInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.userJid != null && m.hasOwnProperty("userJid")) {
                    d.userJid = m.userJid;
                    if (o.oneofs)
                        d._userJid = "userJid";
                }
                if (m.callResult != null && m.hasOwnProperty("callResult")) {
                    d.callResult = o.enums === String ? $root.proto.CallLogRecord.CallResult[m.callResult] === undefined ? m.callResult : $root.proto.CallLogRecord.CallResult[m.callResult] : m.callResult;
                    if (o.oneofs)
                        d._callResult = "callResult";
                }
                return d;
            };

            ParticipantInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ParticipantInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.CallLogRecord.ParticipantInfo";
            };

            return ParticipantInfo;
        })();

        CallLogRecord.SilenceReason = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "NONE"] = 0;
            values[valuesById[1] = "SCHEDULED"] = 1;
            values[valuesById[2] = "PRIVACY"] = 2;
            values[valuesById[3] = "LIGHTWEIGHT"] = 3;
            return values;
        })();

        return CallLogRecord;
    })();

    proto.CertChain = (function() {

        function CertChain(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        CertChain.prototype.leaf = null;
        CertChain.prototype.intermediate = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CertChain.prototype, "_leaf", {
            get: $util.oneOfGetter($oneOfFields = ["leaf"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CertChain.prototype, "_intermediate", {
            get: $util.oneOfGetter($oneOfFields = ["intermediate"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        CertChain.create = function create(properties) {
            return new CertChain(properties);
        };

        CertChain.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.leaf != null && Object.hasOwnProperty.call(m, "leaf"))
                $root.proto.CertChain.NoiseCertificate.encode(m.leaf, w.uint32(10).fork()).ldelim();
            if (m.intermediate != null && Object.hasOwnProperty.call(m, "intermediate"))
                $root.proto.CertChain.NoiseCertificate.encode(m.intermediate, w.uint32(18).fork()).ldelim();
            return w;
        };

        CertChain.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CertChain();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.leaf = $root.proto.CertChain.NoiseCertificate.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.intermediate = $root.proto.CertChain.NoiseCertificate.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        CertChain.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.CertChain)
                return d;
            var m = new $root.proto.CertChain();
            if (d.leaf != null) {
                if (typeof d.leaf !== "object")
                    throw TypeError(".proto.CertChain.leaf: object expected");
                m.leaf = $root.proto.CertChain.NoiseCertificate.fromObject(d.leaf);
            }
            if (d.intermediate != null) {
                if (typeof d.intermediate !== "object")
                    throw TypeError(".proto.CertChain.intermediate: object expected");
                m.intermediate = $root.proto.CertChain.NoiseCertificate.fromObject(d.intermediate);
            }
            return m;
        };

        CertChain.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.leaf != null && m.hasOwnProperty("leaf")) {
                d.leaf = $root.proto.CertChain.NoiseCertificate.toObject(m.leaf, o);
                if (o.oneofs)
                    d._leaf = "leaf";
            }
            if (m.intermediate != null && m.hasOwnProperty("intermediate")) {
                d.intermediate = $root.proto.CertChain.NoiseCertificate.toObject(m.intermediate, o);
                if (o.oneofs)
                    d._intermediate = "intermediate";
            }
            return d;
        };

        CertChain.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        CertChain.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.CertChain";
        };

        CertChain.NoiseCertificate = (function() {

            function NoiseCertificate(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            NoiseCertificate.prototype.details = null;
            NoiseCertificate.prototype.signature = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NoiseCertificate.prototype, "_details", {
                get: $util.oneOfGetter($oneOfFields = ["details"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NoiseCertificate.prototype, "_signature", {
                get: $util.oneOfGetter($oneOfFields = ["signature"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            NoiseCertificate.create = function create(properties) {
                return new NoiseCertificate(properties);
            };

            NoiseCertificate.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.details != null && Object.hasOwnProperty.call(m, "details"))
                    w.uint32(10).bytes(m.details);
                if (m.signature != null && Object.hasOwnProperty.call(m, "signature"))
                    w.uint32(18).bytes(m.signature);
                return w;
            };

            NoiseCertificate.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CertChain.NoiseCertificate();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.details = r.bytes();
                            break;
                        }
                    case 2: {
                            m.signature = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            NoiseCertificate.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.CertChain.NoiseCertificate)
                    return d;
                var m = new $root.proto.CertChain.NoiseCertificate();
                if (d.details != null) {
                    if (typeof d.details === "string")
                        $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0);
                    else if (d.details.length >= 0)
                        m.details = d.details;
                }
                if (d.signature != null) {
                    if (typeof d.signature === "string")
                        $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0);
                    else if (d.signature.length >= 0)
                        m.signature = d.signature;
                }
                return m;
            };

            NoiseCertificate.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.details != null && m.hasOwnProperty("details")) {
                    d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details;
                    if (o.oneofs)
                        d._details = "details";
                }
                if (m.signature != null && m.hasOwnProperty("signature")) {
                    d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature;
                    if (o.oneofs)
                        d._signature = "signature";
                }
                return d;
            };

            NoiseCertificate.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            NoiseCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.CertChain.NoiseCertificate";
            };

            NoiseCertificate.Details = (function() {

                function Details(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Details.prototype.serial = null;
                Details.prototype.issuerSerial = null;
                Details.prototype.key = null;
                Details.prototype.notBefore = null;
                Details.prototype.notAfter = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Details.prototype, "_serial", {
                    get: $util.oneOfGetter($oneOfFields = ["serial"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Details.prototype, "_issuerSerial", {
                    get: $util.oneOfGetter($oneOfFields = ["issuerSerial"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Details.prototype, "_key", {
                    get: $util.oneOfGetter($oneOfFields = ["key"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Details.prototype, "_notBefore", {
                    get: $util.oneOfGetter($oneOfFields = ["notBefore"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Details.prototype, "_notAfter", {
                    get: $util.oneOfGetter($oneOfFields = ["notAfter"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Details.create = function create(properties) {
                    return new Details(properties);
                };

                Details.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.serial != null && Object.hasOwnProperty.call(m, "serial"))
                        w.uint32(8).uint32(m.serial);
                    if (m.issuerSerial != null && Object.hasOwnProperty.call(m, "issuerSerial"))
                        w.uint32(16).uint32(m.issuerSerial);
                    if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                        w.uint32(26).bytes(m.key);
                    if (m.notBefore != null && Object.hasOwnProperty.call(m, "notBefore"))
                        w.uint32(32).uint64(m.notBefore);
                    if (m.notAfter != null && Object.hasOwnProperty.call(m, "notAfter"))
                        w.uint32(40).uint64(m.notAfter);
                    return w;
                };

                Details.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CertChain.NoiseCertificate.Details();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.serial = r.uint32();
                                break;
                            }
                        case 2: {
                                m.issuerSerial = r.uint32();
                                break;
                            }
                        case 3: {
                                m.key = r.bytes();
                                break;
                            }
                        case 4: {
                                m.notBefore = r.uint64();
                                break;
                            }
                        case 5: {
                                m.notAfter = r.uint64();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Details.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.CertChain.NoiseCertificate.Details)
                        return d;
                    var m = new $root.proto.CertChain.NoiseCertificate.Details();
                    if (d.serial != null) {
                        m.serial = d.serial >>> 0;
                    }
                    if (d.issuerSerial != null) {
                        m.issuerSerial = d.issuerSerial >>> 0;
                    }
                    if (d.key != null) {
                        if (typeof d.key === "string")
                            $util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0);
                        else if (d.key.length >= 0)
                            m.key = d.key;
                    }
                    if (d.notBefore != null) {
                        if ($util.Long)
                            (m.notBefore = $util.Long.fromValue(d.notBefore)).unsigned = true;
                        else if (typeof d.notBefore === "string")
                            m.notBefore = parseInt(d.notBefore, 10);
                        else if (typeof d.notBefore === "number")
                            m.notBefore = d.notBefore;
                        else if (typeof d.notBefore === "object")
                            m.notBefore = new $util.LongBits(d.notBefore.low >>> 0, d.notBefore.high >>> 0).toNumber(true);
                    }
                    if (d.notAfter != null) {
                        if ($util.Long)
                            (m.notAfter = $util.Long.fromValue(d.notAfter)).unsigned = true;
                        else if (typeof d.notAfter === "string")
                            m.notAfter = parseInt(d.notAfter, 10);
                        else if (typeof d.notAfter === "number")
                            m.notAfter = d.notAfter;
                        else if (typeof d.notAfter === "object")
                            m.notAfter = new $util.LongBits(d.notAfter.low >>> 0, d.notAfter.high >>> 0).toNumber(true);
                    }
                    return m;
                };

                Details.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.serial != null && m.hasOwnProperty("serial")) {
                        d.serial = m.serial;
                        if (o.oneofs)
                            d._serial = "serial";
                    }
                    if (m.issuerSerial != null && m.hasOwnProperty("issuerSerial")) {
                        d.issuerSerial = m.issuerSerial;
                        if (o.oneofs)
                            d._issuerSerial = "issuerSerial";
                    }
                    if (m.key != null && m.hasOwnProperty("key")) {
                        d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key;
                        if (o.oneofs)
                            d._key = "key";
                    }
                    if (m.notBefore != null && m.hasOwnProperty("notBefore")) {
                        if (typeof m.notBefore === "number")
                            d.notBefore = o.longs === String ? String(m.notBefore) : m.notBefore;
                        else
                            d.notBefore = o.longs === String ? longToString(m.notBefore, true) : o.longs === Number ? longToNumber(m.notBefore, true) : m.notBefore;
                        if (o.oneofs)
                            d._notBefore = "notBefore";
                    }
                    if (m.notAfter != null && m.hasOwnProperty("notAfter")) {
                        if (typeof m.notAfter === "number")
                            d.notAfter = o.longs === String ? String(m.notAfter) : m.notAfter;
                        else
                            d.notAfter = o.longs === String ? longToString(m.notAfter, true) : o.longs === Number ? longToNumber(m.notAfter, true) : m.notAfter;
                        if (o.oneofs)
                            d._notAfter = "notAfter";
                    }
                    return d;
                };

                Details.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.CertChain.NoiseCertificate.Details";
                };

                return Details;
            })();

            return NoiseCertificate;
        })();

        return CertChain;
    })();

    proto.ChatLockSettings = (function() {

        function ChatLockSettings(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ChatLockSettings.prototype.hideLockedChats = null;
        ChatLockSettings.prototype.secretCode = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ChatLockSettings.prototype, "_hideLockedChats", {
            get: $util.oneOfGetter($oneOfFields = ["hideLockedChats"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ChatLockSettings.prototype, "_secretCode", {
            get: $util.oneOfGetter($oneOfFields = ["secretCode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ChatLockSettings.create = function create(properties) {
            return new ChatLockSettings(properties);
        };

        ChatLockSettings.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.hideLockedChats != null && Object.hasOwnProperty.call(m, "hideLockedChats"))
                w.uint32(8).bool(m.hideLockedChats);
            if (m.secretCode != null && Object.hasOwnProperty.call(m, "secretCode"))
                $root.proto.UserPassword.encode(m.secretCode, w.uint32(18).fork()).ldelim();
            return w;
        };

        ChatLockSettings.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ChatLockSettings();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.hideLockedChats = r.bool();
                        break;
                    }
                case 2: {
                        m.secretCode = $root.proto.UserPassword.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ChatLockSettings.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ChatLockSettings)
                return d;
            var m = new $root.proto.ChatLockSettings();
            if (d.hideLockedChats != null) {
                m.hideLockedChats = Boolean(d.hideLockedChats);
            }
            if (d.secretCode != null) {
                if (typeof d.secretCode !== "object")
                    throw TypeError(".proto.ChatLockSettings.secretCode: object expected");
                m.secretCode = $root.proto.UserPassword.fromObject(d.secretCode);
            }
            return m;
        };

        ChatLockSettings.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.hideLockedChats != null && m.hasOwnProperty("hideLockedChats")) {
                d.hideLockedChats = m.hideLockedChats;
                if (o.oneofs)
                    d._hideLockedChats = "hideLockedChats";
            }
            if (m.secretCode != null && m.hasOwnProperty("secretCode")) {
                d.secretCode = $root.proto.UserPassword.toObject(m.secretCode, o);
                if (o.oneofs)
                    d._secretCode = "secretCode";
            }
            return d;
        };

        ChatLockSettings.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ChatLockSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ChatLockSettings";
        };

        return ChatLockSettings;
    })();

    proto.ChatRowOpaqueData = (function() {

        function ChatRowOpaqueData(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ChatRowOpaqueData.prototype.draftMessage = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ChatRowOpaqueData.prototype, "_draftMessage", {
            get: $util.oneOfGetter($oneOfFields = ["draftMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ChatRowOpaqueData.create = function create(properties) {
            return new ChatRowOpaqueData(properties);
        };

        ChatRowOpaqueData.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.draftMessage != null && Object.hasOwnProperty.call(m, "draftMessage"))
                $root.proto.ChatRowOpaqueData.DraftMessage.encode(m.draftMessage, w.uint32(10).fork()).ldelim();
            return w;
        };

        ChatRowOpaqueData.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ChatRowOpaqueData();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.draftMessage = $root.proto.ChatRowOpaqueData.DraftMessage.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ChatRowOpaqueData.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ChatRowOpaqueData)
                return d;
            var m = new $root.proto.ChatRowOpaqueData();
            if (d.draftMessage != null) {
                if (typeof d.draftMessage !== "object")
                    throw TypeError(".proto.ChatRowOpaqueData.draftMessage: object expected");
                m.draftMessage = $root.proto.ChatRowOpaqueData.DraftMessage.fromObject(d.draftMessage);
            }
            return m;
        };

        ChatRowOpaqueData.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.draftMessage != null && m.hasOwnProperty("draftMessage")) {
                d.draftMessage = $root.proto.ChatRowOpaqueData.DraftMessage.toObject(m.draftMessage, o);
                if (o.oneofs)
                    d._draftMessage = "draftMessage";
            }
            return d;
        };

        ChatRowOpaqueData.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ChatRowOpaqueData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ChatRowOpaqueData";
        };

        ChatRowOpaqueData.DraftMessage = (function() {

            function DraftMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DraftMessage.prototype.text = null;
            DraftMessage.prototype.omittedUrl = null;
            DraftMessage.prototype.ctwaContextLinkData = null;
            DraftMessage.prototype.ctwaContext = null;
            DraftMessage.prototype.timestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DraftMessage.prototype, "_text", {
                get: $util.oneOfGetter($oneOfFields = ["text"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DraftMessage.prototype, "_omittedUrl", {
                get: $util.oneOfGetter($oneOfFields = ["omittedUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DraftMessage.prototype, "_ctwaContextLinkData", {
                get: $util.oneOfGetter($oneOfFields = ["ctwaContextLinkData"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DraftMessage.prototype, "_ctwaContext", {
                get: $util.oneOfGetter($oneOfFields = ["ctwaContext"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DraftMessage.prototype, "_timestamp", {
                get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DraftMessage.create = function create(properties) {
                return new DraftMessage(properties);
            };

            DraftMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                    w.uint32(10).string(m.text);
                if (m.omittedUrl != null && Object.hasOwnProperty.call(m, "omittedUrl"))
                    w.uint32(18).string(m.omittedUrl);
                if (m.ctwaContextLinkData != null && Object.hasOwnProperty.call(m, "ctwaContextLinkData"))
                    $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.encode(m.ctwaContextLinkData, w.uint32(26).fork()).ldelim();
                if (m.ctwaContext != null && Object.hasOwnProperty.call(m, "ctwaContext"))
                    $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.encode(m.ctwaContext, w.uint32(34).fork()).ldelim();
                if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                    w.uint32(40).int64(m.timestamp);
                return w;
            };

            DraftMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ChatRowOpaqueData.DraftMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.text = r.string();
                            break;
                        }
                    case 2: {
                            m.omittedUrl = r.string();
                            break;
                        }
                    case 3: {
                            m.ctwaContextLinkData = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.ctwaContext = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.decode(r, r.uint32());
                            break;
                        }
                    case 5: {
                            m.timestamp = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DraftMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ChatRowOpaqueData.DraftMessage)
                    return d;
                var m = new $root.proto.ChatRowOpaqueData.DraftMessage();
                if (d.text != null) {
                    m.text = String(d.text);
                }
                if (d.omittedUrl != null) {
                    m.omittedUrl = String(d.omittedUrl);
                }
                if (d.ctwaContextLinkData != null) {
                    if (typeof d.ctwaContextLinkData !== "object")
                        throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContextLinkData: object expected");
                    m.ctwaContextLinkData = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.fromObject(d.ctwaContextLinkData);
                }
                if (d.ctwaContext != null) {
                    if (typeof d.ctwaContext !== "object")
                        throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContext: object expected");
                    m.ctwaContext = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.fromObject(d.ctwaContext);
                }
                if (d.timestamp != null) {
                    if ($util.Long)
                        (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                    else if (typeof d.timestamp === "string")
                        m.timestamp = parseInt(d.timestamp, 10);
                    else if (typeof d.timestamp === "number")
                        m.timestamp = d.timestamp;
                    else if (typeof d.timestamp === "object")
                        m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
                }
                return m;
            };

            DraftMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.text != null && m.hasOwnProperty("text")) {
                    d.text = m.text;
                    if (o.oneofs)
                        d._text = "text";
                }
                if (m.omittedUrl != null && m.hasOwnProperty("omittedUrl")) {
                    d.omittedUrl = m.omittedUrl;
                    if (o.oneofs)
                        d._omittedUrl = "omittedUrl";
                }
                if (m.ctwaContextLinkData != null && m.hasOwnProperty("ctwaContextLinkData")) {
                    d.ctwaContextLinkData = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.toObject(m.ctwaContextLinkData, o);
                    if (o.oneofs)
                        d._ctwaContextLinkData = "ctwaContextLinkData";
                }
                if (m.ctwaContext != null && m.hasOwnProperty("ctwaContext")) {
                    d.ctwaContext = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.toObject(m.ctwaContext, o);
                    if (o.oneofs)
                        d._ctwaContext = "ctwaContext";
                }
                if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                    if (typeof m.timestamp === "number")
                        d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                    else
                        d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                    if (o.oneofs)
                        d._timestamp = "timestamp";
                }
                return d;
            };

            DraftMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DraftMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ChatRowOpaqueData.DraftMessage";
            };

            DraftMessage.CtwaContextData = (function() {

                function CtwaContextData(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                CtwaContextData.prototype.conversionSource = null;
                CtwaContextData.prototype.conversionData = null;
                CtwaContextData.prototype.sourceUrl = null;
                CtwaContextData.prototype.sourceId = null;
                CtwaContextData.prototype.sourceType = null;
                CtwaContextData.prototype.title = null;
                CtwaContextData.prototype.description = null;
                CtwaContextData.prototype.thumbnail = null;
                CtwaContextData.prototype.thumbnailUrl = null;
                CtwaContextData.prototype.mediaType = null;
                CtwaContextData.prototype.mediaUrl = null;
                CtwaContextData.prototype.isSuspiciousLink = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_conversionSource", {
                    get: $util.oneOfGetter($oneOfFields = ["conversionSource"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_conversionData", {
                    get: $util.oneOfGetter($oneOfFields = ["conversionData"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_sourceUrl", {
                    get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_sourceId", {
                    get: $util.oneOfGetter($oneOfFields = ["sourceId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_sourceType", {
                    get: $util.oneOfGetter($oneOfFields = ["sourceType"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_title", {
                    get: $util.oneOfGetter($oneOfFields = ["title"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_description", {
                    get: $util.oneOfGetter($oneOfFields = ["description"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_thumbnail", {
                    get: $util.oneOfGetter($oneOfFields = ["thumbnail"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_thumbnailUrl", {
                    get: $util.oneOfGetter($oneOfFields = ["thumbnailUrl"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_mediaType", {
                    get: $util.oneOfGetter($oneOfFields = ["mediaType"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_mediaUrl", {
                    get: $util.oneOfGetter($oneOfFields = ["mediaUrl"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextData.prototype, "_isSuspiciousLink", {
                    get: $util.oneOfGetter($oneOfFields = ["isSuspiciousLink"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                CtwaContextData.create = function create(properties) {
                    return new CtwaContextData(properties);
                };

                CtwaContextData.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.conversionSource != null && Object.hasOwnProperty.call(m, "conversionSource"))
                        w.uint32(10).string(m.conversionSource);
                    if (m.conversionData != null && Object.hasOwnProperty.call(m, "conversionData"))
                        w.uint32(18).bytes(m.conversionData);
                    if (m.sourceUrl != null && Object.hasOwnProperty.call(m, "sourceUrl"))
                        w.uint32(26).string(m.sourceUrl);
                    if (m.sourceId != null && Object.hasOwnProperty.call(m, "sourceId"))
                        w.uint32(34).string(m.sourceId);
                    if (m.sourceType != null && Object.hasOwnProperty.call(m, "sourceType"))
                        w.uint32(42).string(m.sourceType);
                    if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                        w.uint32(50).string(m.title);
                    if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                        w.uint32(58).string(m.description);
                    if (m.thumbnail != null && Object.hasOwnProperty.call(m, "thumbnail"))
                        w.uint32(66).string(m.thumbnail);
                    if (m.thumbnailUrl != null && Object.hasOwnProperty.call(m, "thumbnailUrl"))
                        w.uint32(74).string(m.thumbnailUrl);
                    if (m.mediaType != null && Object.hasOwnProperty.call(m, "mediaType"))
                        w.uint32(80).int32(m.mediaType);
                    if (m.mediaUrl != null && Object.hasOwnProperty.call(m, "mediaUrl"))
                        w.uint32(90).string(m.mediaUrl);
                    if (m.isSuspiciousLink != null && Object.hasOwnProperty.call(m, "isSuspiciousLink"))
                        w.uint32(96).bool(m.isSuspiciousLink);
                    return w;
                };

                CtwaContextData.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.conversionSource = r.string();
                                break;
                            }
                        case 2: {
                                m.conversionData = r.bytes();
                                break;
                            }
                        case 3: {
                                m.sourceUrl = r.string();
                                break;
                            }
                        case 4: {
                                m.sourceId = r.string();
                                break;
                            }
                        case 5: {
                                m.sourceType = r.string();
                                break;
                            }
                        case 6: {
                                m.title = r.string();
                                break;
                            }
                        case 7: {
                                m.description = r.string();
                                break;
                            }
                        case 8: {
                                m.thumbnail = r.string();
                                break;
                            }
                        case 9: {
                                m.thumbnailUrl = r.string();
                                break;
                            }
                        case 10: {
                                m.mediaType = r.int32();
                                break;
                            }
                        case 11: {
                                m.mediaUrl = r.string();
                                break;
                            }
                        case 12: {
                                m.isSuspiciousLink = r.bool();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                CtwaContextData.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData)
                        return d;
                    var m = new $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData();
                    if (d.conversionSource != null) {
                        m.conversionSource = String(d.conversionSource);
                    }
                    if (d.conversionData != null) {
                        if (typeof d.conversionData === "string")
                            $util.base64.decode(d.conversionData, m.conversionData = $util.newBuffer($util.base64.length(d.conversionData)), 0);
                        else if (d.conversionData.length >= 0)
                            m.conversionData = d.conversionData;
                    }
                    if (d.sourceUrl != null) {
                        m.sourceUrl = String(d.sourceUrl);
                    }
                    if (d.sourceId != null) {
                        m.sourceId = String(d.sourceId);
                    }
                    if (d.sourceType != null) {
                        m.sourceType = String(d.sourceType);
                    }
                    if (d.title != null) {
                        m.title = String(d.title);
                    }
                    if (d.description != null) {
                        m.description = String(d.description);
                    }
                    if (d.thumbnail != null) {
                        m.thumbnail = String(d.thumbnail);
                    }
                    if (d.thumbnailUrl != null) {
                        m.thumbnailUrl = String(d.thumbnailUrl);
                    }
                    switch (d.mediaType) {
                    default:
                        if (typeof d.mediaType === "number") {
                            m.mediaType = d.mediaType;
                            break;
                        }
                        break;
                    case "NONE":
                    case 0:
                        m.mediaType = 0;
                        break;
                    case "IMAGE":
                    case 1:
                        m.mediaType = 1;
                        break;
                    case "VIDEO":
                    case 2:
                        m.mediaType = 2;
                        break;
                    }
                    if (d.mediaUrl != null) {
                        m.mediaUrl = String(d.mediaUrl);
                    }
                    if (d.isSuspiciousLink != null) {
                        m.isSuspiciousLink = Boolean(d.isSuspiciousLink);
                    }
                    return m;
                };

                CtwaContextData.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.conversionSource != null && m.hasOwnProperty("conversionSource")) {
                        d.conversionSource = m.conversionSource;
                        if (o.oneofs)
                            d._conversionSource = "conversionSource";
                    }
                    if (m.conversionData != null && m.hasOwnProperty("conversionData")) {
                        d.conversionData = o.bytes === String ? $util.base64.encode(m.conversionData, 0, m.conversionData.length) : o.bytes === Array ? Array.prototype.slice.call(m.conversionData) : m.conversionData;
                        if (o.oneofs)
                            d._conversionData = "conversionData";
                    }
                    if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) {
                        d.sourceUrl = m.sourceUrl;
                        if (o.oneofs)
                            d._sourceUrl = "sourceUrl";
                    }
                    if (m.sourceId != null && m.hasOwnProperty("sourceId")) {
                        d.sourceId = m.sourceId;
                        if (o.oneofs)
                            d._sourceId = "sourceId";
                    }
                    if (m.sourceType != null && m.hasOwnProperty("sourceType")) {
                        d.sourceType = m.sourceType;
                        if (o.oneofs)
                            d._sourceType = "sourceType";
                    }
                    if (m.title != null && m.hasOwnProperty("title")) {
                        d.title = m.title;
                        if (o.oneofs)
                            d._title = "title";
                    }
                    if (m.description != null && m.hasOwnProperty("description")) {
                        d.description = m.description;
                        if (o.oneofs)
                            d._description = "description";
                    }
                    if (m.thumbnail != null && m.hasOwnProperty("thumbnail")) {
                        d.thumbnail = m.thumbnail;
                        if (o.oneofs)
                            d._thumbnail = "thumbnail";
                    }
                    if (m.thumbnailUrl != null && m.hasOwnProperty("thumbnailUrl")) {
                        d.thumbnailUrl = m.thumbnailUrl;
                        if (o.oneofs)
                            d._thumbnailUrl = "thumbnailUrl";
                    }
                    if (m.mediaType != null && m.hasOwnProperty("mediaType")) {
                        d.mediaType = o.enums === String ? $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[m.mediaType] === undefined ? m.mediaType : $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[m.mediaType] : m.mediaType;
                        if (o.oneofs)
                            d._mediaType = "mediaType";
                    }
                    if (m.mediaUrl != null && m.hasOwnProperty("mediaUrl")) {
                        d.mediaUrl = m.mediaUrl;
                        if (o.oneofs)
                            d._mediaUrl = "mediaUrl";
                    }
                    if (m.isSuspiciousLink != null && m.hasOwnProperty("isSuspiciousLink")) {
                        d.isSuspiciousLink = m.isSuspiciousLink;
                        if (o.oneofs)
                            d._isSuspiciousLink = "isSuspiciousLink";
                    }
                    return d;
                };

                CtwaContextData.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                CtwaContextData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.ChatRowOpaqueData.DraftMessage.CtwaContextData";
                };

                CtwaContextData.ContextInfoExternalAdReplyInfoMediaType = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "NONE"] = 0;
                    values[valuesById[1] = "IMAGE"] = 1;
                    values[valuesById[2] = "VIDEO"] = 2;
                    return values;
                })();

                return CtwaContextData;
            })();

            DraftMessage.CtwaContextLinkData = (function() {

                function CtwaContextLinkData(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                CtwaContextLinkData.prototype.context = null;
                CtwaContextLinkData.prototype.sourceUrl = null;
                CtwaContextLinkData.prototype.icebreaker = null;
                CtwaContextLinkData.prototype.phone = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextLinkData.prototype, "_context", {
                    get: $util.oneOfGetter($oneOfFields = ["context"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextLinkData.prototype, "_sourceUrl", {
                    get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextLinkData.prototype, "_icebreaker", {
                    get: $util.oneOfGetter($oneOfFields = ["icebreaker"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CtwaContextLinkData.prototype, "_phone", {
                    get: $util.oneOfGetter($oneOfFields = ["phone"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                CtwaContextLinkData.create = function create(properties) {
                    return new CtwaContextLinkData(properties);
                };

                CtwaContextLinkData.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.context != null && Object.hasOwnProperty.call(m, "context"))
                        w.uint32(10).string(m.context);
                    if (m.sourceUrl != null && Object.hasOwnProperty.call(m, "sourceUrl"))
                        w.uint32(18).string(m.sourceUrl);
                    if (m.icebreaker != null && Object.hasOwnProperty.call(m, "icebreaker"))
                        w.uint32(26).string(m.icebreaker);
                    if (m.phone != null && Object.hasOwnProperty.call(m, "phone"))
                        w.uint32(34).string(m.phone);
                    return w;
                };

                CtwaContextLinkData.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.context = r.string();
                                break;
                            }
                        case 2: {
                                m.sourceUrl = r.string();
                                break;
                            }
                        case 3: {
                                m.icebreaker = r.string();
                                break;
                            }
                        case 4: {
                                m.phone = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                CtwaContextLinkData.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData)
                        return d;
                    var m = new $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData();
                    if (d.context != null) {
                        m.context = String(d.context);
                    }
                    if (d.sourceUrl != null) {
                        m.sourceUrl = String(d.sourceUrl);
                    }
                    if (d.icebreaker != null) {
                        m.icebreaker = String(d.icebreaker);
                    }
                    if (d.phone != null) {
                        m.phone = String(d.phone);
                    }
                    return m;
                };

                CtwaContextLinkData.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.context != null && m.hasOwnProperty("context")) {
                        d.context = m.context;
                        if (o.oneofs)
                            d._context = "context";
                    }
                    if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) {
                        d.sourceUrl = m.sourceUrl;
                        if (o.oneofs)
                            d._sourceUrl = "sourceUrl";
                    }
                    if (m.icebreaker != null && m.hasOwnProperty("icebreaker")) {
                        d.icebreaker = m.icebreaker;
                        if (o.oneofs)
                            d._icebreaker = "icebreaker";
                    }
                    if (m.phone != null && m.hasOwnProperty("phone")) {
                        d.phone = m.phone;
                        if (o.oneofs)
                            d._phone = "phone";
                    }
                    return d;
                };

                CtwaContextLinkData.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                CtwaContextLinkData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData";
                };

                return CtwaContextLinkData;
            })();

            return DraftMessage;
        })();

        return ChatRowOpaqueData;
    })();

    proto.Citation = (function() {

        function Citation(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Citation.prototype.title = "";
        Citation.prototype.subtitle = "";
        Citation.prototype.cmsId = "";
        Citation.prototype.imageUrl = "";

        Citation.create = function create(properties) {
            return new Citation(properties);
        };

        Citation.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                w.uint32(10).string(m.title);
            if (m.subtitle != null && Object.hasOwnProperty.call(m, "subtitle"))
                w.uint32(18).string(m.subtitle);
            if (m.cmsId != null && Object.hasOwnProperty.call(m, "cmsId"))
                w.uint32(26).string(m.cmsId);
            if (m.imageUrl != null && Object.hasOwnProperty.call(m, "imageUrl"))
                w.uint32(34).string(m.imageUrl);
            return w;
        };

        Citation.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Citation();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.title = r.string();
                        break;
                    }
                case 2: {
                        m.subtitle = r.string();
                        break;
                    }
                case 3: {
                        m.cmsId = r.string();
                        break;
                    }
                case 4: {
                        m.imageUrl = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Citation.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Citation)
                return d;
            var m = new $root.proto.Citation();
            if (d.title != null) {
                m.title = String(d.title);
            }
            if (d.subtitle != null) {
                m.subtitle = String(d.subtitle);
            }
            if (d.cmsId != null) {
                m.cmsId = String(d.cmsId);
            }
            if (d.imageUrl != null) {
                m.imageUrl = String(d.imageUrl);
            }
            return m;
        };

        Citation.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                d.title = "";
                d.subtitle = "";
                d.cmsId = "";
                d.imageUrl = "";
            }
            if (m.title != null && m.hasOwnProperty("title")) {
                d.title = m.title;
            }
            if (m.subtitle != null && m.hasOwnProperty("subtitle")) {
                d.subtitle = m.subtitle;
            }
            if (m.cmsId != null && m.hasOwnProperty("cmsId")) {
                d.cmsId = m.cmsId;
            }
            if (m.imageUrl != null && m.hasOwnProperty("imageUrl")) {
                d.imageUrl = m.imageUrl;
            }
            return d;
        };

        Citation.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Citation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Citation";
        };

        return Citation;
    })();

    proto.ClientPairingProps = (function() {

        function ClientPairingProps(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ClientPairingProps.prototype.isChatDbLidMigrated = null;
        ClientPairingProps.prototype.isSyncdPureLidSession = null;
        ClientPairingProps.prototype.isSyncdSnapshotRecoveryEnabled = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPairingProps.prototype, "_isChatDbLidMigrated", {
            get: $util.oneOfGetter($oneOfFields = ["isChatDbLidMigrated"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPairingProps.prototype, "_isSyncdPureLidSession", {
            get: $util.oneOfGetter($oneOfFields = ["isSyncdPureLidSession"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPairingProps.prototype, "_isSyncdSnapshotRecoveryEnabled", {
            get: $util.oneOfGetter($oneOfFields = ["isSyncdSnapshotRecoveryEnabled"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ClientPairingProps.create = function create(properties) {
            return new ClientPairingProps(properties);
        };

        ClientPairingProps.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.isChatDbLidMigrated != null && Object.hasOwnProperty.call(m, "isChatDbLidMigrated"))
                w.uint32(8).bool(m.isChatDbLidMigrated);
            if (m.isSyncdPureLidSession != null && Object.hasOwnProperty.call(m, "isSyncdPureLidSession"))
                w.uint32(16).bool(m.isSyncdPureLidSession);
            if (m.isSyncdSnapshotRecoveryEnabled != null && Object.hasOwnProperty.call(m, "isSyncdSnapshotRecoveryEnabled"))
                w.uint32(24).bool(m.isSyncdSnapshotRecoveryEnabled);
            return w;
        };

        ClientPairingProps.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPairingProps();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.isChatDbLidMigrated = r.bool();
                        break;
                    }
                case 2: {
                        m.isSyncdPureLidSession = r.bool();
                        break;
                    }
                case 3: {
                        m.isSyncdSnapshotRecoveryEnabled = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ClientPairingProps.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ClientPairingProps)
                return d;
            var m = new $root.proto.ClientPairingProps();
            if (d.isChatDbLidMigrated != null) {
                m.isChatDbLidMigrated = Boolean(d.isChatDbLidMigrated);
            }
            if (d.isSyncdPureLidSession != null) {
                m.isSyncdPureLidSession = Boolean(d.isSyncdPureLidSession);
            }
            if (d.isSyncdSnapshotRecoveryEnabled != null) {
                m.isSyncdSnapshotRecoveryEnabled = Boolean(d.isSyncdSnapshotRecoveryEnabled);
            }
            return m;
        };

        ClientPairingProps.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.isChatDbLidMigrated != null && m.hasOwnProperty("isChatDbLidMigrated")) {
                d.isChatDbLidMigrated = m.isChatDbLidMigrated;
                if (o.oneofs)
                    d._isChatDbLidMigrated = "isChatDbLidMigrated";
            }
            if (m.isSyncdPureLidSession != null && m.hasOwnProperty("isSyncdPureLidSession")) {
                d.isSyncdPureLidSession = m.isSyncdPureLidSession;
                if (o.oneofs)
                    d._isSyncdPureLidSession = "isSyncdPureLidSession";
            }
            if (m.isSyncdSnapshotRecoveryEnabled != null && m.hasOwnProperty("isSyncdSnapshotRecoveryEnabled")) {
                d.isSyncdSnapshotRecoveryEnabled = m.isSyncdSnapshotRecoveryEnabled;
                if (o.oneofs)
                    d._isSyncdSnapshotRecoveryEnabled = "isSyncdSnapshotRecoveryEnabled";
            }
            return d;
        };

        ClientPairingProps.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ClientPairingProps.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ClientPairingProps";
        };

        return ClientPairingProps;
    })();

    proto.ClientPayload = (function() {

        function ClientPayload(p) {
            this.shards = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ClientPayload.prototype.username = null;
        ClientPayload.prototype.passive = null;
        ClientPayload.prototype.userAgent = null;
        ClientPayload.prototype.webInfo = null;
        ClientPayload.prototype.pushName = null;
        ClientPayload.prototype.sessionId = null;
        ClientPayload.prototype.shortConnect = null;
        ClientPayload.prototype.connectType = null;
        ClientPayload.prototype.connectReason = null;
        ClientPayload.prototype.shards = $util.emptyArray;
        ClientPayload.prototype.dnsSource = null;
        ClientPayload.prototype.connectAttemptCount = null;
        ClientPayload.prototype.device = null;
        ClientPayload.prototype.devicePairingData = null;
        ClientPayload.prototype.product = null;
        ClientPayload.prototype.fbCat = null;
        ClientPayload.prototype.fbUserAgent = null;
        ClientPayload.prototype.oc = null;
        ClientPayload.prototype.lc = null;
        ClientPayload.prototype.iosAppExtension = null;
        ClientPayload.prototype.fbAppId = null;
        ClientPayload.prototype.fbDeviceId = null;
        ClientPayload.prototype.pull = null;
        ClientPayload.prototype.paddingBytes = null;
        ClientPayload.prototype.yearClass = null;
        ClientPayload.prototype.memClass = null;
        ClientPayload.prototype.interopData = null;
        ClientPayload.prototype.trafficAnonymization = null;
        ClientPayload.prototype.lidDbMigrated = null;
        ClientPayload.prototype.accountType = null;
        ClientPayload.prototype.connectionSequenceInfo = null;
        ClientPayload.prototype.paaLink = null;
        ClientPayload.prototype.preacksCount = null;
        ClientPayload.prototype.processingQueueSize = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_username", {
            get: $util.oneOfGetter($oneOfFields = ["username"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_passive", {
            get: $util.oneOfGetter($oneOfFields = ["passive"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_userAgent", {
            get: $util.oneOfGetter($oneOfFields = ["userAgent"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_webInfo", {
            get: $util.oneOfGetter($oneOfFields = ["webInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_pushName", {
            get: $util.oneOfGetter($oneOfFields = ["pushName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_sessionId", {
            get: $util.oneOfGetter($oneOfFields = ["sessionId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_shortConnect", {
            get: $util.oneOfGetter($oneOfFields = ["shortConnect"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_connectType", {
            get: $util.oneOfGetter($oneOfFields = ["connectType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_connectReason", {
            get: $util.oneOfGetter($oneOfFields = ["connectReason"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_dnsSource", {
            get: $util.oneOfGetter($oneOfFields = ["dnsSource"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_connectAttemptCount", {
            get: $util.oneOfGetter($oneOfFields = ["connectAttemptCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_device", {
            get: $util.oneOfGetter($oneOfFields = ["device"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_devicePairingData", {
            get: $util.oneOfGetter($oneOfFields = ["devicePairingData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_product", {
            get: $util.oneOfGetter($oneOfFields = ["product"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_fbCat", {
            get: $util.oneOfGetter($oneOfFields = ["fbCat"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_fbUserAgent", {
            get: $util.oneOfGetter($oneOfFields = ["fbUserAgent"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_oc", {
            get: $util.oneOfGetter($oneOfFields = ["oc"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_lc", {
            get: $util.oneOfGetter($oneOfFields = ["lc"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_iosAppExtension", {
            get: $util.oneOfGetter($oneOfFields = ["iosAppExtension"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_fbAppId", {
            get: $util.oneOfGetter($oneOfFields = ["fbAppId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_fbDeviceId", {
            get: $util.oneOfGetter($oneOfFields = ["fbDeviceId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_pull", {
            get: $util.oneOfGetter($oneOfFields = ["pull"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_paddingBytes", {
            get: $util.oneOfGetter($oneOfFields = ["paddingBytes"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_yearClass", {
            get: $util.oneOfGetter($oneOfFields = ["yearClass"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_memClass", {
            get: $util.oneOfGetter($oneOfFields = ["memClass"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_interopData", {
            get: $util.oneOfGetter($oneOfFields = ["interopData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_trafficAnonymization", {
            get: $util.oneOfGetter($oneOfFields = ["trafficAnonymization"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_lidDbMigrated", {
            get: $util.oneOfGetter($oneOfFields = ["lidDbMigrated"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_accountType", {
            get: $util.oneOfGetter($oneOfFields = ["accountType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_connectionSequenceInfo", {
            get: $util.oneOfGetter($oneOfFields = ["connectionSequenceInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_paaLink", {
            get: $util.oneOfGetter($oneOfFields = ["paaLink"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_preacksCount", {
            get: $util.oneOfGetter($oneOfFields = ["preacksCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ClientPayload.prototype, "_processingQueueSize", {
            get: $util.oneOfGetter($oneOfFields = ["processingQueueSize"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ClientPayload.create = function create(properties) {
            return new ClientPayload(properties);
        };

        ClientPayload.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.username != null && Object.hasOwnProperty.call(m, "username"))
                w.uint32(8).uint64(m.username);
            if (m.passive != null && Object.hasOwnProperty.call(m, "passive"))
                w.uint32(24).bool(m.passive);
            if (m.userAgent != null && Object.hasOwnProperty.call(m, "userAgent"))
                $root.proto.ClientPayload.UserAgent.encode(m.userAgent, w.uint32(42).fork()).ldelim();
            if (m.webInfo != null && Object.hasOwnProperty.call(m, "webInfo"))
                $root.proto.ClientPayload.WebInfo.encode(m.webInfo, w.uint32(50).fork()).ldelim();
            if (m.pushName != null && Object.hasOwnProperty.call(m, "pushName"))
                w.uint32(58).string(m.pushName);
            if (m.sessionId != null && Object.hasOwnProperty.call(m, "sessionId"))
                w.uint32(77).sfixed32(m.sessionId);
            if (m.shortConnect != null && Object.hasOwnProperty.call(m, "shortConnect"))
                w.uint32(80).bool(m.shortConnect);
            if (m.connectType != null && Object.hasOwnProperty.call(m, "connectType"))
                w.uint32(96).int32(m.connectType);
            if (m.connectReason != null && Object.hasOwnProperty.call(m, "connectReason"))
                w.uint32(104).int32(m.connectReason);
            if (m.shards != null && m.shards.length) {
                w.uint32(114).fork();
                for (var i = 0; i < m.shards.length; ++i)
                    w.int32(m.shards[i]);
                w.ldelim();
            }
            if (m.dnsSource != null && Object.hasOwnProperty.call(m, "dnsSource"))
                $root.proto.ClientPayload.DNSSource.encode(m.dnsSource, w.uint32(122).fork()).ldelim();
            if (m.connectAttemptCount != null && Object.hasOwnProperty.call(m, "connectAttemptCount"))
                w.uint32(128).uint32(m.connectAttemptCount);
            if (m.device != null && Object.hasOwnProperty.call(m, "device"))
                w.uint32(144).uint32(m.device);
            if (m.devicePairingData != null && Object.hasOwnProperty.call(m, "devicePairingData"))
                $root.proto.ClientPayload.DevicePairingRegistrationData.encode(m.devicePairingData, w.uint32(154).fork()).ldelim();
            if (m.product != null && Object.hasOwnProperty.call(m, "product"))
                w.uint32(160).int32(m.product);
            if (m.fbCat != null && Object.hasOwnProperty.call(m, "fbCat"))
                w.uint32(170).bytes(m.fbCat);
            if (m.fbUserAgent != null && Object.hasOwnProperty.call(m, "fbUserAgent"))
                w.uint32(178).bytes(m.fbUserAgent);
            if (m.oc != null && Object.hasOwnProperty.call(m, "oc"))
                w.uint32(184).bool(m.oc);
            if (m.lc != null && Object.hasOwnProperty.call(m, "lc"))
                w.uint32(192).int32(m.lc);
            if (m.iosAppExtension != null && Object.hasOwnProperty.call(m, "iosAppExtension"))
                w.uint32(240).int32(m.iosAppExtension);
            if (m.fbAppId != null && Object.hasOwnProperty.call(m, "fbAppId"))
                w.uint32(248).uint64(m.fbAppId);
            if (m.fbDeviceId != null && Object.hasOwnProperty.call(m, "fbDeviceId"))
                w.uint32(258).bytes(m.fbDeviceId);
            if (m.pull != null && Object.hasOwnProperty.call(m, "pull"))
                w.uint32(264).bool(m.pull);
            if (m.paddingBytes != null && Object.hasOwnProperty.call(m, "paddingBytes"))
                w.uint32(274).bytes(m.paddingBytes);
            if (m.yearClass != null && Object.hasOwnProperty.call(m, "yearClass"))
                w.uint32(288).int32(m.yearClass);
            if (m.memClass != null && Object.hasOwnProperty.call(m, "memClass"))
                w.uint32(296).int32(m.memClass);
            if (m.interopData != null && Object.hasOwnProperty.call(m, "interopData"))
                $root.proto.ClientPayload.InteropData.encode(m.interopData, w.uint32(306).fork()).ldelim();
            if (m.trafficAnonymization != null && Object.hasOwnProperty.call(m, "trafficAnonymization"))
                w.uint32(320).int32(m.trafficAnonymization);
            if (m.lidDbMigrated != null && Object.hasOwnProperty.call(m, "lidDbMigrated"))
                w.uint32(328).bool(m.lidDbMigrated);
            if (m.accountType != null && Object.hasOwnProperty.call(m, "accountType"))
                w.uint32(336).int32(m.accountType);
            if (m.connectionSequenceInfo != null && Object.hasOwnProperty.call(m, "connectionSequenceInfo"))
                w.uint32(349).sfixed32(m.connectionSequenceInfo);
            if (m.paaLink != null && Object.hasOwnProperty.call(m, "paaLink"))
                w.uint32(352).bool(m.paaLink);
            if (m.preacksCount != null && Object.hasOwnProperty.call(m, "preacksCount"))
                w.uint32(360).int32(m.preacksCount);
            if (m.processingQueueSize != null && Object.hasOwnProperty.call(m, "processingQueueSize"))
                w.uint32(368).int32(m.processingQueueSize);
            return w;
        };

        ClientPayload.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPayload();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.username = r.uint64();
                        break;
                    }
                case 3: {
                        m.passive = r.bool();
                        break;
                    }
                case 5: {
                        m.userAgent = $root.proto.ClientPayload.UserAgent.decode(r, r.uint32());
                        break;
                    }
                case 6: {
                        m.webInfo = $root.proto.ClientPayload.WebInfo.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.pushName = r.string();
                        break;
                    }
                case 9: {
                        m.sessionId = r.sfixed32();
                        break;
                    }
                case 10: {
                        m.shortConnect = r.bool();
                        break;
                    }
                case 12: {
                        m.connectType = r.int32();
                        break;
                    }
                case 13: {
                        m.connectReason = r.int32();
                        break;
                    }
                case 14: {
                        if (!(m.shards && m.shards.length))
                            m.shards = [];
                        if ((t & 7) === 2) {
                            var c2 = r.uint32() + r.pos;
                            while (r.pos < c2)
                                m.shards.push(r.int32());
                        } else
                            m.shards.push(r.int32());
                        break;
                    }
                case 15: {
                        m.dnsSource = $root.proto.ClientPayload.DNSSource.decode(r, r.uint32());
                        break;
                    }
                case 16: {
                        m.connectAttemptCount = r.uint32();
                        break;
                    }
                case 18: {
                        m.device = r.uint32();
                        break;
                    }
                case 19: {
                        m.devicePairingData = $root.proto.ClientPayload.DevicePairingRegistrationData.decode(r, r.uint32());
                        break;
                    }
                case 20: {
                        m.product = r.int32();
                        break;
                    }
                case 21: {
                        m.fbCat = r.bytes();
                        break;
                    }
                case 22: {
                        m.fbUserAgent = r.bytes();
                        break;
                    }
                case 23: {
                        m.oc = r.bool();
                        break;
                    }
                case 24: {
                        m.lc = r.int32();
                        break;
                    }
                case 30: {
                        m.iosAppExtension = r.int32();
                        break;
                    }
                case 31: {
                        m.fbAppId = r.uint64();
                        break;
                    }
                case 32: {
                        m.fbDeviceId = r.bytes();
                        break;
                    }
                case 33: {
                        m.pull = r.bool();
                        break;
                    }
                case 34: {
                        m.paddingBytes = r.bytes();
                        break;
                    }
                case 36: {
                        m.yearClass = r.int32();
                        break;
                    }
                case 37: {
                        m.memClass = r.int32();
                        break;
                    }
                case 38: {
                        m.interopData = $root.proto.ClientPayload.InteropData.decode(r, r.uint32());
                        break;
                    }
                case 40: {
                        m.trafficAnonymization = r.int32();
                        break;
                    }
                case 41: {
                        m.lidDbMigrated = r.bool();
                        break;
                    }
                case 42: {
                        m.accountType = r.int32();
                        break;
                    }
                case 43: {
                        m.connectionSequenceInfo = r.sfixed32();
                        break;
                    }
                case 44: {
                        m.paaLink = r.bool();
                        break;
                    }
                case 45: {
                        m.preacksCount = r.int32();
                        break;
                    }
                case 46: {
                        m.processingQueueSize = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ClientPayload.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ClientPayload)
                return d;
            var m = new $root.proto.ClientPayload();
            if (d.username != null) {
                if ($util.Long)
                    (m.username = $util.Long.fromValue(d.username)).unsigned = true;
                else if (typeof d.username === "string")
                    m.username = parseInt(d.username, 10);
                else if (typeof d.username === "number")
                    m.username = d.username;
                else if (typeof d.username === "object")
                    m.username = new $util.LongBits(d.username.low >>> 0, d.username.high >>> 0).toNumber(true);
            }
            if (d.passive != null) {
                m.passive = Boolean(d.passive);
            }
            if (d.userAgent != null) {
                if (typeof d.userAgent !== "object")
                    throw TypeError(".proto.ClientPayload.userAgent: object expected");
                m.userAgent = $root.proto.ClientPayload.UserAgent.fromObject(d.userAgent);
            }
            if (d.webInfo != null) {
                if (typeof d.webInfo !== "object")
                    throw TypeError(".proto.ClientPayload.webInfo: object expected");
                m.webInfo = $root.proto.ClientPayload.WebInfo.fromObject(d.webInfo);
            }
            if (d.pushName != null) {
                m.pushName = String(d.pushName);
            }
            if (d.sessionId != null) {
                m.sessionId = d.sessionId | 0;
            }
            if (d.shortConnect != null) {
                m.shortConnect = Boolean(d.shortConnect);
            }
            switch (d.connectType) {
            default:
                if (typeof d.connectType === "number") {
                    m.connectType = d.connectType;
                    break;
                }
                break;
            case "CELLULAR_UNKNOWN":
            case 0:
                m.connectType = 0;
                break;
            case "WIFI_UNKNOWN":
            case 1:
                m.connectType = 1;
                break;
            case "CELLULAR_EDGE":
            case 100:
                m.connectType = 100;
                break;
            case "CELLULAR_IDEN":
            case 101:
                m.connectType = 101;
                break;
            case "CELLULAR_UMTS":
            case 102:
                m.connectType = 102;
                break;
            case "CELLULAR_EVDO":
            case 103:
                m.connectType = 103;
                break;
            case "CELLULAR_GPRS":
            case 104:
                m.connectType = 104;
                break;
            case "CELLULAR_HSDPA":
            case 105:
                m.connectType = 105;
                break;
            case "CELLULAR_HSUPA":
            case 106:
                m.connectType = 106;
                break;
            case "CELLULAR_HSPA":
            case 107:
                m.connectType = 107;
                break;
            case "CELLULAR_CDMA":
            case 108:
                m.connectType = 108;
                break;
            case "CELLULAR_1XRTT":
            case 109:
                m.connectType = 109;
                break;
            case "CELLULAR_EHRPD":
            case 110:
                m.connectType = 110;
                break;
            case "CELLULAR_LTE":
            case 111:
                m.connectType = 111;
                break;
            case "CELLULAR_HSPAP":
            case 112:
                m.connectType = 112;
                break;
            }
            switch (d.connectReason) {
            default:
                if (typeof d.connectReason === "number") {
                    m.connectReason = d.connectReason;
                    break;
                }
                break;
            case "PUSH":
            case 0:
                m.connectReason = 0;
                break;
            case "USER_ACTIVATED":
            case 1:
                m.connectReason = 1;
                break;
            case "SCHEDULED":
            case 2:
                m.connectReason = 2;
                break;
            case "ERROR_RECONNECT":
            case 3:
                m.connectReason = 3;
                break;
            case "NETWORK_SWITCH":
            case 4:
                m.connectReason = 4;
                break;
            case "PING_RECONNECT":
            case 5:
                m.connectReason = 5;
                break;
            case "UNKNOWN":
            case 6:
                m.connectReason = 6;
                break;
            }
            if (d.shards) {
                if (!Array.isArray(d.shards))
                    throw TypeError(".proto.ClientPayload.shards: array expected");
                m.shards = [];
                for (var i = 0; i < d.shards.length; ++i) {
                    m.shards[i] = d.shards[i] | 0;
                }
            }
            if (d.dnsSource != null) {
                if (typeof d.dnsSource !== "object")
                    throw TypeError(".proto.ClientPayload.dnsSource: object expected");
                m.dnsSource = $root.proto.ClientPayload.DNSSource.fromObject(d.dnsSource);
            }
            if (d.connectAttemptCount != null) {
                m.connectAttemptCount = d.connectAttemptCount >>> 0;
            }
            if (d.device != null) {
                m.device = d.device >>> 0;
            }
            if (d.devicePairingData != null) {
                if (typeof d.devicePairingData !== "object")
                    throw TypeError(".proto.ClientPayload.devicePairingData: object expected");
                m.devicePairingData = $root.proto.ClientPayload.DevicePairingRegistrationData.fromObject(d.devicePairingData);
            }
            switch (d.product) {
            default:
                if (typeof d.product === "number") {
                    m.product = d.product;
                    break;
                }
                break;
            case "WHATSAPP":
            case 0:
                m.product = 0;
                break;
            case "MESSENGER":
            case 1:
                m.product = 1;
                break;
            case "INTEROP":
            case 2:
                m.product = 2;
                break;
            case "INTEROP_MSGR":
            case 3:
                m.product = 3;
                break;
            case "WHATSAPP_LID":
            case 4:
                m.product = 4;
                break;
            }
            if (d.fbCat != null) {
                if (typeof d.fbCat === "string")
                    $util.base64.decode(d.fbCat, m.fbCat = $util.newBuffer($util.base64.length(d.fbCat)), 0);
                else if (d.fbCat.length >= 0)
                    m.fbCat = d.fbCat;
            }
            if (d.fbUserAgent != null) {
                if (typeof d.fbUserAgent === "string")
                    $util.base64.decode(d.fbUserAgent, m.fbUserAgent = $util.newBuffer($util.base64.length(d.fbUserAgent)), 0);
                else if (d.fbUserAgent.length >= 0)
                    m.fbUserAgent = d.fbUserAgent;
            }
            if (d.oc != null) {
                m.oc = Boolean(d.oc);
            }
            if (d.lc != null) {
                m.lc = d.lc | 0;
            }
            switch (d.iosAppExtension) {
            default:
                if (typeof d.iosAppExtension === "number") {
                    m.iosAppExtension = d.iosAppExtension;
                    break;
                }
                break;
            case "SHARE_EXTENSION":
            case 0:
                m.iosAppExtension = 0;
                break;
            case "SERVICE_EXTENSION":
            case 1:
                m.iosAppExtension = 1;
                break;
            case "INTENTS_EXTENSION":
            case 2:
                m.iosAppExtension = 2;
                break;
            }
            if (d.fbAppId != null) {
                if ($util.Long)
                    (m.fbAppId = $util.Long.fromValue(d.fbAppId)).unsigned = true;
                else if (typeof d.fbAppId === "string")
                    m.fbAppId = parseInt(d.fbAppId, 10);
                else if (typeof d.fbAppId === "number")
                    m.fbAppId = d.fbAppId;
                else if (typeof d.fbAppId === "object")
                    m.fbAppId = new $util.LongBits(d.fbAppId.low >>> 0, d.fbAppId.high >>> 0).toNumber(true);
            }
            if (d.fbDeviceId != null) {
                if (typeof d.fbDeviceId === "string")
                    $util.base64.decode(d.fbDeviceId, m.fbDeviceId = $util.newBuffer($util.base64.length(d.fbDeviceId)), 0);
                else if (d.fbDeviceId.length >= 0)
                    m.fbDeviceId = d.fbDeviceId;
            }
            if (d.pull != null) {
                m.pull = Boolean(d.pull);
            }
            if (d.paddingBytes != null) {
                if (typeof d.paddingBytes === "string")
                    $util.base64.decode(d.paddingBytes, m.paddingBytes = $util.newBuffer($util.base64.length(d.paddingBytes)), 0);
                else if (d.paddingBytes.length >= 0)
                    m.paddingBytes = d.paddingBytes;
            }
            if (d.yearClass != null) {
                m.yearClass = d.yearClass | 0;
            }
            if (d.memClass != null) {
                m.memClass = d.memClass | 0;
            }
            if (d.interopData != null) {
                if (typeof d.interopData !== "object")
                    throw TypeError(".proto.ClientPayload.interopData: object expected");
                m.interopData = $root.proto.ClientPayload.InteropData.fromObject(d.interopData);
            }
            switch (d.trafficAnonymization) {
            default:
                if (typeof d.trafficAnonymization === "number") {
                    m.trafficAnonymization = d.trafficAnonymization;
                    break;
                }
                break;
            case "OFF":
            case 0:
                m.trafficAnonymization = 0;
                break;
            case "STANDARD":
            case 1:
                m.trafficAnonymization = 1;
                break;
            }
            if (d.lidDbMigrated != null) {
                m.lidDbMigrated = Boolean(d.lidDbMigrated);
            }
            switch (d.accountType) {
            default:
                if (typeof d.accountType === "number") {
                    m.accountType = d.accountType;
                    break;
                }
                break;
            case "DEFAULT":
            case 0:
                m.accountType = 0;
                break;
            case "GUEST":
            case 1:
                m.accountType = 1;
                break;
            }
            if (d.connectionSequenceInfo != null) {
                m.connectionSequenceInfo = d.connectionSequenceInfo | 0;
            }
            if (d.paaLink != null) {
                m.paaLink = Boolean(d.paaLink);
            }
            if (d.preacksCount != null) {
                m.preacksCount = d.preacksCount | 0;
            }
            if (d.processingQueueSize != null) {
                m.processingQueueSize = d.processingQueueSize | 0;
            }
            return m;
        };

        ClientPayload.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.shards = [];
            }
            if (m.username != null && m.hasOwnProperty("username")) {
                if (typeof m.username === "number")
                    d.username = o.longs === String ? String(m.username) : m.username;
                else
                    d.username = o.longs === String ? longToString(m.username, true) : o.longs === Number ? longToNumber(m.username, true) : m.username;
                if (o.oneofs)
                    d._username = "username";
            }
            if (m.passive != null && m.hasOwnProperty("passive")) {
                d.passive = m.passive;
                if (o.oneofs)
                    d._passive = "passive";
            }
            if (m.userAgent != null && m.hasOwnProperty("userAgent")) {
                d.userAgent = $root.proto.ClientPayload.UserAgent.toObject(m.userAgent, o);
                if (o.oneofs)
                    d._userAgent = "userAgent";
            }
            if (m.webInfo != null && m.hasOwnProperty("webInfo")) {
                d.webInfo = $root.proto.ClientPayload.WebInfo.toObject(m.webInfo, o);
                if (o.oneofs)
                    d._webInfo = "webInfo";
            }
            if (m.pushName != null && m.hasOwnProperty("pushName")) {
                d.pushName = m.pushName;
                if (o.oneofs)
                    d._pushName = "pushName";
            }
            if (m.sessionId != null && m.hasOwnProperty("sessionId")) {
                d.sessionId = m.sessionId;
                if (o.oneofs)
                    d._sessionId = "sessionId";
            }
            if (m.shortConnect != null && m.hasOwnProperty("shortConnect")) {
                d.shortConnect = m.shortConnect;
                if (o.oneofs)
                    d._shortConnect = "shortConnect";
            }
            if (m.connectType != null && m.hasOwnProperty("connectType")) {
                d.connectType = o.enums === String ? $root.proto.ClientPayload.ConnectType[m.connectType] === undefined ? m.connectType : $root.proto.ClientPayload.ConnectType[m.connectType] : m.connectType;
                if (o.oneofs)
                    d._connectType = "connectType";
            }
            if (m.connectReason != null && m.hasOwnProperty("connectReason")) {
                d.connectReason = o.enums === String ? $root.proto.ClientPayload.ConnectReason[m.connectReason] === undefined ? m.connectReason : $root.proto.ClientPayload.ConnectReason[m.connectReason] : m.connectReason;
                if (o.oneofs)
                    d._connectReason = "connectReason";
            }
            if (m.shards && m.shards.length) {
                d.shards = [];
                for (var j = 0; j < m.shards.length; ++j) {
                    d.shards[j] = m.shards[j];
                }
            }
            if (m.dnsSource != null && m.hasOwnProperty("dnsSource")) {
                d.dnsSource = $root.proto.ClientPayload.DNSSource.toObject(m.dnsSource, o);
                if (o.oneofs)
                    d._dnsSource = "dnsSource";
            }
            if (m.connectAttemptCount != null && m.hasOwnProperty("connectAttemptCount")) {
                d.connectAttemptCount = m.connectAttemptCount;
                if (o.oneofs)
                    d._connectAttemptCount = "connectAttemptCount";
            }
            if (m.device != null && m.hasOwnProperty("device")) {
                d.device = m.device;
                if (o.oneofs)
                    d._device = "device";
            }
            if (m.devicePairingData != null && m.hasOwnProperty("devicePairingData")) {
                d.devicePairingData = $root.proto.ClientPayload.DevicePairingRegistrationData.toObject(m.devicePairingData, o);
                if (o.oneofs)
                    d._devicePairingData = "devicePairingData";
            }
            if (m.product != null && m.hasOwnProperty("product")) {
                d.product = o.enums === String ? $root.proto.ClientPayload.Product[m.product] === undefined ? m.product : $root.proto.ClientPayload.Product[m.product] : m.product;
                if (o.oneofs)
                    d._product = "product";
            }
            if (m.fbCat != null && m.hasOwnProperty("fbCat")) {
                d.fbCat = o.bytes === String ? $util.base64.encode(m.fbCat, 0, m.fbCat.length) : o.bytes === Array ? Array.prototype.slice.call(m.fbCat) : m.fbCat;
                if (o.oneofs)
                    d._fbCat = "fbCat";
            }
            if (m.fbUserAgent != null && m.hasOwnProperty("fbUserAgent")) {
                d.fbUserAgent = o.bytes === String ? $util.base64.encode(m.fbUserAgent, 0, m.fbUserAgent.length) : o.bytes === Array ? Array.prototype.slice.call(m.fbUserAgent) : m.fbUserAgent;
                if (o.oneofs)
                    d._fbUserAgent = "fbUserAgent";
            }
            if (m.oc != null && m.hasOwnProperty("oc")) {
                d.oc = m.oc;
                if (o.oneofs)
                    d._oc = "oc";
            }
            if (m.lc != null && m.hasOwnProperty("lc")) {
                d.lc = m.lc;
                if (o.oneofs)
                    d._lc = "lc";
            }
            if (m.iosAppExtension != null && m.hasOwnProperty("iosAppExtension")) {
                d.iosAppExtension = o.enums === String ? $root.proto.ClientPayload.IOSAppExtension[m.iosAppExtension] === undefined ? m.iosAppExtension : $root.proto.ClientPayload.IOSAppExtension[m.iosAppExtension] : m.iosAppExtension;
                if (o.oneofs)
                    d._iosAppExtension = "iosAppExtension";
            }
            if (m.fbAppId != null && m.hasOwnProperty("fbAppId")) {
                if (typeof m.fbAppId === "number")
                    d.fbAppId = o.longs === String ? String(m.fbAppId) : m.fbAppId;
                else
                    d.fbAppId = o.longs === String ? longToString(m.fbAppId, true) : o.longs === Number ? longToNumber(m.fbAppId, true) : m.fbAppId;
                if (o.oneofs)
                    d._fbAppId = "fbAppId";
            }
            if (m.fbDeviceId != null && m.hasOwnProperty("fbDeviceId")) {
                d.fbDeviceId = o.bytes === String ? $util.base64.encode(m.fbDeviceId, 0, m.fbDeviceId.length) : o.bytes === Array ? Array.prototype.slice.call(m.fbDeviceId) : m.fbDeviceId;
                if (o.oneofs)
                    d._fbDeviceId = "fbDeviceId";
            }
            if (m.pull != null && m.hasOwnProperty("pull")) {
                d.pull = m.pull;
                if (o.oneofs)
                    d._pull = "pull";
            }
            if (m.paddingBytes != null && m.hasOwnProperty("paddingBytes")) {
                d.paddingBytes = o.bytes === String ? $util.base64.encode(m.paddingBytes, 0, m.paddingBytes.length) : o.bytes === Array ? Array.prototype.slice.call(m.paddingBytes) : m.paddingBytes;
                if (o.oneofs)
                    d._paddingBytes = "paddingBytes";
            }
            if (m.yearClass != null && m.hasOwnProperty("yearClass")) {
                d.yearClass = m.yearClass;
                if (o.oneofs)
                    d._yearClass = "yearClass";
            }
            if (m.memClass != null && m.hasOwnProperty("memClass")) {
                d.memClass = m.memClass;
                if (o.oneofs)
                    d._memClass = "memClass";
            }
            if (m.interopData != null && m.hasOwnProperty("interopData")) {
                d.interopData = $root.proto.ClientPayload.InteropData.toObject(m.interopData, o);
                if (o.oneofs)
                    d._interopData = "interopData";
            }
            if (m.trafficAnonymization != null && m.hasOwnProperty("trafficAnonymization")) {
                d.trafficAnonymization = o.enums === String ? $root.proto.ClientPayload.TrafficAnonymization[m.trafficAnonymization] === undefined ? m.trafficAnonymization : $root.proto.ClientPayload.TrafficAnonymization[m.trafficAnonymization] : m.trafficAnonymization;
                if (o.oneofs)
                    d._trafficAnonymization = "trafficAnonymization";
            }
            if (m.lidDbMigrated != null && m.hasOwnProperty("lidDbMigrated")) {
                d.lidDbMigrated = m.lidDbMigrated;
                if (o.oneofs)
                    d._lidDbMigrated = "lidDbMigrated";
            }
            if (m.accountType != null && m.hasOwnProperty("accountType")) {
                d.accountType = o.enums === String ? $root.proto.ClientPayload.AccountType[m.accountType] === undefined ? m.accountType : $root.proto.ClientPayload.AccountType[m.accountType] : m.accountType;
                if (o.oneofs)
                    d._accountType = "accountType";
            }
            if (m.connectionSequenceInfo != null && m.hasOwnProperty("connectionSequenceInfo")) {
                d.connectionSequenceInfo = m.connectionSequenceInfo;
                if (o.oneofs)
                    d._connectionSequenceInfo = "connectionSequenceInfo";
            }
            if (m.paaLink != null && m.hasOwnProperty("paaLink")) {
                d.paaLink = m.paaLink;
                if (o.oneofs)
                    d._paaLink = "paaLink";
            }
            if (m.preacksCount != null && m.hasOwnProperty("preacksCount")) {
                d.preacksCount = m.preacksCount;
                if (o.oneofs)
                    d._preacksCount = "preacksCount";
            }
            if (m.processingQueueSize != null && m.hasOwnProperty("processingQueueSize")) {
                d.processingQueueSize = m.processingQueueSize;
                if (o.oneofs)
                    d._processingQueueSize = "processingQueueSize";
            }
            return d;
        };

        ClientPayload.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ClientPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ClientPayload";
        };

        ClientPayload.AccountType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "DEFAULT"] = 0;
            values[valuesById[1] = "GUEST"] = 1;
            return values;
        })();

        ClientPayload.ConnectReason = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "PUSH"] = 0;
            values[valuesById[1] = "USER_ACTIVATED"] = 1;
            values[valuesById[2] = "SCHEDULED"] = 2;
            values[valuesById[3] = "ERROR_RECONNECT"] = 3;
            values[valuesById[4] = "NETWORK_SWITCH"] = 4;
            values[valuesById[5] = "PING_RECONNECT"] = 5;
            values[valuesById[6] = "UNKNOWN"] = 6;
            return values;
        })();

        ClientPayload.ConnectType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "CELLULAR_UNKNOWN"] = 0;
            values[valuesById[1] = "WIFI_UNKNOWN"] = 1;
            values[valuesById[100] = "CELLULAR_EDGE"] = 100;
            values[valuesById[101] = "CELLULAR_IDEN"] = 101;
            values[valuesById[102] = "CELLULAR_UMTS"] = 102;
            values[valuesById[103] = "CELLULAR_EVDO"] = 103;
            values[valuesById[104] = "CELLULAR_GPRS"] = 104;
            values[valuesById[105] = "CELLULAR_HSDPA"] = 105;
            values[valuesById[106] = "CELLULAR_HSUPA"] = 106;
            values[valuesById[107] = "CELLULAR_HSPA"] = 107;
            values[valuesById[108] = "CELLULAR_CDMA"] = 108;
            values[valuesById[109] = "CELLULAR_1XRTT"] = 109;
            values[valuesById[110] = "CELLULAR_EHRPD"] = 110;
            values[valuesById[111] = "CELLULAR_LTE"] = 111;
            values[valuesById[112] = "CELLULAR_HSPAP"] = 112;
            return values;
        })();

        ClientPayload.DNSSource = (function() {

            function DNSSource(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DNSSource.prototype.dnsMethod = null;
            DNSSource.prototype.appCached = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DNSSource.prototype, "_dnsMethod", {
                get: $util.oneOfGetter($oneOfFields = ["dnsMethod"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DNSSource.prototype, "_appCached", {
                get: $util.oneOfGetter($oneOfFields = ["appCached"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DNSSource.create = function create(properties) {
                return new DNSSource(properties);
            };

            DNSSource.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.dnsMethod != null && Object.hasOwnProperty.call(m, "dnsMethod"))
                    w.uint32(120).int32(m.dnsMethod);
                if (m.appCached != null && Object.hasOwnProperty.call(m, "appCached"))
                    w.uint32(128).bool(m.appCached);
                return w;
            };

            DNSSource.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPayload.DNSSource();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 15: {
                            m.dnsMethod = r.int32();
                            break;
                        }
                    case 16: {
                            m.appCached = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DNSSource.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ClientPayload.DNSSource)
                    return d;
                var m = new $root.proto.ClientPayload.DNSSource();
                switch (d.dnsMethod) {
                default:
                    if (typeof d.dnsMethod === "number") {
                        m.dnsMethod = d.dnsMethod;
                        break;
                    }
                    break;
                case "SYSTEM":
                case 0:
                    m.dnsMethod = 0;
                    break;
                case "GOOGLE":
                case 1:
                    m.dnsMethod = 1;
                    break;
                case "HARDCODED":
                case 2:
                    m.dnsMethod = 2;
                    break;
                case "OVERRIDE":
                case 3:
                    m.dnsMethod = 3;
                    break;
                case "FALLBACK":
                case 4:
                    m.dnsMethod = 4;
                    break;
                case "MNS":
                case 5:
                    m.dnsMethod = 5;
                    break;
                }
                if (d.appCached != null) {
                    m.appCached = Boolean(d.appCached);
                }
                return m;
            };

            DNSSource.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.dnsMethod != null && m.hasOwnProperty("dnsMethod")) {
                    d.dnsMethod = o.enums === String ? $root.proto.ClientPayload.DNSSource.DNSResolutionMethod[m.dnsMethod] === undefined ? m.dnsMethod : $root.proto.ClientPayload.DNSSource.DNSResolutionMethod[m.dnsMethod] : m.dnsMethod;
                    if (o.oneofs)
                        d._dnsMethod = "dnsMethod";
                }
                if (m.appCached != null && m.hasOwnProperty("appCached")) {
                    d.appCached = m.appCached;
                    if (o.oneofs)
                        d._appCached = "appCached";
                }
                return d;
            };

            DNSSource.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DNSSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ClientPayload.DNSSource";
            };

            DNSSource.DNSResolutionMethod = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "SYSTEM"] = 0;
                values[valuesById[1] = "GOOGLE"] = 1;
                values[valuesById[2] = "HARDCODED"] = 2;
                values[valuesById[3] = "OVERRIDE"] = 3;
                values[valuesById[4] = "FALLBACK"] = 4;
                values[valuesById[5] = "MNS"] = 5;
                return values;
            })();

            return DNSSource;
        })();

        ClientPayload.DevicePairingRegistrationData = (function() {

            function DevicePairingRegistrationData(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DevicePairingRegistrationData.prototype.eRegid = null;
            DevicePairingRegistrationData.prototype.eKeytype = null;
            DevicePairingRegistrationData.prototype.eIdent = null;
            DevicePairingRegistrationData.prototype.eSkeyId = null;
            DevicePairingRegistrationData.prototype.eSkeyVal = null;
            DevicePairingRegistrationData.prototype.eSkeySig = null;
            DevicePairingRegistrationData.prototype.buildHash = null;
            DevicePairingRegistrationData.prototype.deviceProps = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DevicePairingRegistrationData.prototype, "_eRegid", {
                get: $util.oneOfGetter($oneOfFields = ["eRegid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DevicePairingRegistrationData.prototype, "_eKeytype", {
                get: $util.oneOfGetter($oneOfFields = ["eKeytype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DevicePairingRegistrationData.prototype, "_eIdent", {
                get: $util.oneOfGetter($oneOfFields = ["eIdent"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeyId", {
                get: $util.oneOfGetter($oneOfFields = ["eSkeyId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeyVal", {
                get: $util.oneOfGetter($oneOfFields = ["eSkeyVal"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeySig", {
                get: $util.oneOfGetter($oneOfFields = ["eSkeySig"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DevicePairingRegistrationData.prototype, "_buildHash", {
                get: $util.oneOfGetter($oneOfFields = ["buildHash"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DevicePairingRegistrationData.prototype, "_deviceProps", {
                get: $util.oneOfGetter($oneOfFields = ["deviceProps"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DevicePairingRegistrationData.create = function create(properties) {
                return new DevicePairingRegistrationData(properties);
            };

            DevicePairingRegistrationData.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.eRegid != null && Object.hasOwnProperty.call(m, "eRegid"))
                    w.uint32(10).bytes(m.eRegid);
                if (m.eKeytype != null && Object.hasOwnProperty.call(m, "eKeytype"))
                    w.uint32(18).bytes(m.eKeytype);
                if (m.eIdent != null && Object.hasOwnProperty.call(m, "eIdent"))
                    w.uint32(26).bytes(m.eIdent);
                if (m.eSkeyId != null && Object.hasOwnProperty.call(m, "eSkeyId"))
                    w.uint32(34).bytes(m.eSkeyId);
                if (m.eSkeyVal != null && Object.hasOwnProperty.call(m, "eSkeyVal"))
                    w.uint32(42).bytes(m.eSkeyVal);
                if (m.eSkeySig != null && Object.hasOwnProperty.call(m, "eSkeySig"))
                    w.uint32(50).bytes(m.eSkeySig);
                if (m.buildHash != null && Object.hasOwnProperty.call(m, "buildHash"))
                    w.uint32(58).bytes(m.buildHash);
                if (m.deviceProps != null && Object.hasOwnProperty.call(m, "deviceProps"))
                    w.uint32(66).bytes(m.deviceProps);
                return w;
            };

            DevicePairingRegistrationData.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPayload.DevicePairingRegistrationData();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.eRegid = r.bytes();
                            break;
                        }
                    case 2: {
                            m.eKeytype = r.bytes();
                            break;
                        }
                    case 3: {
                            m.eIdent = r.bytes();
                            break;
                        }
                    case 4: {
                            m.eSkeyId = r.bytes();
                            break;
                        }
                    case 5: {
                            m.eSkeyVal = r.bytes();
                            break;
                        }
                    case 6: {
                            m.eSkeySig = r.bytes();
                            break;
                        }
                    case 7: {
                            m.buildHash = r.bytes();
                            break;
                        }
                    case 8: {
                            m.deviceProps = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DevicePairingRegistrationData.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ClientPayload.DevicePairingRegistrationData)
                    return d;
                var m = new $root.proto.ClientPayload.DevicePairingRegistrationData();
                if (d.eRegid != null) {
                    if (typeof d.eRegid === "string")
                        $util.base64.decode(d.eRegid, m.eRegid = $util.newBuffer($util.base64.length(d.eRegid)), 0);
                    else if (d.eRegid.length >= 0)
                        m.eRegid = d.eRegid;
                }
                if (d.eKeytype != null) {
                    if (typeof d.eKeytype === "string")
                        $util.base64.decode(d.eKeytype, m.eKeytype = $util.newBuffer($util.base64.length(d.eKeytype)), 0);
                    else if (d.eKeytype.length >= 0)
                        m.eKeytype = d.eKeytype;
                }
                if (d.eIdent != null) {
                    if (typeof d.eIdent === "string")
                        $util.base64.decode(d.eIdent, m.eIdent = $util.newBuffer($util.base64.length(d.eIdent)), 0);
                    else if (d.eIdent.length >= 0)
                        m.eIdent = d.eIdent;
                }
                if (d.eSkeyId != null) {
                    if (typeof d.eSkeyId === "string")
                        $util.base64.decode(d.eSkeyId, m.eSkeyId = $util.newBuffer($util.base64.length(d.eSkeyId)), 0);
                    else if (d.eSkeyId.length >= 0)
                        m.eSkeyId = d.eSkeyId;
                }
                if (d.eSkeyVal != null) {
                    if (typeof d.eSkeyVal === "string")
                        $util.base64.decode(d.eSkeyVal, m.eSkeyVal = $util.newBuffer($util.base64.length(d.eSkeyVal)), 0);
                    else if (d.eSkeyVal.length >= 0)
                        m.eSkeyVal = d.eSkeyVal;
                }
                if (d.eSkeySig != null) {
                    if (typeof d.eSkeySig === "string")
                        $util.base64.decode(d.eSkeySig, m.eSkeySig = $util.newBuffer($util.base64.length(d.eSkeySig)), 0);
                    else if (d.eSkeySig.length >= 0)
                        m.eSkeySig = d.eSkeySig;
                }
                if (d.buildHash != null) {
                    if (typeof d.buildHash === "string")
                        $util.base64.decode(d.buildHash, m.buildHash = $util.newBuffer($util.base64.length(d.buildHash)), 0);
                    else if (d.buildHash.length >= 0)
                        m.buildHash = d.buildHash;
                }
                if (d.deviceProps != null) {
                    if (typeof d.deviceProps === "string")
                        $util.base64.decode(d.deviceProps, m.deviceProps = $util.newBuffer($util.base64.length(d.deviceProps)), 0);
                    else if (d.deviceProps.length >= 0)
                        m.deviceProps = d.deviceProps;
                }
                return m;
            };

            DevicePairingRegistrationData.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.eRegid != null && m.hasOwnProperty("eRegid")) {
                    d.eRegid = o.bytes === String ? $util.base64.encode(m.eRegid, 0, m.eRegid.length) : o.bytes === Array ? Array.prototype.slice.call(m.eRegid) : m.eRegid;
                    if (o.oneofs)
                        d._eRegid = "eRegid";
                }
                if (m.eKeytype != null && m.hasOwnProperty("eKeytype")) {
                    d.eKeytype = o.bytes === String ? $util.base64.encode(m.eKeytype, 0, m.eKeytype.length) : o.bytes === Array ? Array.prototype.slice.call(m.eKeytype) : m.eKeytype;
                    if (o.oneofs)
                        d._eKeytype = "eKeytype";
                }
                if (m.eIdent != null && m.hasOwnProperty("eIdent")) {
                    d.eIdent = o.bytes === String ? $util.base64.encode(m.eIdent, 0, m.eIdent.length) : o.bytes === Array ? Array.prototype.slice.call(m.eIdent) : m.eIdent;
                    if (o.oneofs)
                        d._eIdent = "eIdent";
                }
                if (m.eSkeyId != null && m.hasOwnProperty("eSkeyId")) {
                    d.eSkeyId = o.bytes === String ? $util.base64.encode(m.eSkeyId, 0, m.eSkeyId.length) : o.bytes === Array ? Array.prototype.slice.call(m.eSkeyId) : m.eSkeyId;
                    if (o.oneofs)
                        d._eSkeyId = "eSkeyId";
                }
                if (m.eSkeyVal != null && m.hasOwnProperty("eSkeyVal")) {
                    d.eSkeyVal = o.bytes === String ? $util.base64.encode(m.eSkeyVal, 0, m.eSkeyVal.length) : o.bytes === Array ? Array.prototype.slice.call(m.eSkeyVal) : m.eSkeyVal;
                    if (o.oneofs)
                        d._eSkeyVal = "eSkeyVal";
                }
                if (m.eSkeySig != null && m.hasOwnProperty("eSkeySig")) {
                    d.eSkeySig = o.bytes === String ? $util.base64.encode(m.eSkeySig, 0, m.eSkeySig.length) : o.bytes === Array ? Array.prototype.slice.call(m.eSkeySig) : m.eSkeySig;
                    if (o.oneofs)
                        d._eSkeySig = "eSkeySig";
                }
                if (m.buildHash != null && m.hasOwnProperty("buildHash")) {
                    d.buildHash = o.bytes === String ? $util.base64.encode(m.buildHash, 0, m.buildHash.length) : o.bytes === Array ? Array.prototype.slice.call(m.buildHash) : m.buildHash;
                    if (o.oneofs)
                        d._buildHash = "buildHash";
                }
                if (m.deviceProps != null && m.hasOwnProperty("deviceProps")) {
                    d.deviceProps = o.bytes === String ? $util.base64.encode(m.deviceProps, 0, m.deviceProps.length) : o.bytes === Array ? Array.prototype.slice.call(m.deviceProps) : m.deviceProps;
                    if (o.oneofs)
                        d._deviceProps = "deviceProps";
                }
                return d;
            };

            DevicePairingRegistrationData.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DevicePairingRegistrationData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ClientPayload.DevicePairingRegistrationData";
            };

            return DevicePairingRegistrationData;
        })();

        ClientPayload.IOSAppExtension = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "SHARE_EXTENSION"] = 0;
            values[valuesById[1] = "SERVICE_EXTENSION"] = 1;
            values[valuesById[2] = "INTENTS_EXTENSION"] = 2;
            return values;
        })();

        ClientPayload.InteropData = (function() {

            function InteropData(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InteropData.prototype.accountId = null;
            InteropData.prototype.token = null;
            InteropData.prototype.enableReadReceipts = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteropData.prototype, "_accountId", {
                get: $util.oneOfGetter($oneOfFields = ["accountId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteropData.prototype, "_token", {
                get: $util.oneOfGetter($oneOfFields = ["token"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteropData.prototype, "_enableReadReceipts", {
                get: $util.oneOfGetter($oneOfFields = ["enableReadReceipts"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            InteropData.create = function create(properties) {
                return new InteropData(properties);
            };

            InteropData.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId"))
                    w.uint32(8).uint64(m.accountId);
                if (m.token != null && Object.hasOwnProperty.call(m, "token"))
                    w.uint32(18).bytes(m.token);
                if (m.enableReadReceipts != null && Object.hasOwnProperty.call(m, "enableReadReceipts"))
                    w.uint32(24).bool(m.enableReadReceipts);
                return w;
            };

            InteropData.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPayload.InteropData();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.accountId = r.uint64();
                            break;
                        }
                    case 2: {
                            m.token = r.bytes();
                            break;
                        }
                    case 3: {
                            m.enableReadReceipts = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InteropData.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ClientPayload.InteropData)
                    return d;
                var m = new $root.proto.ClientPayload.InteropData();
                if (d.accountId != null) {
                    if ($util.Long)
                        (m.accountId = $util.Long.fromValue(d.accountId)).unsigned = true;
                    else if (typeof d.accountId === "string")
                        m.accountId = parseInt(d.accountId, 10);
                    else if (typeof d.accountId === "number")
                        m.accountId = d.accountId;
                    else if (typeof d.accountId === "object")
                        m.accountId = new $util.LongBits(d.accountId.low >>> 0, d.accountId.high >>> 0).toNumber(true);
                }
                if (d.token != null) {
                    if (typeof d.token === "string")
                        $util.base64.decode(d.token, m.token = $util.newBuffer($util.base64.length(d.token)), 0);
                    else if (d.token.length >= 0)
                        m.token = d.token;
                }
                if (d.enableReadReceipts != null) {
                    m.enableReadReceipts = Boolean(d.enableReadReceipts);
                }
                return m;
            };

            InteropData.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.accountId != null && m.hasOwnProperty("accountId")) {
                    if (typeof m.accountId === "number")
                        d.accountId = o.longs === String ? String(m.accountId) : m.accountId;
                    else
                        d.accountId = o.longs === String ? longToString(m.accountId, true) : o.longs === Number ? longToNumber(m.accountId, true) : m.accountId;
                    if (o.oneofs)
                        d._accountId = "accountId";
                }
                if (m.token != null && m.hasOwnProperty("token")) {
                    d.token = o.bytes === String ? $util.base64.encode(m.token, 0, m.token.length) : o.bytes === Array ? Array.prototype.slice.call(m.token) : m.token;
                    if (o.oneofs)
                        d._token = "token";
                }
                if (m.enableReadReceipts != null && m.hasOwnProperty("enableReadReceipts")) {
                    d.enableReadReceipts = m.enableReadReceipts;
                    if (o.oneofs)
                        d._enableReadReceipts = "enableReadReceipts";
                }
                return d;
            };

            InteropData.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InteropData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ClientPayload.InteropData";
            };

            return InteropData;
        })();

        ClientPayload.Product = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "WHATSAPP"] = 0;
            values[valuesById[1] = "MESSENGER"] = 1;
            values[valuesById[2] = "INTEROP"] = 2;
            values[valuesById[3] = "INTEROP_MSGR"] = 3;
            values[valuesById[4] = "WHATSAPP_LID"] = 4;
            return values;
        })();

        ClientPayload.TrafficAnonymization = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "OFF"] = 0;
            values[valuesById[1] = "STANDARD"] = 1;
            return values;
        })();

        ClientPayload.UserAgent = (function() {

            function UserAgent(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            UserAgent.prototype.platform = null;
            UserAgent.prototype.appVersion = null;
            UserAgent.prototype.mcc = null;
            UserAgent.prototype.mnc = null;
            UserAgent.prototype.osVersion = null;
            UserAgent.prototype.manufacturer = null;
            UserAgent.prototype.device = null;
            UserAgent.prototype.osBuildNumber = null;
            UserAgent.prototype.phoneId = null;
            UserAgent.prototype.releaseChannel = null;
            UserAgent.prototype.localeLanguageIso6391 = null;
            UserAgent.prototype.localeCountryIso31661Alpha2 = null;
            UserAgent.prototype.deviceBoard = null;
            UserAgent.prototype.deviceExpId = null;
            UserAgent.prototype.deviceType = null;
            UserAgent.prototype.deviceModelType = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_platform", {
                get: $util.oneOfGetter($oneOfFields = ["platform"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_appVersion", {
                get: $util.oneOfGetter($oneOfFields = ["appVersion"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_mcc", {
                get: $util.oneOfGetter($oneOfFields = ["mcc"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_mnc", {
                get: $util.oneOfGetter($oneOfFields = ["mnc"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_osVersion", {
                get: $util.oneOfGetter($oneOfFields = ["osVersion"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_manufacturer", {
                get: $util.oneOfGetter($oneOfFields = ["manufacturer"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_device", {
                get: $util.oneOfGetter($oneOfFields = ["device"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_osBuildNumber", {
                get: $util.oneOfGetter($oneOfFields = ["osBuildNumber"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_phoneId", {
                get: $util.oneOfGetter($oneOfFields = ["phoneId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_releaseChannel", {
                get: $util.oneOfGetter($oneOfFields = ["releaseChannel"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_localeLanguageIso6391", {
                get: $util.oneOfGetter($oneOfFields = ["localeLanguageIso6391"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_localeCountryIso31661Alpha2", {
                get: $util.oneOfGetter($oneOfFields = ["localeCountryIso31661Alpha2"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_deviceBoard", {
                get: $util.oneOfGetter($oneOfFields = ["deviceBoard"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_deviceExpId", {
                get: $util.oneOfGetter($oneOfFields = ["deviceExpId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_deviceType", {
                get: $util.oneOfGetter($oneOfFields = ["deviceType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserAgent.prototype, "_deviceModelType", {
                get: $util.oneOfGetter($oneOfFields = ["deviceModelType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            UserAgent.create = function create(properties) {
                return new UserAgent(properties);
            };

            UserAgent.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.platform != null && Object.hasOwnProperty.call(m, "platform"))
                    w.uint32(8).int32(m.platform);
                if (m.appVersion != null && Object.hasOwnProperty.call(m, "appVersion"))
                    $root.proto.ClientPayload.UserAgent.AppVersion.encode(m.appVersion, w.uint32(18).fork()).ldelim();
                if (m.mcc != null && Object.hasOwnProperty.call(m, "mcc"))
                    w.uint32(26).string(m.mcc);
                if (m.mnc != null && Object.hasOwnProperty.call(m, "mnc"))
                    w.uint32(34).string(m.mnc);
                if (m.osVersion != null && Object.hasOwnProperty.call(m, "osVersion"))
                    w.uint32(42).string(m.osVersion);
                if (m.manufacturer != null && Object.hasOwnProperty.call(m, "manufacturer"))
                    w.uint32(50).string(m.manufacturer);
                if (m.device != null && Object.hasOwnProperty.call(m, "device"))
                    w.uint32(58).string(m.device);
                if (m.osBuildNumber != null && Object.hasOwnProperty.call(m, "osBuildNumber"))
                    w.uint32(66).string(m.osBuildNumber);
                if (m.phoneId != null && Object.hasOwnProperty.call(m, "phoneId"))
                    w.uint32(74).string(m.phoneId);
                if (m.releaseChannel != null && Object.hasOwnProperty.call(m, "releaseChannel"))
                    w.uint32(80).int32(m.releaseChannel);
                if (m.localeLanguageIso6391 != null && Object.hasOwnProperty.call(m, "localeLanguageIso6391"))
                    w.uint32(90).string(m.localeLanguageIso6391);
                if (m.localeCountryIso31661Alpha2 != null && Object.hasOwnProperty.call(m, "localeCountryIso31661Alpha2"))
                    w.uint32(98).string(m.localeCountryIso31661Alpha2);
                if (m.deviceBoard != null && Object.hasOwnProperty.call(m, "deviceBoard"))
                    w.uint32(106).string(m.deviceBoard);
                if (m.deviceExpId != null && Object.hasOwnProperty.call(m, "deviceExpId"))
                    w.uint32(114).string(m.deviceExpId);
                if (m.deviceType != null && Object.hasOwnProperty.call(m, "deviceType"))
                    w.uint32(120).int32(m.deviceType);
                if (m.deviceModelType != null && Object.hasOwnProperty.call(m, "deviceModelType"))
                    w.uint32(130).string(m.deviceModelType);
                return w;
            };

            UserAgent.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPayload.UserAgent();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.platform = r.int32();
                            break;
                        }
                    case 2: {
                            m.appVersion = $root.proto.ClientPayload.UserAgent.AppVersion.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.mcc = r.string();
                            break;
                        }
                    case 4: {
                            m.mnc = r.string();
                            break;
                        }
                    case 5: {
                            m.osVersion = r.string();
                            break;
                        }
                    case 6: {
                            m.manufacturer = r.string();
                            break;
                        }
                    case 7: {
                            m.device = r.string();
                            break;
                        }
                    case 8: {
                            m.osBuildNumber = r.string();
                            break;
                        }
                    case 9: {
                            m.phoneId = r.string();
                            break;
                        }
                    case 10: {
                            m.releaseChannel = r.int32();
                            break;
                        }
                    case 11: {
                            m.localeLanguageIso6391 = r.string();
                            break;
                        }
                    case 12: {
                            m.localeCountryIso31661Alpha2 = r.string();
                            break;
                        }
                    case 13: {
                            m.deviceBoard = r.string();
                            break;
                        }
                    case 14: {
                            m.deviceExpId = r.string();
                            break;
                        }
                    case 15: {
                            m.deviceType = r.int32();
                            break;
                        }
                    case 16: {
                            m.deviceModelType = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            UserAgent.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ClientPayload.UserAgent)
                    return d;
                var m = new $root.proto.ClientPayload.UserAgent();
                switch (d.platform) {
                default:
                    if (typeof d.platform === "number") {
                        m.platform = d.platform;
                        break;
                    }
                    break;
                case "ANDROID":
                case 0:
                    m.platform = 0;
                    break;
                case "IOS":
                case 1:
                    m.platform = 1;
                    break;
                case "WINDOWS_PHONE":
                case 2:
                    m.platform = 2;
                    break;
                case "BLACKBERRY":
                case 3:
                    m.platform = 3;
                    break;
                case "BLACKBERRYX":
                case 4:
                    m.platform = 4;
                    break;
                case "S40":
                case 5:
                    m.platform = 5;
                    break;
                case "S60":
                case 6:
                    m.platform = 6;
                    break;
                case "PYTHON_CLIENT":
                case 7:
                    m.platform = 7;
                    break;
                case "TIZEN":
                case 8:
                    m.platform = 8;
                    break;
                case "ENTERPRISE":
                case 9:
                    m.platform = 9;
                    break;
                case "SMB_ANDROID":
                case 10:
                    m.platform = 10;
                    break;
                case "KAIOS":
                case 11:
                    m.platform = 11;
                    break;
                case "SMB_IOS":
                case 12:
                    m.platform = 12;
                    break;
                case "WINDOWS":
                case 13:
                    m.platform = 13;
                    break;
                case "WEB":
                case 14:
                    m.platform = 14;
                    break;
                case "PORTAL":
                case 15:
                    m.platform = 15;
                    break;
                case "GREEN_ANDROID":
                case 16:
                    m.platform = 16;
                    break;
                case "GREEN_IPHONE":
                case 17:
                    m.platform = 17;
                    break;
                case "BLUE_ANDROID":
                case 18:
                    m.platform = 18;
                    break;
                case "BLUE_IPHONE":
                case 19:
                    m.platform = 19;
                    break;
                case "FBLITE_ANDROID":
                case 20:
                    m.platform = 20;
                    break;
                case "MLITE_ANDROID":
                case 21:
                    m.platform = 21;
                    break;
                case "IGLITE_ANDROID":
                case 22:
                    m.platform = 22;
                    break;
                case "PAGE":
                case 23:
                    m.platform = 23;
                    break;
                case "MACOS":
                case 24:
                    m.platform = 24;
                    break;
                case "OCULUS_MSG":
                case 25:
                    m.platform = 25;
                    break;
                case "OCULUS_CALL":
                case 26:
                    m.platform = 26;
                    break;
                case "MILAN":
                case 27:
                    m.platform = 27;
                    break;
                case "CAPI":
                case 28:
                    m.platform = 28;
                    break;
                case "WEAROS":
                case 29:
                    m.platform = 29;
                    break;
                case "ARDEVICE":
                case 30:
                    m.platform = 30;
                    break;
                case "VRDEVICE":
                case 31:
                    m.platform = 31;
                    break;
                case "BLUE_WEB":
                case 32:
                    m.platform = 32;
                    break;
                case "IPAD":
                case 33:
                    m.platform = 33;
                    break;
                case "TEST":
                case 34:
                    m.platform = 34;
                    break;
                case "SMART_GLASSES":
                case 35:
                    m.platform = 35;
                    break;
                case "BLUE_VR":
                case 36:
                    m.platform = 36;
                    break;
                case "AR_WRIST":
                case 37:
                    m.platform = 37;
                    break;
                }
                if (d.appVersion != null) {
                    if (typeof d.appVersion !== "object")
                        throw TypeError(".proto.ClientPayload.UserAgent.appVersion: object expected");
                    m.appVersion = $root.proto.ClientPayload.UserAgent.AppVersion.fromObject(d.appVersion);
                }
                if (d.mcc != null) {
                    m.mcc = String(d.mcc);
                }
                if (d.mnc != null) {
                    m.mnc = String(d.mnc);
                }
                if (d.osVersion != null) {
                    m.osVersion = String(d.osVersion);
                }
                if (d.manufacturer != null) {
                    m.manufacturer = String(d.manufacturer);
                }
                if (d.device != null) {
                    m.device = String(d.device);
                }
                if (d.osBuildNumber != null) {
                    m.osBuildNumber = String(d.osBuildNumber);
                }
                if (d.phoneId != null) {
                    m.phoneId = String(d.phoneId);
                }
                switch (d.releaseChannel) {
                default:
                    if (typeof d.releaseChannel === "number") {
                        m.releaseChannel = d.releaseChannel;
                        break;
                    }
                    break;
                case "RELEASE":
                case 0:
                    m.releaseChannel = 0;
                    break;
                case "BETA":
                case 1:
                    m.releaseChannel = 1;
                    break;
                case "ALPHA":
                case 2:
                    m.releaseChannel = 2;
                    break;
                case "DEBUG":
                case 3:
                    m.releaseChannel = 3;
                    break;
                }
                if (d.localeLanguageIso6391 != null) {
                    m.localeLanguageIso6391 = String(d.localeLanguageIso6391);
                }
                if (d.localeCountryIso31661Alpha2 != null) {
                    m.localeCountryIso31661Alpha2 = String(d.localeCountryIso31661Alpha2);
                }
                if (d.deviceBoard != null) {
                    m.deviceBoard = String(d.deviceBoard);
                }
                if (d.deviceExpId != null) {
                    m.deviceExpId = String(d.deviceExpId);
                }
                switch (d.deviceType) {
                default:
                    if (typeof d.deviceType === "number") {
                        m.deviceType = d.deviceType;
                        break;
                    }
                    break;
                case "PHONE":
                case 0:
                    m.deviceType = 0;
                    break;
                case "TABLET":
                case 1:
                    m.deviceType = 1;
                    break;
                case "DESKTOP":
                case 2:
                    m.deviceType = 2;
                    break;
                case "WEARABLE":
                case 3:
                    m.deviceType = 3;
                    break;
                case "VR":
                case 4:
                    m.deviceType = 4;
                    break;
                }
                if (d.deviceModelType != null) {
                    m.deviceModelType = String(d.deviceModelType);
                }
                return m;
            };

            UserAgent.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.platform != null && m.hasOwnProperty("platform")) {
                    d.platform = o.enums === String ? $root.proto.ClientPayload.UserAgent.Platform[m.platform] === undefined ? m.platform : $root.proto.ClientPayload.UserAgent.Platform[m.platform] : m.platform;
                    if (o.oneofs)
                        d._platform = "platform";
                }
                if (m.appVersion != null && m.hasOwnProperty("appVersion")) {
                    d.appVersion = $root.proto.ClientPayload.UserAgent.AppVersion.toObject(m.appVersion, o);
                    if (o.oneofs)
                        d._appVersion = "appVersion";
                }
                if (m.mcc != null && m.hasOwnProperty("mcc")) {
                    d.mcc = m.mcc;
                    if (o.oneofs)
                        d._mcc = "mcc";
                }
                if (m.mnc != null && m.hasOwnProperty("mnc")) {
                    d.mnc = m.mnc;
                    if (o.oneofs)
                        d._mnc = "mnc";
                }
                if (m.osVersion != null && m.hasOwnProperty("osVersion")) {
                    d.osVersion = m.osVersion;
                    if (o.oneofs)
                        d._osVersion = "osVersion";
                }
                if (m.manufacturer != null && m.hasOwnProperty("manufacturer")) {
                    d.manufacturer = m.manufacturer;
                    if (o.oneofs)
                        d._manufacturer = "manufacturer";
                }
                if (m.device != null && m.hasOwnProperty("device")) {
                    d.device = m.device;
                    if (o.oneofs)
                        d._device = "device";
                }
                if (m.osBuildNumber != null && m.hasOwnProperty("osBuildNumber")) {
                    d.osBuildNumber = m.osBuildNumber;
                    if (o.oneofs)
                        d._osBuildNumber = "osBuildNumber";
                }
                if (m.phoneId != null && m.hasOwnProperty("phoneId")) {
                    d.phoneId = m.phoneId;
                    if (o.oneofs)
                        d._phoneId = "phoneId";
                }
                if (m.releaseChannel != null && m.hasOwnProperty("releaseChannel")) {
                    d.releaseChannel = o.enums === String ? $root.proto.ClientPayload.UserAgent.ReleaseChannel[m.releaseChannel] === undefined ? m.releaseChannel : $root.proto.ClientPayload.UserAgent.ReleaseChannel[m.releaseChannel] : m.releaseChannel;
                    if (o.oneofs)
                        d._releaseChannel = "releaseChannel";
                }
                if (m.localeLanguageIso6391 != null && m.hasOwnProperty("localeLanguageIso6391")) {
                    d.localeLanguageIso6391 = m.localeLanguageIso6391;
                    if (o.oneofs)
                        d._localeLanguageIso6391 = "localeLanguageIso6391";
                }
                if (m.localeCountryIso31661Alpha2 != null && m.hasOwnProperty("localeCountryIso31661Alpha2")) {
                    d.localeCountryIso31661Alpha2 = m.localeCountryIso31661Alpha2;
                    if (o.oneofs)
                        d._localeCountryIso31661Alpha2 = "localeCountryIso31661Alpha2";
                }
                if (m.deviceBoard != null && m.hasOwnProperty("deviceBoard")) {
                    d.deviceBoard = m.deviceBoard;
                    if (o.oneofs)
                        d._deviceBoard = "deviceBoard";
                }
                if (m.deviceExpId != null && m.hasOwnProperty("deviceExpId")) {
                    d.deviceExpId = m.deviceExpId;
                    if (o.oneofs)
                        d._deviceExpId = "deviceExpId";
                }
                if (m.deviceType != null && m.hasOwnProperty("deviceType")) {
                    d.deviceType = o.enums === String ? $root.proto.ClientPayload.UserAgent.DeviceType[m.deviceType] === undefined ? m.deviceType : $root.proto.ClientPayload.UserAgent.DeviceType[m.deviceType] : m.deviceType;
                    if (o.oneofs)
                        d._deviceType = "deviceType";
                }
                if (m.deviceModelType != null && m.hasOwnProperty("deviceModelType")) {
                    d.deviceModelType = m.deviceModelType;
                    if (o.oneofs)
                        d._deviceModelType = "deviceModelType";
                }
                return d;
            };

            UserAgent.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            UserAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ClientPayload.UserAgent";
            };

            UserAgent.AppVersion = (function() {

                function AppVersion(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                AppVersion.prototype.primary = null;
                AppVersion.prototype.secondary = null;
                AppVersion.prototype.tertiary = null;
                AppVersion.prototype.quaternary = null;
                AppVersion.prototype.quinary = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(AppVersion.prototype, "_primary", {
                    get: $util.oneOfGetter($oneOfFields = ["primary"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(AppVersion.prototype, "_secondary", {
                    get: $util.oneOfGetter($oneOfFields = ["secondary"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(AppVersion.prototype, "_tertiary", {
                    get: $util.oneOfGetter($oneOfFields = ["tertiary"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(AppVersion.prototype, "_quaternary", {
                    get: $util.oneOfGetter($oneOfFields = ["quaternary"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(AppVersion.prototype, "_quinary", {
                    get: $util.oneOfGetter($oneOfFields = ["quinary"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                AppVersion.create = function create(properties) {
                    return new AppVersion(properties);
                };

                AppVersion.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.primary != null && Object.hasOwnProperty.call(m, "primary"))
                        w.uint32(8).uint32(m.primary);
                    if (m.secondary != null && Object.hasOwnProperty.call(m, "secondary"))
                        w.uint32(16).uint32(m.secondary);
                    if (m.tertiary != null && Object.hasOwnProperty.call(m, "tertiary"))
                        w.uint32(24).uint32(m.tertiary);
                    if (m.quaternary != null && Object.hasOwnProperty.call(m, "quaternary"))
                        w.uint32(32).uint32(m.quaternary);
                    if (m.quinary != null && Object.hasOwnProperty.call(m, "quinary"))
                        w.uint32(40).uint32(m.quinary);
                    return w;
                };

                AppVersion.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPayload.UserAgent.AppVersion();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.primary = r.uint32();
                                break;
                            }
                        case 2: {
                                m.secondary = r.uint32();
                                break;
                            }
                        case 3: {
                                m.tertiary = r.uint32();
                                break;
                            }
                        case 4: {
                                m.quaternary = r.uint32();
                                break;
                            }
                        case 5: {
                                m.quinary = r.uint32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                AppVersion.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.ClientPayload.UserAgent.AppVersion)
                        return d;
                    var m = new $root.proto.ClientPayload.UserAgent.AppVersion();
                    if (d.primary != null) {
                        m.primary = d.primary >>> 0;
                    }
                    if (d.secondary != null) {
                        m.secondary = d.secondary >>> 0;
                    }
                    if (d.tertiary != null) {
                        m.tertiary = d.tertiary >>> 0;
                    }
                    if (d.quaternary != null) {
                        m.quaternary = d.quaternary >>> 0;
                    }
                    if (d.quinary != null) {
                        m.quinary = d.quinary >>> 0;
                    }
                    return m;
                };

                AppVersion.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.primary != null && m.hasOwnProperty("primary")) {
                        d.primary = m.primary;
                        if (o.oneofs)
                            d._primary = "primary";
                    }
                    if (m.secondary != null && m.hasOwnProperty("secondary")) {
                        d.secondary = m.secondary;
                        if (o.oneofs)
                            d._secondary = "secondary";
                    }
                    if (m.tertiary != null && m.hasOwnProperty("tertiary")) {
                        d.tertiary = m.tertiary;
                        if (o.oneofs)
                            d._tertiary = "tertiary";
                    }
                    if (m.quaternary != null && m.hasOwnProperty("quaternary")) {
                        d.quaternary = m.quaternary;
                        if (o.oneofs)
                            d._quaternary = "quaternary";
                    }
                    if (m.quinary != null && m.hasOwnProperty("quinary")) {
                        d.quinary = m.quinary;
                        if (o.oneofs)
                            d._quinary = "quinary";
                    }
                    return d;
                };

                AppVersion.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.ClientPayload.UserAgent.AppVersion";
                };

                return AppVersion;
            })();

            UserAgent.DeviceType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "PHONE"] = 0;
                values[valuesById[1] = "TABLET"] = 1;
                values[valuesById[2] = "DESKTOP"] = 2;
                values[valuesById[3] = "WEARABLE"] = 3;
                values[valuesById[4] = "VR"] = 4;
                return values;
            })();

            UserAgent.Platform = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "ANDROID"] = 0;
                values[valuesById[1] = "IOS"] = 1;
                values[valuesById[2] = "WINDOWS_PHONE"] = 2;
                values[valuesById[3] = "BLACKBERRY"] = 3;
                values[valuesById[4] = "BLACKBERRYX"] = 4;
                values[valuesById[5] = "S40"] = 5;
                values[valuesById[6] = "S60"] = 6;
                values[valuesById[7] = "PYTHON_CLIENT"] = 7;
                values[valuesById[8] = "TIZEN"] = 8;
                values[valuesById[9] = "ENTERPRISE"] = 9;
                values[valuesById[10] = "SMB_ANDROID"] = 10;
                values[valuesById[11] = "KAIOS"] = 11;
                values[valuesById[12] = "SMB_IOS"] = 12;
                values[valuesById[13] = "WINDOWS"] = 13;
                values[valuesById[14] = "WEB"] = 14;
                values[valuesById[15] = "PORTAL"] = 15;
                values[valuesById[16] = "GREEN_ANDROID"] = 16;
                values[valuesById[17] = "GREEN_IPHONE"] = 17;
                values[valuesById[18] = "BLUE_ANDROID"] = 18;
                values[valuesById[19] = "BLUE_IPHONE"] = 19;
                values[valuesById[20] = "FBLITE_ANDROID"] = 20;
                values[valuesById[21] = "MLITE_ANDROID"] = 21;
                values[valuesById[22] = "IGLITE_ANDROID"] = 22;
                values[valuesById[23] = "PAGE"] = 23;
                values[valuesById[24] = "MACOS"] = 24;
                values[valuesById[25] = "OCULUS_MSG"] = 25;
                values[valuesById[26] = "OCULUS_CALL"] = 26;
                values[valuesById[27] = "MILAN"] = 27;
                values[valuesById[28] = "CAPI"] = 28;
                values[valuesById[29] = "WEAROS"] = 29;
                values[valuesById[30] = "ARDEVICE"] = 30;
                values[valuesById[31] = "VRDEVICE"] = 31;
                values[valuesById[32] = "BLUE_WEB"] = 32;
                values[valuesById[33] = "IPAD"] = 33;
                values[valuesById[34] = "TEST"] = 34;
                values[valuesById[35] = "SMART_GLASSES"] = 35;
                values[valuesById[36] = "BLUE_VR"] = 36;
                values[valuesById[37] = "AR_WRIST"] = 37;
                return values;
            })();

            UserAgent.ReleaseChannel = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "RELEASE"] = 0;
                values[valuesById[1] = "BETA"] = 1;
                values[valuesById[2] = "ALPHA"] = 2;
                values[valuesById[3] = "DEBUG"] = 3;
                return values;
            })();

            return UserAgent;
        })();

        ClientPayload.WebInfo = (function() {

            function WebInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            WebInfo.prototype.refToken = null;
            WebInfo.prototype.version = null;
            WebInfo.prototype.webdPayload = null;
            WebInfo.prototype.webSubPlatform = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(WebInfo.prototype, "_refToken", {
                get: $util.oneOfGetter($oneOfFields = ["refToken"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(WebInfo.prototype, "_version", {
                get: $util.oneOfGetter($oneOfFields = ["version"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(WebInfo.prototype, "_webdPayload", {
                get: $util.oneOfGetter($oneOfFields = ["webdPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(WebInfo.prototype, "_webSubPlatform", {
                get: $util.oneOfGetter($oneOfFields = ["webSubPlatform"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            WebInfo.create = function create(properties) {
                return new WebInfo(properties);
            };

            WebInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.refToken != null && Object.hasOwnProperty.call(m, "refToken"))
                    w.uint32(10).string(m.refToken);
                if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                    w.uint32(18).string(m.version);
                if (m.webdPayload != null && Object.hasOwnProperty.call(m, "webdPayload"))
                    $root.proto.ClientPayload.WebInfo.WebdPayload.encode(m.webdPayload, w.uint32(26).fork()).ldelim();
                if (m.webSubPlatform != null && Object.hasOwnProperty.call(m, "webSubPlatform"))
                    w.uint32(32).int32(m.webSubPlatform);
                return w;
            };

            WebInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPayload.WebInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.refToken = r.string();
                            break;
                        }
                    case 2: {
                            m.version = r.string();
                            break;
                        }
                    case 3: {
                            m.webdPayload = $root.proto.ClientPayload.WebInfo.WebdPayload.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.webSubPlatform = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            WebInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ClientPayload.WebInfo)
                    return d;
                var m = new $root.proto.ClientPayload.WebInfo();
                if (d.refToken != null) {
                    m.refToken = String(d.refToken);
                }
                if (d.version != null) {
                    m.version = String(d.version);
                }
                if (d.webdPayload != null) {
                    if (typeof d.webdPayload !== "object")
                        throw TypeError(".proto.ClientPayload.WebInfo.webdPayload: object expected");
                    m.webdPayload = $root.proto.ClientPayload.WebInfo.WebdPayload.fromObject(d.webdPayload);
                }
                switch (d.webSubPlatform) {
                default:
                    if (typeof d.webSubPlatform === "number") {
                        m.webSubPlatform = d.webSubPlatform;
                        break;
                    }
                    break;
                case "WEB_BROWSER":
                case 0:
                    m.webSubPlatform = 0;
                    break;
                case "APP_STORE":
                case 1:
                    m.webSubPlatform = 1;
                    break;
                case "WIN_STORE":
                case 2:
                    m.webSubPlatform = 2;
                    break;
                case "DARWIN":
                case 3:
                    m.webSubPlatform = 3;
                    break;
                case "WIN32":
                case 4:
                    m.webSubPlatform = 4;
                    break;
                case "WIN_HYBRID":
                case 5:
                    m.webSubPlatform = 5;
                    break;
                }
                return m;
            };

            WebInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.refToken != null && m.hasOwnProperty("refToken")) {
                    d.refToken = m.refToken;
                    if (o.oneofs)
                        d._refToken = "refToken";
                }
                if (m.version != null && m.hasOwnProperty("version")) {
                    d.version = m.version;
                    if (o.oneofs)
                        d._version = "version";
                }
                if (m.webdPayload != null && m.hasOwnProperty("webdPayload")) {
                    d.webdPayload = $root.proto.ClientPayload.WebInfo.WebdPayload.toObject(m.webdPayload, o);
                    if (o.oneofs)
                        d._webdPayload = "webdPayload";
                }
                if (m.webSubPlatform != null && m.hasOwnProperty("webSubPlatform")) {
                    d.webSubPlatform = o.enums === String ? $root.proto.ClientPayload.WebInfo.WebSubPlatform[m.webSubPlatform] === undefined ? m.webSubPlatform : $root.proto.ClientPayload.WebInfo.WebSubPlatform[m.webSubPlatform] : m.webSubPlatform;
                    if (o.oneofs)
                        d._webSubPlatform = "webSubPlatform";
                }
                return d;
            };

            WebInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            WebInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ClientPayload.WebInfo";
            };

            WebInfo.WebSubPlatform = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "WEB_BROWSER"] = 0;
                values[valuesById[1] = "APP_STORE"] = 1;
                values[valuesById[2] = "WIN_STORE"] = 2;
                values[valuesById[3] = "DARWIN"] = 3;
                values[valuesById[4] = "WIN32"] = 4;
                values[valuesById[5] = "WIN_HYBRID"] = 5;
                return values;
            })();

            WebInfo.WebdPayload = (function() {

                function WebdPayload(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                WebdPayload.prototype.usesParticipantInKey = null;
                WebdPayload.prototype.supportsStarredMessages = null;
                WebdPayload.prototype.supportsDocumentMessages = null;
                WebdPayload.prototype.supportsUrlMessages = null;
                WebdPayload.prototype.supportsMediaRetry = null;
                WebdPayload.prototype.supportsE2EImage = null;
                WebdPayload.prototype.supportsE2EVideo = null;
                WebdPayload.prototype.supportsE2EAudio = null;
                WebdPayload.prototype.supportsE2EDocument = null;
                WebdPayload.prototype.documentTypes = null;
                WebdPayload.prototype.features = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_usesParticipantInKey", {
                    get: $util.oneOfGetter($oneOfFields = ["usesParticipantInKey"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_supportsStarredMessages", {
                    get: $util.oneOfGetter($oneOfFields = ["supportsStarredMessages"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_supportsDocumentMessages", {
                    get: $util.oneOfGetter($oneOfFields = ["supportsDocumentMessages"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_supportsUrlMessages", {
                    get: $util.oneOfGetter($oneOfFields = ["supportsUrlMessages"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_supportsMediaRetry", {
                    get: $util.oneOfGetter($oneOfFields = ["supportsMediaRetry"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_supportsE2EImage", {
                    get: $util.oneOfGetter($oneOfFields = ["supportsE2EImage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_supportsE2EVideo", {
                    get: $util.oneOfGetter($oneOfFields = ["supportsE2EVideo"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_supportsE2EAudio", {
                    get: $util.oneOfGetter($oneOfFields = ["supportsE2EAudio"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_supportsE2EDocument", {
                    get: $util.oneOfGetter($oneOfFields = ["supportsE2EDocument"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_documentTypes", {
                    get: $util.oneOfGetter($oneOfFields = ["documentTypes"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(WebdPayload.prototype, "_features", {
                    get: $util.oneOfGetter($oneOfFields = ["features"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                WebdPayload.create = function create(properties) {
                    return new WebdPayload(properties);
                };

                WebdPayload.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.usesParticipantInKey != null && Object.hasOwnProperty.call(m, "usesParticipantInKey"))
                        w.uint32(8).bool(m.usesParticipantInKey);
                    if (m.supportsStarredMessages != null && Object.hasOwnProperty.call(m, "supportsStarredMessages"))
                        w.uint32(16).bool(m.supportsStarredMessages);
                    if (m.supportsDocumentMessages != null && Object.hasOwnProperty.call(m, "supportsDocumentMessages"))
                        w.uint32(24).bool(m.supportsDocumentMessages);
                    if (m.supportsUrlMessages != null && Object.hasOwnProperty.call(m, "supportsUrlMessages"))
                        w.uint32(32).bool(m.supportsUrlMessages);
                    if (m.supportsMediaRetry != null && Object.hasOwnProperty.call(m, "supportsMediaRetry"))
                        w.uint32(40).bool(m.supportsMediaRetry);
                    if (m.supportsE2EImage != null && Object.hasOwnProperty.call(m, "supportsE2EImage"))
                        w.uint32(48).bool(m.supportsE2EImage);
                    if (m.supportsE2EVideo != null && Object.hasOwnProperty.call(m, "supportsE2EVideo"))
                        w.uint32(56).bool(m.supportsE2EVideo);
                    if (m.supportsE2EAudio != null && Object.hasOwnProperty.call(m, "supportsE2EAudio"))
                        w.uint32(64).bool(m.supportsE2EAudio);
                    if (m.supportsE2EDocument != null && Object.hasOwnProperty.call(m, "supportsE2EDocument"))
                        w.uint32(72).bool(m.supportsE2EDocument);
                    if (m.documentTypes != null && Object.hasOwnProperty.call(m, "documentTypes"))
                        w.uint32(82).string(m.documentTypes);
                    if (m.features != null && Object.hasOwnProperty.call(m, "features"))
                        w.uint32(90).bytes(m.features);
                    return w;
                };

                WebdPayload.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ClientPayload.WebInfo.WebdPayload();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.usesParticipantInKey = r.bool();
                                break;
                            }
                        case 2: {
                                m.supportsStarredMessages = r.bool();
                                break;
                            }
                        case 3: {
                                m.supportsDocumentMessages = r.bool();
                                break;
                            }
                        case 4: {
                                m.supportsUrlMessages = r.bool();
                                break;
                            }
                        case 5: {
                                m.supportsMediaRetry = r.bool();
                                break;
                            }
                        case 6: {
                                m.supportsE2EImage = r.bool();
                                break;
                            }
                        case 7: {
                                m.supportsE2EVideo = r.bool();
                                break;
                            }
                        case 8: {
                                m.supportsE2EAudio = r.bool();
                                break;
                            }
                        case 9: {
                                m.supportsE2EDocument = r.bool();
                                break;
                            }
                        case 10: {
                                m.documentTypes = r.string();
                                break;
                            }
                        case 11: {
                                m.features = r.bytes();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                WebdPayload.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.ClientPayload.WebInfo.WebdPayload)
                        return d;
                    var m = new $root.proto.ClientPayload.WebInfo.WebdPayload();
                    if (d.usesParticipantInKey != null) {
                        m.usesParticipantInKey = Boolean(d.usesParticipantInKey);
                    }
                    if (d.supportsStarredMessages != null) {
                        m.supportsStarredMessages = Boolean(d.supportsStarredMessages);
                    }
                    if (d.supportsDocumentMessages != null) {
                        m.supportsDocumentMessages = Boolean(d.supportsDocumentMessages);
                    }
                    if (d.supportsUrlMessages != null) {
                        m.supportsUrlMessages = Boolean(d.supportsUrlMessages);
                    }
                    if (d.supportsMediaRetry != null) {
                        m.supportsMediaRetry = Boolean(d.supportsMediaRetry);
                    }
                    if (d.supportsE2EImage != null) {
                        m.supportsE2EImage = Boolean(d.supportsE2EImage);
                    }
                    if (d.supportsE2EVideo != null) {
                        m.supportsE2EVideo = Boolean(d.supportsE2EVideo);
                    }
                    if (d.supportsE2EAudio != null) {
                        m.supportsE2EAudio = Boolean(d.supportsE2EAudio);
                    }
                    if (d.supportsE2EDocument != null) {
                        m.supportsE2EDocument = Boolean(d.supportsE2EDocument);
                    }
                    if (d.documentTypes != null) {
                        m.documentTypes = String(d.documentTypes);
                    }
                    if (d.features != null) {
                        if (typeof d.features === "string")
                            $util.base64.decode(d.features, m.features = $util.newBuffer($util.base64.length(d.features)), 0);
                        else if (d.features.length >= 0)
                            m.features = d.features;
                    }
                    return m;
                };

                WebdPayload.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.usesParticipantInKey != null && m.hasOwnProperty("usesParticipantInKey")) {
                        d.usesParticipantInKey = m.usesParticipantInKey;
                        if (o.oneofs)
                            d._usesParticipantInKey = "usesParticipantInKey";
                    }
                    if (m.supportsStarredMessages != null && m.hasOwnProperty("supportsStarredMessages")) {
                        d.supportsStarredMessages = m.supportsStarredMessages;
                        if (o.oneofs)
                            d._supportsStarredMessages = "supportsStarredMessages";
                    }
                    if (m.supportsDocumentMessages != null && m.hasOwnProperty("supportsDocumentMessages")) {
                        d.supportsDocumentMessages = m.supportsDocumentMessages;
                        if (o.oneofs)
                            d._supportsDocumentMessages = "supportsDocumentMessages";
                    }
                    if (m.supportsUrlMessages != null && m.hasOwnProperty("supportsUrlMessages")) {
                        d.supportsUrlMessages = m.supportsUrlMessages;
                        if (o.oneofs)
                            d._supportsUrlMessages = "supportsUrlMessages";
                    }
                    if (m.supportsMediaRetry != null && m.hasOwnProperty("supportsMediaRetry")) {
                        d.supportsMediaRetry = m.supportsMediaRetry;
                        if (o.oneofs)
                            d._supportsMediaRetry = "supportsMediaRetry";
                    }
                    if (m.supportsE2EImage != null && m.hasOwnProperty("supportsE2EImage")) {
                        d.supportsE2EImage = m.supportsE2EImage;
                        if (o.oneofs)
                            d._supportsE2EImage = "supportsE2EImage";
                    }
                    if (m.supportsE2EVideo != null && m.hasOwnProperty("supportsE2EVideo")) {
                        d.supportsE2EVideo = m.supportsE2EVideo;
                        if (o.oneofs)
                            d._supportsE2EVideo = "supportsE2EVideo";
                    }
                    if (m.supportsE2EAudio != null && m.hasOwnProperty("supportsE2EAudio")) {
                        d.supportsE2EAudio = m.supportsE2EAudio;
                        if (o.oneofs)
                            d._supportsE2EAudio = "supportsE2EAudio";
                    }
                    if (m.supportsE2EDocument != null && m.hasOwnProperty("supportsE2EDocument")) {
                        d.supportsE2EDocument = m.supportsE2EDocument;
                        if (o.oneofs)
                            d._supportsE2EDocument = "supportsE2EDocument";
                    }
                    if (m.documentTypes != null && m.hasOwnProperty("documentTypes")) {
                        d.documentTypes = m.documentTypes;
                        if (o.oneofs)
                            d._documentTypes = "documentTypes";
                    }
                    if (m.features != null && m.hasOwnProperty("features")) {
                        d.features = o.bytes === String ? $util.base64.encode(m.features, 0, m.features.length) : o.bytes === Array ? Array.prototype.slice.call(m.features) : m.features;
                        if (o.oneofs)
                            d._features = "features";
                    }
                    return d;
                };

                WebdPayload.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                WebdPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.ClientPayload.WebInfo.WebdPayload";
                };

                return WebdPayload;
            })();

            return WebInfo;
        })();

        return ClientPayload;
    })();

    proto.CollectionName = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "COLLECTION_NAME_UNKNOWN"] = 0;
        values[valuesById[1] = "REGULAR"] = 1;
        values[valuesById[2] = "REGULAR_LOW"] = 2;
        values[valuesById[3] = "REGULAR_HIGH"] = 3;
        values[valuesById[4] = "CRITICAL_BLOCK"] = 4;
        values[valuesById[5] = "CRITICAL_UNBLOCK_LOW"] = 5;
        return values;
    })();

    proto.CommentMetadata = (function() {

        function CommentMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        CommentMetadata.prototype.commentParentKey = null;
        CommentMetadata.prototype.replyCount = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CommentMetadata.prototype, "_commentParentKey", {
            get: $util.oneOfGetter($oneOfFields = ["commentParentKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CommentMetadata.prototype, "_replyCount", {
            get: $util.oneOfGetter($oneOfFields = ["replyCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        CommentMetadata.create = function create(properties) {
            return new CommentMetadata(properties);
        };

        CommentMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.commentParentKey != null && Object.hasOwnProperty.call(m, "commentParentKey"))
                $root.proto.MessageKey.encode(m.commentParentKey, w.uint32(10).fork()).ldelim();
            if (m.replyCount != null && Object.hasOwnProperty.call(m, "replyCount"))
                w.uint32(16).uint32(m.replyCount);
            return w;
        };

        CommentMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CommentMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.commentParentKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.replyCount = r.uint32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        CommentMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.CommentMetadata)
                return d;
            var m = new $root.proto.CommentMetadata();
            if (d.commentParentKey != null) {
                if (typeof d.commentParentKey !== "object")
                    throw TypeError(".proto.CommentMetadata.commentParentKey: object expected");
                m.commentParentKey = $root.proto.MessageKey.fromObject(d.commentParentKey);
            }
            if (d.replyCount != null) {
                m.replyCount = d.replyCount >>> 0;
            }
            return m;
        };

        CommentMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.commentParentKey != null && m.hasOwnProperty("commentParentKey")) {
                d.commentParentKey = $root.proto.MessageKey.toObject(m.commentParentKey, o);
                if (o.oneofs)
                    d._commentParentKey = "commentParentKey";
            }
            if (m.replyCount != null && m.hasOwnProperty("replyCount")) {
                d.replyCount = m.replyCount;
                if (o.oneofs)
                    d._replyCount = "replyCount";
            }
            return d;
        };

        CommentMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        CommentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.CommentMetadata";
        };

        return CommentMetadata;
    })();

    proto.CompanionCommitment = (function() {

        function CompanionCommitment(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        CompanionCommitment.prototype.hash = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CompanionCommitment.prototype, "_hash", {
            get: $util.oneOfGetter($oneOfFields = ["hash"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        CompanionCommitment.create = function create(properties) {
            return new CompanionCommitment(properties);
        };

        CompanionCommitment.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.hash != null && Object.hasOwnProperty.call(m, "hash"))
                w.uint32(10).bytes(m.hash);
            return w;
        };

        CompanionCommitment.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CompanionCommitment();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.hash = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        CompanionCommitment.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.CompanionCommitment)
                return d;
            var m = new $root.proto.CompanionCommitment();
            if (d.hash != null) {
                if (typeof d.hash === "string")
                    $util.base64.decode(d.hash, m.hash = $util.newBuffer($util.base64.length(d.hash)), 0);
                else if (d.hash.length >= 0)
                    m.hash = d.hash;
            }
            return m;
        };

        CompanionCommitment.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.hash != null && m.hasOwnProperty("hash")) {
                d.hash = o.bytes === String ? $util.base64.encode(m.hash, 0, m.hash.length) : o.bytes === Array ? Array.prototype.slice.call(m.hash) : m.hash;
                if (o.oneofs)
                    d._hash = "hash";
            }
            return d;
        };

        CompanionCommitment.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        CompanionCommitment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.CompanionCommitment";
        };

        return CompanionCommitment;
    })();

    proto.CompanionEphemeralIdentity = (function() {

        function CompanionEphemeralIdentity(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        CompanionEphemeralIdentity.prototype.publicKey = null;
        CompanionEphemeralIdentity.prototype.deviceType = null;
        CompanionEphemeralIdentity.prototype.ref = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CompanionEphemeralIdentity.prototype, "_publicKey", {
            get: $util.oneOfGetter($oneOfFields = ["publicKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CompanionEphemeralIdentity.prototype, "_deviceType", {
            get: $util.oneOfGetter($oneOfFields = ["deviceType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(CompanionEphemeralIdentity.prototype, "_ref", {
            get: $util.oneOfGetter($oneOfFields = ["ref"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        CompanionEphemeralIdentity.create = function create(properties) {
            return new CompanionEphemeralIdentity(properties);
        };

        CompanionEphemeralIdentity.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey"))
                w.uint32(10).bytes(m.publicKey);
            if (m.deviceType != null && Object.hasOwnProperty.call(m, "deviceType"))
                w.uint32(16).int32(m.deviceType);
            if (m.ref != null && Object.hasOwnProperty.call(m, "ref"))
                w.uint32(26).string(m.ref);
            return w;
        };

        CompanionEphemeralIdentity.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CompanionEphemeralIdentity();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.publicKey = r.bytes();
                        break;
                    }
                case 2: {
                        m.deviceType = r.int32();
                        break;
                    }
                case 3: {
                        m.ref = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        CompanionEphemeralIdentity.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.CompanionEphemeralIdentity)
                return d;
            var m = new $root.proto.CompanionEphemeralIdentity();
            if (d.publicKey != null) {
                if (typeof d.publicKey === "string")
                    $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0);
                else if (d.publicKey.length >= 0)
                    m.publicKey = d.publicKey;
            }
            switch (d.deviceType) {
            default:
                if (typeof d.deviceType === "number") {
                    m.deviceType = d.deviceType;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.deviceType = 0;
                break;
            case "CHROME":
            case 1:
                m.deviceType = 1;
                break;
            case "FIREFOX":
            case 2:
                m.deviceType = 2;
                break;
            case "IE":
            case 3:
                m.deviceType = 3;
                break;
            case "OPERA":
            case 4:
                m.deviceType = 4;
                break;
            case "SAFARI":
            case 5:
                m.deviceType = 5;
                break;
            case "EDGE":
            case 6:
                m.deviceType = 6;
                break;
            case "DESKTOP":
            case 7:
                m.deviceType = 7;
                break;
            case "IPAD":
            case 8:
                m.deviceType = 8;
                break;
            case "ANDROID_TABLET":
            case 9:
                m.deviceType = 9;
                break;
            case "OHANA":
            case 10:
                m.deviceType = 10;
                break;
            case "ALOHA":
            case 11:
                m.deviceType = 11;
                break;
            case "CATALINA":
            case 12:
                m.deviceType = 12;
                break;
            case "TCL_TV":
            case 13:
                m.deviceType = 13;
                break;
            case "IOS_PHONE":
            case 14:
                m.deviceType = 14;
                break;
            case "IOS_CATALYST":
            case 15:
                m.deviceType = 15;
                break;
            case "ANDROID_PHONE":
            case 16:
                m.deviceType = 16;
                break;
            case "ANDROID_AMBIGUOUS":
            case 17:
                m.deviceType = 17;
                break;
            case "WEAR_OS":
            case 18:
                m.deviceType = 18;
                break;
            case "AR_WRIST":
            case 19:
                m.deviceType = 19;
                break;
            case "AR_DEVICE":
            case 20:
                m.deviceType = 20;
                break;
            case "UWP":
            case 21:
                m.deviceType = 21;
                break;
            case "VR":
            case 22:
                m.deviceType = 22;
                break;
            case "CLOUD_API":
            case 23:
                m.deviceType = 23;
                break;
            case "SMARTGLASSES":
            case 24:
                m.deviceType = 24;
                break;
            }
            if (d.ref != null) {
                m.ref = String(d.ref);
            }
            return m;
        };

        CompanionEphemeralIdentity.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.publicKey != null && m.hasOwnProperty("publicKey")) {
                d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey;
                if (o.oneofs)
                    d._publicKey = "publicKey";
            }
            if (m.deviceType != null && m.hasOwnProperty("deviceType")) {
                d.deviceType = o.enums === String ? $root.proto.DeviceProps.PlatformType[m.deviceType] === undefined ? m.deviceType : $root.proto.DeviceProps.PlatformType[m.deviceType] : m.deviceType;
                if (o.oneofs)
                    d._deviceType = "deviceType";
            }
            if (m.ref != null && m.hasOwnProperty("ref")) {
                d.ref = m.ref;
                if (o.oneofs)
                    d._ref = "ref";
            }
            return d;
        };

        CompanionEphemeralIdentity.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        CompanionEphemeralIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.CompanionEphemeralIdentity";
        };

        return CompanionEphemeralIdentity;
    })();

    proto.Config = (function() {

        function Config(p) {
            this.field = {};
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Config.prototype.field = $util.emptyObject;
        Config.prototype.version = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Config.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Config.create = function create(properties) {
            return new Config(properties);
        };

        Config.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.field != null && Object.hasOwnProperty.call(m, "field")) {
                for (var ks = Object.keys(m.field), i = 0; i < ks.length; ++i) {
                    w.uint32(10).fork().uint32(8).uint32(ks[i]);
                    $root.proto.Field.encode(m.field[ks[i]], w.uint32(18).fork()).ldelim().ldelim();
                }
            }
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                w.uint32(16).uint32(m.version);
            return w;
        };

        Config.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Config(), k, value;
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (m.field === $util.emptyObject)
                            m.field = {};
                        var c2 = r.uint32() + r.pos;
                        k = 0;
                        value = null;
                        while (r.pos < c2) {
                            var tag2 = r.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                k = r.uint32();
                                break;
                            case 2:
                                value = $root.proto.Field.decode(r, r.uint32());
                                break;
                            default:
                                r.skipType(tag2 & 7);
                                break;
                            }
                        }
                        m.field[k] = value;
                        break;
                    }
                case 2: {
                        m.version = r.uint32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Config.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Config)
                return d;
            var m = new $root.proto.Config();
            if (d.field) {
                if (typeof d.field !== "object")
                    throw TypeError(".proto.Config.field: object expected");
                m.field = {};
                for (var ks = Object.keys(d.field), i = 0; i < ks.length; ++i) {
                    if (typeof d.field[ks[i]] !== "object")
                        throw TypeError(".proto.Config.field: object expected");
                    m.field[ks[i]] = $root.proto.Field.fromObject(d.field[ks[i]]);
                }
            }
            if (d.version != null) {
                m.version = d.version >>> 0;
            }
            return m;
        };

        Config.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.objects || o.defaults) {
                d.field = {};
            }
            var ks2;
            if (m.field && (ks2 = Object.keys(m.field)).length) {
                d.field = {};
                for (var j = 0; j < ks2.length; ++j) {
                    d.field[ks2[j]] = $root.proto.Field.toObject(m.field[ks2[j]], o);
                }
            }
            if (m.version != null && m.hasOwnProperty("version")) {
                d.version = m.version;
                if (o.oneofs)
                    d._version = "version";
            }
            return d;
        };

        Config.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Config";
        };

        return Config;
    })();

    proto.ContextInfo = (function() {

        function ContextInfo(p) {
            this.mentionedJid = [];
            this.groupMentions = [];
            this.statusAttributions = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ContextInfo.prototype.stanzaId = null;
        ContextInfo.prototype.participant = null;
        ContextInfo.prototype.quotedMessage = null;
        ContextInfo.prototype.remoteJid = null;
        ContextInfo.prototype.mentionedJid = $util.emptyArray;
        ContextInfo.prototype.conversionSource = null;
        ContextInfo.prototype.conversionData = null;
        ContextInfo.prototype.conversionDelaySeconds = null;
        ContextInfo.prototype.forwardingScore = null;
        ContextInfo.prototype.isForwarded = null;
        ContextInfo.prototype.quotedAd = null;
        ContextInfo.prototype.placeholderKey = null;
        ContextInfo.prototype.expiration = null;
        ContextInfo.prototype.ephemeralSettingTimestamp = null;
        ContextInfo.prototype.ephemeralSharedSecret = null;
        ContextInfo.prototype.externalAdReply = null;
        ContextInfo.prototype.entryPointConversionSource = null;
        ContextInfo.prototype.entryPointConversionApp = null;
        ContextInfo.prototype.entryPointConversionDelaySeconds = null;
        ContextInfo.prototype.disappearingMode = null;
        ContextInfo.prototype.actionLink = null;
        ContextInfo.prototype.groupSubject = null;
        ContextInfo.prototype.parentGroupJid = null;
        ContextInfo.prototype.trustBannerType = null;
        ContextInfo.prototype.trustBannerAction = null;
        ContextInfo.prototype.isSampled = null;
        ContextInfo.prototype.groupMentions = $util.emptyArray;
        ContextInfo.prototype.utm = null;
        ContextInfo.prototype.forwardedNewsletterMessageInfo = null;
        ContextInfo.prototype.businessMessageForwardInfo = null;
        ContextInfo.prototype.smbClientCampaignId = null;
        ContextInfo.prototype.smbServerCampaignId = null;
        ContextInfo.prototype.dataSharingContext = null;
        ContextInfo.prototype.alwaysShowAdAttribution = null;
        ContextInfo.prototype.featureEligibilities = null;
        ContextInfo.prototype.entryPointConversionExternalSource = null;
        ContextInfo.prototype.entryPointConversionExternalMedium = null;
        ContextInfo.prototype.ctwaSignals = null;
        ContextInfo.prototype.ctwaPayload = null;
        ContextInfo.prototype.forwardedAiBotMessageInfo = null;
        ContextInfo.prototype.statusAttributionType = null;
        ContextInfo.prototype.urlTrackingMap = null;
        ContextInfo.prototype.pairedMediaType = null;
        ContextInfo.prototype.rankingVersion = null;
        ContextInfo.prototype.memberLabel = null;
        ContextInfo.prototype.isQuestion = null;
        ContextInfo.prototype.statusSourceType = null;
        ContextInfo.prototype.statusAttributions = $util.emptyArray;
        ContextInfo.prototype.isGroupStatus = null;
        ContextInfo.prototype.forwardOrigin = null;
        ContextInfo.prototype.questionReplyQuotedMessage = null;
        ContextInfo.prototype.statusAudienceMetadata = null;
        ContextInfo.prototype.nonJidMentions = null;
        ContextInfo.prototype.quotedType = null;
        ContextInfo.prototype.botMessageSharingInfo = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_stanzaId", {
            get: $util.oneOfGetter($oneOfFields = ["stanzaId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_participant", {
            get: $util.oneOfGetter($oneOfFields = ["participant"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_quotedMessage", {
            get: $util.oneOfGetter($oneOfFields = ["quotedMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_remoteJid", {
            get: $util.oneOfGetter($oneOfFields = ["remoteJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_conversionSource", {
            get: $util.oneOfGetter($oneOfFields = ["conversionSource"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_conversionData", {
            get: $util.oneOfGetter($oneOfFields = ["conversionData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_conversionDelaySeconds", {
            get: $util.oneOfGetter($oneOfFields = ["conversionDelaySeconds"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_forwardingScore", {
            get: $util.oneOfGetter($oneOfFields = ["forwardingScore"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_isForwarded", {
            get: $util.oneOfGetter($oneOfFields = ["isForwarded"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_quotedAd", {
            get: $util.oneOfGetter($oneOfFields = ["quotedAd"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_placeholderKey", {
            get: $util.oneOfGetter($oneOfFields = ["placeholderKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_expiration", {
            get: $util.oneOfGetter($oneOfFields = ["expiration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_ephemeralSettingTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralSettingTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_ephemeralSharedSecret", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralSharedSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_externalAdReply", {
            get: $util.oneOfGetter($oneOfFields = ["externalAdReply"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_entryPointConversionSource", {
            get: $util.oneOfGetter($oneOfFields = ["entryPointConversionSource"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_entryPointConversionApp", {
            get: $util.oneOfGetter($oneOfFields = ["entryPointConversionApp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_entryPointConversionDelaySeconds", {
            get: $util.oneOfGetter($oneOfFields = ["entryPointConversionDelaySeconds"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_disappearingMode", {
            get: $util.oneOfGetter($oneOfFields = ["disappearingMode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_actionLink", {
            get: $util.oneOfGetter($oneOfFields = ["actionLink"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_groupSubject", {
            get: $util.oneOfGetter($oneOfFields = ["groupSubject"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_parentGroupJid", {
            get: $util.oneOfGetter($oneOfFields = ["parentGroupJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_trustBannerType", {
            get: $util.oneOfGetter($oneOfFields = ["trustBannerType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_trustBannerAction", {
            get: $util.oneOfGetter($oneOfFields = ["trustBannerAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_isSampled", {
            get: $util.oneOfGetter($oneOfFields = ["isSampled"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_utm", {
            get: $util.oneOfGetter($oneOfFields = ["utm"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_forwardedNewsletterMessageInfo", {
            get: $util.oneOfGetter($oneOfFields = ["forwardedNewsletterMessageInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_businessMessageForwardInfo", {
            get: $util.oneOfGetter($oneOfFields = ["businessMessageForwardInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_smbClientCampaignId", {
            get: $util.oneOfGetter($oneOfFields = ["smbClientCampaignId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_smbServerCampaignId", {
            get: $util.oneOfGetter($oneOfFields = ["smbServerCampaignId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_dataSharingContext", {
            get: $util.oneOfGetter($oneOfFields = ["dataSharingContext"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_alwaysShowAdAttribution", {
            get: $util.oneOfGetter($oneOfFields = ["alwaysShowAdAttribution"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_featureEligibilities", {
            get: $util.oneOfGetter($oneOfFields = ["featureEligibilities"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_entryPointConversionExternalSource", {
            get: $util.oneOfGetter($oneOfFields = ["entryPointConversionExternalSource"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_entryPointConversionExternalMedium", {
            get: $util.oneOfGetter($oneOfFields = ["entryPointConversionExternalMedium"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_ctwaSignals", {
            get: $util.oneOfGetter($oneOfFields = ["ctwaSignals"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_ctwaPayload", {
            get: $util.oneOfGetter($oneOfFields = ["ctwaPayload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_forwardedAiBotMessageInfo", {
            get: $util.oneOfGetter($oneOfFields = ["forwardedAiBotMessageInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_statusAttributionType", {
            get: $util.oneOfGetter($oneOfFields = ["statusAttributionType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_urlTrackingMap", {
            get: $util.oneOfGetter($oneOfFields = ["urlTrackingMap"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_pairedMediaType", {
            get: $util.oneOfGetter($oneOfFields = ["pairedMediaType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_rankingVersion", {
            get: $util.oneOfGetter($oneOfFields = ["rankingVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_memberLabel", {
            get: $util.oneOfGetter($oneOfFields = ["memberLabel"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_isQuestion", {
            get: $util.oneOfGetter($oneOfFields = ["isQuestion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_statusSourceType", {
            get: $util.oneOfGetter($oneOfFields = ["statusSourceType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_isGroupStatus", {
            get: $util.oneOfGetter($oneOfFields = ["isGroupStatus"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_forwardOrigin", {
            get: $util.oneOfGetter($oneOfFields = ["forwardOrigin"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_questionReplyQuotedMessage", {
            get: $util.oneOfGetter($oneOfFields = ["questionReplyQuotedMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_statusAudienceMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["statusAudienceMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_nonJidMentions", {
            get: $util.oneOfGetter($oneOfFields = ["nonJidMentions"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_quotedType", {
            get: $util.oneOfGetter($oneOfFields = ["quotedType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ContextInfo.prototype, "_botMessageSharingInfo", {
            get: $util.oneOfGetter($oneOfFields = ["botMessageSharingInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ContextInfo.create = function create(properties) {
            return new ContextInfo(properties);
        };

        ContextInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.stanzaId != null && Object.hasOwnProperty.call(m, "stanzaId"))
                w.uint32(10).string(m.stanzaId);
            if (m.participant != null && Object.hasOwnProperty.call(m, "participant"))
                w.uint32(18).string(m.participant);
            if (m.quotedMessage != null && Object.hasOwnProperty.call(m, "quotedMessage"))
                $root.proto.Message.encode(m.quotedMessage, w.uint32(26).fork()).ldelim();
            if (m.remoteJid != null && Object.hasOwnProperty.call(m, "remoteJid"))
                w.uint32(34).string(m.remoteJid);
            if (m.mentionedJid != null && m.mentionedJid.length) {
                for (var i = 0; i < m.mentionedJid.length; ++i)
                    w.uint32(122).string(m.mentionedJid[i]);
            }
            if (m.conversionSource != null && Object.hasOwnProperty.call(m, "conversionSource"))
                w.uint32(146).string(m.conversionSource);
            if (m.conversionData != null && Object.hasOwnProperty.call(m, "conversionData"))
                w.uint32(154).bytes(m.conversionData);
            if (m.conversionDelaySeconds != null && Object.hasOwnProperty.call(m, "conversionDelaySeconds"))
                w.uint32(160).uint32(m.conversionDelaySeconds);
            if (m.forwardingScore != null && Object.hasOwnProperty.call(m, "forwardingScore"))
                w.uint32(168).uint32(m.forwardingScore);
            if (m.isForwarded != null && Object.hasOwnProperty.call(m, "isForwarded"))
                w.uint32(176).bool(m.isForwarded);
            if (m.quotedAd != null && Object.hasOwnProperty.call(m, "quotedAd"))
                $root.proto.ContextInfo.AdReplyInfo.encode(m.quotedAd, w.uint32(186).fork()).ldelim();
            if (m.placeholderKey != null && Object.hasOwnProperty.call(m, "placeholderKey"))
                $root.proto.MessageKey.encode(m.placeholderKey, w.uint32(194).fork()).ldelim();
            if (m.expiration != null && Object.hasOwnProperty.call(m, "expiration"))
                w.uint32(200).uint32(m.expiration);
            if (m.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(m, "ephemeralSettingTimestamp"))
                w.uint32(208).int64(m.ephemeralSettingTimestamp);
            if (m.ephemeralSharedSecret != null && Object.hasOwnProperty.call(m, "ephemeralSharedSecret"))
                w.uint32(218).bytes(m.ephemeralSharedSecret);
            if (m.externalAdReply != null && Object.hasOwnProperty.call(m, "externalAdReply"))
                $root.proto.ContextInfo.ExternalAdReplyInfo.encode(m.externalAdReply, w.uint32(226).fork()).ldelim();
            if (m.entryPointConversionSource != null && Object.hasOwnProperty.call(m, "entryPointConversionSource"))
                w.uint32(234).string(m.entryPointConversionSource);
            if (m.entryPointConversionApp != null && Object.hasOwnProperty.call(m, "entryPointConversionApp"))
                w.uint32(242).string(m.entryPointConversionApp);
            if (m.entryPointConversionDelaySeconds != null && Object.hasOwnProperty.call(m, "entryPointConversionDelaySeconds"))
                w.uint32(248).uint32(m.entryPointConversionDelaySeconds);
            if (m.disappearingMode != null && Object.hasOwnProperty.call(m, "disappearingMode"))
                $root.proto.DisappearingMode.encode(m.disappearingMode, w.uint32(258).fork()).ldelim();
            if (m.actionLink != null && Object.hasOwnProperty.call(m, "actionLink"))
                $root.proto.ActionLink.encode(m.actionLink, w.uint32(266).fork()).ldelim();
            if (m.groupSubject != null && Object.hasOwnProperty.call(m, "groupSubject"))
                w.uint32(274).string(m.groupSubject);
            if (m.parentGroupJid != null && Object.hasOwnProperty.call(m, "parentGroupJid"))
                w.uint32(282).string(m.parentGroupJid);
            if (m.trustBannerType != null && Object.hasOwnProperty.call(m, "trustBannerType"))
                w.uint32(298).string(m.trustBannerType);
            if (m.trustBannerAction != null && Object.hasOwnProperty.call(m, "trustBannerAction"))
                w.uint32(304).uint32(m.trustBannerAction);
            if (m.isSampled != null && Object.hasOwnProperty.call(m, "isSampled"))
                w.uint32(312).bool(m.isSampled);
            if (m.groupMentions != null && m.groupMentions.length) {
                for (var i = 0; i < m.groupMentions.length; ++i)
                    $root.proto.GroupMention.encode(m.groupMentions[i], w.uint32(322).fork()).ldelim();
            }
            if (m.utm != null && Object.hasOwnProperty.call(m, "utm"))
                $root.proto.ContextInfo.UTMInfo.encode(m.utm, w.uint32(330).fork()).ldelim();
            if (m.forwardedNewsletterMessageInfo != null && Object.hasOwnProperty.call(m, "forwardedNewsletterMessageInfo"))
                $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.encode(m.forwardedNewsletterMessageInfo, w.uint32(346).fork()).ldelim();
            if (m.businessMessageForwardInfo != null && Object.hasOwnProperty.call(m, "businessMessageForwardInfo"))
                $root.proto.ContextInfo.BusinessMessageForwardInfo.encode(m.businessMessageForwardInfo, w.uint32(354).fork()).ldelim();
            if (m.smbClientCampaignId != null && Object.hasOwnProperty.call(m, "smbClientCampaignId"))
                w.uint32(362).string(m.smbClientCampaignId);
            if (m.smbServerCampaignId != null && Object.hasOwnProperty.call(m, "smbServerCampaignId"))
                w.uint32(370).string(m.smbServerCampaignId);
            if (m.dataSharingContext != null && Object.hasOwnProperty.call(m, "dataSharingContext"))
                $root.proto.ContextInfo.DataSharingContext.encode(m.dataSharingContext, w.uint32(378).fork()).ldelim();
            if (m.alwaysShowAdAttribution != null && Object.hasOwnProperty.call(m, "alwaysShowAdAttribution"))
                w.uint32(384).bool(m.alwaysShowAdAttribution);
            if (m.featureEligibilities != null && Object.hasOwnProperty.call(m, "featureEligibilities"))
                $root.proto.ContextInfo.FeatureEligibilities.encode(m.featureEligibilities, w.uint32(394).fork()).ldelim();
            if (m.entryPointConversionExternalSource != null && Object.hasOwnProperty.call(m, "entryPointConversionExternalSource"))
                w.uint32(402).string(m.entryPointConversionExternalSource);
            if (m.entryPointConversionExternalMedium != null && Object.hasOwnProperty.call(m, "entryPointConversionExternalMedium"))
                w.uint32(410).string(m.entryPointConversionExternalMedium);
            if (m.ctwaSignals != null && Object.hasOwnProperty.call(m, "ctwaSignals"))
                w.uint32(434).string(m.ctwaSignals);
            if (m.ctwaPayload != null && Object.hasOwnProperty.call(m, "ctwaPayload"))
                w.uint32(442).bytes(m.ctwaPayload);
            if (m.forwardedAiBotMessageInfo != null && Object.hasOwnProperty.call(m, "forwardedAiBotMessageInfo"))
                $root.proto.ForwardedAIBotMessageInfo.encode(m.forwardedAiBotMessageInfo, w.uint32(450).fork()).ldelim();
            if (m.statusAttributionType != null && Object.hasOwnProperty.call(m, "statusAttributionType"))
                w.uint32(456).int32(m.statusAttributionType);
            if (m.urlTrackingMap != null && Object.hasOwnProperty.call(m, "urlTrackingMap"))
                $root.proto.UrlTrackingMap.encode(m.urlTrackingMap, w.uint32(466).fork()).ldelim();
            if (m.pairedMediaType != null && Object.hasOwnProperty.call(m, "pairedMediaType"))
                w.uint32(472).int32(m.pairedMediaType);
            if (m.rankingVersion != null && Object.hasOwnProperty.call(m, "rankingVersion"))
                w.uint32(480).uint32(m.rankingVersion);
            if (m.memberLabel != null && Object.hasOwnProperty.call(m, "memberLabel"))
                $root.proto.MemberLabel.encode(m.memberLabel, w.uint32(498).fork()).ldelim();
            if (m.isQuestion != null && Object.hasOwnProperty.call(m, "isQuestion"))
                w.uint32(504).bool(m.isQuestion);
            if (m.statusSourceType != null && Object.hasOwnProperty.call(m, "statusSourceType"))
                w.uint32(512).int32(m.statusSourceType);
            if (m.statusAttributions != null && m.statusAttributions.length) {
                for (var i = 0; i < m.statusAttributions.length; ++i)
                    $root.proto.StatusAttribution.encode(m.statusAttributions[i], w.uint32(522).fork()).ldelim();
            }
            if (m.isGroupStatus != null && Object.hasOwnProperty.call(m, "isGroupStatus"))
                w.uint32(528).bool(m.isGroupStatus);
            if (m.forwardOrigin != null && Object.hasOwnProperty.call(m, "forwardOrigin"))
                w.uint32(536).int32(m.forwardOrigin);
            if (m.questionReplyQuotedMessage != null && Object.hasOwnProperty.call(m, "questionReplyQuotedMessage"))
                $root.proto.ContextInfo.QuestionReplyQuotedMessage.encode(m.questionReplyQuotedMessage, w.uint32(546).fork()).ldelim();
            if (m.statusAudienceMetadata != null && Object.hasOwnProperty.call(m, "statusAudienceMetadata"))
                $root.proto.ContextInfo.StatusAudienceMetadata.encode(m.statusAudienceMetadata, w.uint32(554).fork()).ldelim();
            if (m.nonJidMentions != null && Object.hasOwnProperty.call(m, "nonJidMentions"))
                w.uint32(560).uint32(m.nonJidMentions);
            if (m.quotedType != null && Object.hasOwnProperty.call(m, "quotedType"))
                w.uint32(568).int32(m.quotedType);
            if (m.botMessageSharingInfo != null && Object.hasOwnProperty.call(m, "botMessageSharingInfo"))
                $root.proto.BotMessageSharingInfo.encode(m.botMessageSharingInfo, w.uint32(578).fork()).ldelim();
            return w;
        };

        ContextInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.stanzaId = r.string();
                        break;
                    }
                case 2: {
                        m.participant = r.string();
                        break;
                    }
                case 3: {
                        m.quotedMessage = $root.proto.Message.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.remoteJid = r.string();
                        break;
                    }
                case 15: {
                        if (!(m.mentionedJid && m.mentionedJid.length))
                            m.mentionedJid = [];
                        m.mentionedJid.push(r.string());
                        break;
                    }
                case 18: {
                        m.conversionSource = r.string();
                        break;
                    }
                case 19: {
                        m.conversionData = r.bytes();
                        break;
                    }
                case 20: {
                        m.conversionDelaySeconds = r.uint32();
                        break;
                    }
                case 21: {
                        m.forwardingScore = r.uint32();
                        break;
                    }
                case 22: {
                        m.isForwarded = r.bool();
                        break;
                    }
                case 23: {
                        m.quotedAd = $root.proto.ContextInfo.AdReplyInfo.decode(r, r.uint32());
                        break;
                    }
                case 24: {
                        m.placeholderKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 25: {
                        m.expiration = r.uint32();
                        break;
                    }
                case 26: {
                        m.ephemeralSettingTimestamp = r.int64();
                        break;
                    }
                case 27: {
                        m.ephemeralSharedSecret = r.bytes();
                        break;
                    }
                case 28: {
                        m.externalAdReply = $root.proto.ContextInfo.ExternalAdReplyInfo.decode(r, r.uint32());
                        break;
                    }
                case 29: {
                        m.entryPointConversionSource = r.string();
                        break;
                    }
                case 30: {
                        m.entryPointConversionApp = r.string();
                        break;
                    }
                case 31: {
                        m.entryPointConversionDelaySeconds = r.uint32();
                        break;
                    }
                case 32: {
                        m.disappearingMode = $root.proto.DisappearingMode.decode(r, r.uint32());
                        break;
                    }
                case 33: {
                        m.actionLink = $root.proto.ActionLink.decode(r, r.uint32());
                        break;
                    }
                case 34: {
                        m.groupSubject = r.string();
                        break;
                    }
                case 35: {
                        m.parentGroupJid = r.string();
                        break;
                    }
                case 37: {
                        m.trustBannerType = r.string();
                        break;
                    }
                case 38: {
                        m.trustBannerAction = r.uint32();
                        break;
                    }
                case 39: {
                        m.isSampled = r.bool();
                        break;
                    }
                case 40: {
                        if (!(m.groupMentions && m.groupMentions.length))
                            m.groupMentions = [];
                        m.groupMentions.push($root.proto.GroupMention.decode(r, r.uint32()));
                        break;
                    }
                case 41: {
                        m.utm = $root.proto.ContextInfo.UTMInfo.decode(r, r.uint32());
                        break;
                    }
                case 43: {
                        m.forwardedNewsletterMessageInfo = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(r, r.uint32());
                        break;
                    }
                case 44: {
                        m.businessMessageForwardInfo = $root.proto.ContextInfo.BusinessMessageForwardInfo.decode(r, r.uint32());
                        break;
                    }
                case 45: {
                        m.smbClientCampaignId = r.string();
                        break;
                    }
                case 46: {
                        m.smbServerCampaignId = r.string();
                        break;
                    }
                case 47: {
                        m.dataSharingContext = $root.proto.ContextInfo.DataSharingContext.decode(r, r.uint32());
                        break;
                    }
                case 48: {
                        m.alwaysShowAdAttribution = r.bool();
                        break;
                    }
                case 49: {
                        m.featureEligibilities = $root.proto.ContextInfo.FeatureEligibilities.decode(r, r.uint32());
                        break;
                    }
                case 50: {
                        m.entryPointConversionExternalSource = r.string();
                        break;
                    }
                case 51: {
                        m.entryPointConversionExternalMedium = r.string();
                        break;
                    }
                case 54: {
                        m.ctwaSignals = r.string();
                        break;
                    }
                case 55: {
                        m.ctwaPayload = r.bytes();
                        break;
                    }
                case 56: {
                        m.forwardedAiBotMessageInfo = $root.proto.ForwardedAIBotMessageInfo.decode(r, r.uint32());
                        break;
                    }
                case 57: {
                        m.statusAttributionType = r.int32();
                        break;
                    }
                case 58: {
                        m.urlTrackingMap = $root.proto.UrlTrackingMap.decode(r, r.uint32());
                        break;
                    }
                case 59: {
                        m.pairedMediaType = r.int32();
                        break;
                    }
                case 60: {
                        m.rankingVersion = r.uint32();
                        break;
                    }
                case 62: {
                        m.memberLabel = $root.proto.MemberLabel.decode(r, r.uint32());
                        break;
                    }
                case 63: {
                        m.isQuestion = r.bool();
                        break;
                    }
                case 64: {
                        m.statusSourceType = r.int32();
                        break;
                    }
                case 65: {
                        if (!(m.statusAttributions && m.statusAttributions.length))
                            m.statusAttributions = [];
                        m.statusAttributions.push($root.proto.StatusAttribution.decode(r, r.uint32()));
                        break;
                    }
                case 66: {
                        m.isGroupStatus = r.bool();
                        break;
                    }
                case 67: {
                        m.forwardOrigin = r.int32();
                        break;
                    }
                case 68: {
                        m.questionReplyQuotedMessage = $root.proto.ContextInfo.QuestionReplyQuotedMessage.decode(r, r.uint32());
                        break;
                    }
                case 69: {
                        m.statusAudienceMetadata = $root.proto.ContextInfo.StatusAudienceMetadata.decode(r, r.uint32());
                        break;
                    }
                case 70: {
                        m.nonJidMentions = r.uint32();
                        break;
                    }
                case 71: {
                        m.quotedType = r.int32();
                        break;
                    }
                case 72: {
                        m.botMessageSharingInfo = $root.proto.BotMessageSharingInfo.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ContextInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ContextInfo)
                return d;
            var m = new $root.proto.ContextInfo();
            if (d.stanzaId != null) {
                m.stanzaId = String(d.stanzaId);
            }
            if (d.participant != null) {
                m.participant = String(d.participant);
            }
            if (d.quotedMessage != null) {
                if (typeof d.quotedMessage !== "object")
                    throw TypeError(".proto.ContextInfo.quotedMessage: object expected");
                m.quotedMessage = $root.proto.Message.fromObject(d.quotedMessage);
            }
            if (d.remoteJid != null) {
                m.remoteJid = String(d.remoteJid);
            }
            if (d.mentionedJid) {
                if (!Array.isArray(d.mentionedJid))
                    throw TypeError(".proto.ContextInfo.mentionedJid: array expected");
                m.mentionedJid = [];
                for (var i = 0; i < d.mentionedJid.length; ++i) {
                    m.mentionedJid[i] = String(d.mentionedJid[i]);
                }
            }
            if (d.conversionSource != null) {
                m.conversionSource = String(d.conversionSource);
            }
            if (d.conversionData != null) {
                if (typeof d.conversionData === "string")
                    $util.base64.decode(d.conversionData, m.conversionData = $util.newBuffer($util.base64.length(d.conversionData)), 0);
                else if (d.conversionData.length >= 0)
                    m.conversionData = d.conversionData;
            }
            if (d.conversionDelaySeconds != null) {
                m.conversionDelaySeconds = d.conversionDelaySeconds >>> 0;
            }
            if (d.forwardingScore != null) {
                m.forwardingScore = d.forwardingScore >>> 0;
            }
            if (d.isForwarded != null) {
                m.isForwarded = Boolean(d.isForwarded);
            }
            if (d.quotedAd != null) {
                if (typeof d.quotedAd !== "object")
                    throw TypeError(".proto.ContextInfo.quotedAd: object expected");
                m.quotedAd = $root.proto.ContextInfo.AdReplyInfo.fromObject(d.quotedAd);
            }
            if (d.placeholderKey != null) {
                if (typeof d.placeholderKey !== "object")
                    throw TypeError(".proto.ContextInfo.placeholderKey: object expected");
                m.placeholderKey = $root.proto.MessageKey.fromObject(d.placeholderKey);
            }
            if (d.expiration != null) {
                m.expiration = d.expiration >>> 0;
            }
            if (d.ephemeralSettingTimestamp != null) {
                if ($util.Long)
                    (m.ephemeralSettingTimestamp = $util.Long.fromValue(d.ephemeralSettingTimestamp)).unsigned = false;
                else if (typeof d.ephemeralSettingTimestamp === "string")
                    m.ephemeralSettingTimestamp = parseInt(d.ephemeralSettingTimestamp, 10);
                else if (typeof d.ephemeralSettingTimestamp === "number")
                    m.ephemeralSettingTimestamp = d.ephemeralSettingTimestamp;
                else if (typeof d.ephemeralSettingTimestamp === "object")
                    m.ephemeralSettingTimestamp = new $util.LongBits(d.ephemeralSettingTimestamp.low >>> 0, d.ephemeralSettingTimestamp.high >>> 0).toNumber();
            }
            if (d.ephemeralSharedSecret != null) {
                if (typeof d.ephemeralSharedSecret === "string")
                    $util.base64.decode(d.ephemeralSharedSecret, m.ephemeralSharedSecret = $util.newBuffer($util.base64.length(d.ephemeralSharedSecret)), 0);
                else if (d.ephemeralSharedSecret.length >= 0)
                    m.ephemeralSharedSecret = d.ephemeralSharedSecret;
            }
            if (d.externalAdReply != null) {
                if (typeof d.externalAdReply !== "object")
                    throw TypeError(".proto.ContextInfo.externalAdReply: object expected");
                m.externalAdReply = $root.proto.ContextInfo.ExternalAdReplyInfo.fromObject(d.externalAdReply);
            }
            if (d.entryPointConversionSource != null) {
                m.entryPointConversionSource = String(d.entryPointConversionSource);
            }
            if (d.entryPointConversionApp != null) {
                m.entryPointConversionApp = String(d.entryPointConversionApp);
            }
            if (d.entryPointConversionDelaySeconds != null) {
                m.entryPointConversionDelaySeconds = d.entryPointConversionDelaySeconds >>> 0;
            }
            if (d.disappearingMode != null) {
                if (typeof d.disappearingMode !== "object")
                    throw TypeError(".proto.ContextInfo.disappearingMode: object expected");
                m.disappearingMode = $root.proto.DisappearingMode.fromObject(d.disappearingMode);
            }
            if (d.actionLink != null) {
                if (typeof d.actionLink !== "object")
                    throw TypeError(".proto.ContextInfo.actionLink: object expected");
                m.actionLink = $root.proto.ActionLink.fromObject(d.actionLink);
            }
            if (d.groupSubject != null) {
                m.groupSubject = String(d.groupSubject);
            }
            if (d.parentGroupJid != null) {
                m.parentGroupJid = String(d.parentGroupJid);
            }
            if (d.trustBannerType != null) {
                m.trustBannerType = String(d.trustBannerType);
            }
            if (d.trustBannerAction != null) {
                m.trustBannerAction = d.trustBannerAction >>> 0;
            }
            if (d.isSampled != null) {
                m.isSampled = Boolean(d.isSampled);
            }
            if (d.groupMentions) {
                if (!Array.isArray(d.groupMentions))
                    throw TypeError(".proto.ContextInfo.groupMentions: array expected");
                m.groupMentions = [];
                for (var i = 0; i < d.groupMentions.length; ++i) {
                    if (typeof d.groupMentions[i] !== "object")
                        throw TypeError(".proto.ContextInfo.groupMentions: object expected");
                    m.groupMentions[i] = $root.proto.GroupMention.fromObject(d.groupMentions[i]);
                }
            }
            if (d.utm != null) {
                if (typeof d.utm !== "object")
                    throw TypeError(".proto.ContextInfo.utm: object expected");
                m.utm = $root.proto.ContextInfo.UTMInfo.fromObject(d.utm);
            }
            if (d.forwardedNewsletterMessageInfo != null) {
                if (typeof d.forwardedNewsletterMessageInfo !== "object")
                    throw TypeError(".proto.ContextInfo.forwardedNewsletterMessageInfo: object expected");
                m.forwardedNewsletterMessageInfo = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.fromObject(d.forwardedNewsletterMessageInfo);
            }
            if (d.businessMessageForwardInfo != null) {
                if (typeof d.businessMessageForwardInfo !== "object")
                    throw TypeError(".proto.ContextInfo.businessMessageForwardInfo: object expected");
                m.businessMessageForwardInfo = $root.proto.ContextInfo.BusinessMessageForwardInfo.fromObject(d.businessMessageForwardInfo);
            }
            if (d.smbClientCampaignId != null) {
                m.smbClientCampaignId = String(d.smbClientCampaignId);
            }
            if (d.smbServerCampaignId != null) {
                m.smbServerCampaignId = String(d.smbServerCampaignId);
            }
            if (d.dataSharingContext != null) {
                if (typeof d.dataSharingContext !== "object")
                    throw TypeError(".proto.ContextInfo.dataSharingContext: object expected");
                m.dataSharingContext = $root.proto.ContextInfo.DataSharingContext.fromObject(d.dataSharingContext);
            }
            if (d.alwaysShowAdAttribution != null) {
                m.alwaysShowAdAttribution = Boolean(d.alwaysShowAdAttribution);
            }
            if (d.featureEligibilities != null) {
                if (typeof d.featureEligibilities !== "object")
                    throw TypeError(".proto.ContextInfo.featureEligibilities: object expected");
                m.featureEligibilities = $root.proto.ContextInfo.FeatureEligibilities.fromObject(d.featureEligibilities);
            }
            if (d.entryPointConversionExternalSource != null) {
                m.entryPointConversionExternalSource = String(d.entryPointConversionExternalSource);
            }
            if (d.entryPointConversionExternalMedium != null) {
                m.entryPointConversionExternalMedium = String(d.entryPointConversionExternalMedium);
            }
            if (d.ctwaSignals != null) {
                m.ctwaSignals = String(d.ctwaSignals);
            }
            if (d.ctwaPayload != null) {
                if (typeof d.ctwaPayload === "string")
                    $util.base64.decode(d.ctwaPayload, m.ctwaPayload = $util.newBuffer($util.base64.length(d.ctwaPayload)), 0);
                else if (d.ctwaPayload.length >= 0)
                    m.ctwaPayload = d.ctwaPayload;
            }
            if (d.forwardedAiBotMessageInfo != null) {
                if (typeof d.forwardedAiBotMessageInfo !== "object")
                    throw TypeError(".proto.ContextInfo.forwardedAiBotMessageInfo: object expected");
                m.forwardedAiBotMessageInfo = $root.proto.ForwardedAIBotMessageInfo.fromObject(d.forwardedAiBotMessageInfo);
            }
            switch (d.statusAttributionType) {
            default:
                if (typeof d.statusAttributionType === "number") {
                    m.statusAttributionType = d.statusAttributionType;
                    break;
                }
                break;
            case "NONE":
            case 0:
                m.statusAttributionType = 0;
                break;
            case "RESHARED_FROM_MENTION":
            case 1:
                m.statusAttributionType = 1;
                break;
            case "RESHARED_FROM_POST":
            case 2:
                m.statusAttributionType = 2;
                break;
            case "RESHARED_FROM_POST_MANY_TIMES":
            case 3:
                m.statusAttributionType = 3;
                break;
            case "FORWARDED_FROM_STATUS":
            case 4:
                m.statusAttributionType = 4;
                break;
            }
            if (d.urlTrackingMap != null) {
                if (typeof d.urlTrackingMap !== "object")
                    throw TypeError(".proto.ContextInfo.urlTrackingMap: object expected");
                m.urlTrackingMap = $root.proto.UrlTrackingMap.fromObject(d.urlTrackingMap);
            }
            switch (d.pairedMediaType) {
            default:
                if (typeof d.pairedMediaType === "number") {
                    m.pairedMediaType = d.pairedMediaType;
                    break;
                }
                break;
            case "NOT_PAIRED_MEDIA":
            case 0:
                m.pairedMediaType = 0;
                break;
            case "SD_VIDEO_PARENT":
            case 1:
                m.pairedMediaType = 1;
                break;
            case "HD_VIDEO_CHILD":
            case 2:
                m.pairedMediaType = 2;
                break;
            case "SD_IMAGE_PARENT":
            case 3:
                m.pairedMediaType = 3;
                break;
            case "HD_IMAGE_CHILD":
            case 4:
                m.pairedMediaType = 4;
                break;
            case "MOTION_PHOTO_PARENT":
            case 5:
                m.pairedMediaType = 5;
                break;
            case "MOTION_PHOTO_CHILD":
            case 6:
                m.pairedMediaType = 6;
                break;
            case "HEVC_VIDEO_PARENT":
            case 7:
                m.pairedMediaType = 7;
                break;
            case "HEVC_VIDEO_CHILD":
            case 8:
                m.pairedMediaType = 8;
                break;
            }
            if (d.rankingVersion != null) {
                m.rankingVersion = d.rankingVersion >>> 0;
            }
            if (d.memberLabel != null) {
                if (typeof d.memberLabel !== "object")
                    throw TypeError(".proto.ContextInfo.memberLabel: object expected");
                m.memberLabel = $root.proto.MemberLabel.fromObject(d.memberLabel);
            }
            if (d.isQuestion != null) {
                m.isQuestion = Boolean(d.isQuestion);
            }
            switch (d.statusSourceType) {
            default:
                if (typeof d.statusSourceType === "number") {
                    m.statusSourceType = d.statusSourceType;
                    break;
                }
                break;
            case "IMAGE":
            case 0:
                m.statusSourceType = 0;
                break;
            case "VIDEO":
            case 1:
                m.statusSourceType = 1;
                break;
            case "GIF":
            case 2:
                m.statusSourceType = 2;
                break;
            case "AUDIO":
            case 3:
                m.statusSourceType = 3;
                break;
            case "TEXT":
            case 4:
                m.statusSourceType = 4;
                break;
            case "MUSIC_STANDALONE":
            case 5:
                m.statusSourceType = 5;
                break;
            }
            if (d.statusAttributions) {
                if (!Array.isArray(d.statusAttributions))
                    throw TypeError(".proto.ContextInfo.statusAttributions: array expected");
                m.statusAttributions = [];
                for (var i = 0; i < d.statusAttributions.length; ++i) {
                    if (typeof d.statusAttributions[i] !== "object")
                        throw TypeError(".proto.ContextInfo.statusAttributions: object expected");
                    m.statusAttributions[i] = $root.proto.StatusAttribution.fromObject(d.statusAttributions[i]);
                }
            }
            if (d.isGroupStatus != null) {
                m.isGroupStatus = Boolean(d.isGroupStatus);
            }
            switch (d.forwardOrigin) {
            default:
                if (typeof d.forwardOrigin === "number") {
                    m.forwardOrigin = d.forwardOrigin;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.forwardOrigin = 0;
                break;
            case "CHAT":
            case 1:
                m.forwardOrigin = 1;
                break;
            case "STATUS":
            case 2:
                m.forwardOrigin = 2;
                break;
            case "CHANNELS":
            case 3:
                m.forwardOrigin = 3;
                break;
            case "META_AI":
            case 4:
                m.forwardOrigin = 4;
                break;
            case "UGC":
            case 5:
                m.forwardOrigin = 5;
                break;
            }
            if (d.questionReplyQuotedMessage != null) {
                if (typeof d.questionReplyQuotedMessage !== "object")
                    throw TypeError(".proto.ContextInfo.questionReplyQuotedMessage: object expected");
                m.questionReplyQuotedMessage = $root.proto.ContextInfo.QuestionReplyQuotedMessage.fromObject(d.questionReplyQuotedMessage);
            }
            if (d.statusAudienceMetadata != null) {
                if (typeof d.statusAudienceMetadata !== "object")
                    throw TypeError(".proto.ContextInfo.statusAudienceMetadata: object expected");
                m.statusAudienceMetadata = $root.proto.ContextInfo.StatusAudienceMetadata.fromObject(d.statusAudienceMetadata);
            }
            if (d.nonJidMentions != null) {
                m.nonJidMentions = d.nonJidMentions >>> 0;
            }
            switch (d.quotedType) {
            default:
                if (typeof d.quotedType === "number") {
                    m.quotedType = d.quotedType;
                    break;
                }
                break;
            case "EXPLICIT":
            case 0:
                m.quotedType = 0;
                break;
            case "AUTO":
            case 1:
                m.quotedType = 1;
                break;
            }
            if (d.botMessageSharingInfo != null) {
                if (typeof d.botMessageSharingInfo !== "object")
                    throw TypeError(".proto.ContextInfo.botMessageSharingInfo: object expected");
                m.botMessageSharingInfo = $root.proto.BotMessageSharingInfo.fromObject(d.botMessageSharingInfo);
            }
            return m;
        };

        ContextInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.mentionedJid = [];
                d.groupMentions = [];
                d.statusAttributions = [];
            }
            if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) {
                d.stanzaId = m.stanzaId;
                if (o.oneofs)
                    d._stanzaId = "stanzaId";
            }
            if (m.participant != null && m.hasOwnProperty("participant")) {
                d.participant = m.participant;
                if (o.oneofs)
                    d._participant = "participant";
            }
            if (m.quotedMessage != null && m.hasOwnProperty("quotedMessage")) {
                d.quotedMessage = $root.proto.Message.toObject(m.quotedMessage, o);
                if (o.oneofs)
                    d._quotedMessage = "quotedMessage";
            }
            if (m.remoteJid != null && m.hasOwnProperty("remoteJid")) {
                d.remoteJid = m.remoteJid;
                if (o.oneofs)
                    d._remoteJid = "remoteJid";
            }
            if (m.mentionedJid && m.mentionedJid.length) {
                d.mentionedJid = [];
                for (var j = 0; j < m.mentionedJid.length; ++j) {
                    d.mentionedJid[j] = m.mentionedJid[j];
                }
            }
            if (m.conversionSource != null && m.hasOwnProperty("conversionSource")) {
                d.conversionSource = m.conversionSource;
                if (o.oneofs)
                    d._conversionSource = "conversionSource";
            }
            if (m.conversionData != null && m.hasOwnProperty("conversionData")) {
                d.conversionData = o.bytes === String ? $util.base64.encode(m.conversionData, 0, m.conversionData.length) : o.bytes === Array ? Array.prototype.slice.call(m.conversionData) : m.conversionData;
                if (o.oneofs)
                    d._conversionData = "conversionData";
            }
            if (m.conversionDelaySeconds != null && m.hasOwnProperty("conversionDelaySeconds")) {
                d.conversionDelaySeconds = m.conversionDelaySeconds;
                if (o.oneofs)
                    d._conversionDelaySeconds = "conversionDelaySeconds";
            }
            if (m.forwardingScore != null && m.hasOwnProperty("forwardingScore")) {
                d.forwardingScore = m.forwardingScore;
                if (o.oneofs)
                    d._forwardingScore = "forwardingScore";
            }
            if (m.isForwarded != null && m.hasOwnProperty("isForwarded")) {
                d.isForwarded = m.isForwarded;
                if (o.oneofs)
                    d._isForwarded = "isForwarded";
            }
            if (m.quotedAd != null && m.hasOwnProperty("quotedAd")) {
                d.quotedAd = $root.proto.ContextInfo.AdReplyInfo.toObject(m.quotedAd, o);
                if (o.oneofs)
                    d._quotedAd = "quotedAd";
            }
            if (m.placeholderKey != null && m.hasOwnProperty("placeholderKey")) {
                d.placeholderKey = $root.proto.MessageKey.toObject(m.placeholderKey, o);
                if (o.oneofs)
                    d._placeholderKey = "placeholderKey";
            }
            if (m.expiration != null && m.hasOwnProperty("expiration")) {
                d.expiration = m.expiration;
                if (o.oneofs)
                    d._expiration = "expiration";
            }
            if (m.ephemeralSettingTimestamp != null && m.hasOwnProperty("ephemeralSettingTimestamp")) {
                if (typeof m.ephemeralSettingTimestamp === "number")
                    d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp;
                else
                    d.ephemeralSettingTimestamp = o.longs === String ? longToString(m.ephemeralSettingTimestamp) : o.longs === Number ? longToNumber(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp;
                if (o.oneofs)
                    d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp";
            }
            if (m.ephemeralSharedSecret != null && m.hasOwnProperty("ephemeralSharedSecret")) {
                d.ephemeralSharedSecret = o.bytes === String ? $util.base64.encode(m.ephemeralSharedSecret, 0, m.ephemeralSharedSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.ephemeralSharedSecret) : m.ephemeralSharedSecret;
                if (o.oneofs)
                    d._ephemeralSharedSecret = "ephemeralSharedSecret";
            }
            if (m.externalAdReply != null && m.hasOwnProperty("externalAdReply")) {
                d.externalAdReply = $root.proto.ContextInfo.ExternalAdReplyInfo.toObject(m.externalAdReply, o);
                if (o.oneofs)
                    d._externalAdReply = "externalAdReply";
            }
            if (m.entryPointConversionSource != null && m.hasOwnProperty("entryPointConversionSource")) {
                d.entryPointConversionSource = m.entryPointConversionSource;
                if (o.oneofs)
                    d._entryPointConversionSource = "entryPointConversionSource";
            }
            if (m.entryPointConversionApp != null && m.hasOwnProperty("entryPointConversionApp")) {
                d.entryPointConversionApp = m.entryPointConversionApp;
                if (o.oneofs)
                    d._entryPointConversionApp = "entryPointConversionApp";
            }
            if (m.entryPointConversionDelaySeconds != null && m.hasOwnProperty("entryPointConversionDelaySeconds")) {
                d.entryPointConversionDelaySeconds = m.entryPointConversionDelaySeconds;
                if (o.oneofs)
                    d._entryPointConversionDelaySeconds = "entryPointConversionDelaySeconds";
            }
            if (m.disappearingMode != null && m.hasOwnProperty("disappearingMode")) {
                d.disappearingMode = $root.proto.DisappearingMode.toObject(m.disappearingMode, o);
                if (o.oneofs)
                    d._disappearingMode = "disappearingMode";
            }
            if (m.actionLink != null && m.hasOwnProperty("actionLink")) {
                d.actionLink = $root.proto.ActionLink.toObject(m.actionLink, o);
                if (o.oneofs)
                    d._actionLink = "actionLink";
            }
            if (m.groupSubject != null && m.hasOwnProperty("groupSubject")) {
                d.groupSubject = m.groupSubject;
                if (o.oneofs)
                    d._groupSubject = "groupSubject";
            }
            if (m.parentGroupJid != null && m.hasOwnProperty("parentGroupJid")) {
                d.parentGroupJid = m.parentGroupJid;
                if (o.oneofs)
                    d._parentGroupJid = "parentGroupJid";
            }
            if (m.trustBannerType != null && m.hasOwnProperty("trustBannerType")) {
                d.trustBannerType = m.trustBannerType;
                if (o.oneofs)
                    d._trustBannerType = "trustBannerType";
            }
            if (m.trustBannerAction != null && m.hasOwnProperty("trustBannerAction")) {
                d.trustBannerAction = m.trustBannerAction;
                if (o.oneofs)
                    d._trustBannerAction = "trustBannerAction";
            }
            if (m.isSampled != null && m.hasOwnProperty("isSampled")) {
                d.isSampled = m.isSampled;
                if (o.oneofs)
                    d._isSampled = "isSampled";
            }
            if (m.groupMentions && m.groupMentions.length) {
                d.groupMentions = [];
                for (var j = 0; j < m.groupMentions.length; ++j) {
                    d.groupMentions[j] = $root.proto.GroupMention.toObject(m.groupMentions[j], o);
                }
            }
            if (m.utm != null && m.hasOwnProperty("utm")) {
                d.utm = $root.proto.ContextInfo.UTMInfo.toObject(m.utm, o);
                if (o.oneofs)
                    d._utm = "utm";
            }
            if (m.forwardedNewsletterMessageInfo != null && m.hasOwnProperty("forwardedNewsletterMessageInfo")) {
                d.forwardedNewsletterMessageInfo = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.toObject(m.forwardedNewsletterMessageInfo, o);
                if (o.oneofs)
                    d._forwardedNewsletterMessageInfo = "forwardedNewsletterMessageInfo";
            }
            if (m.businessMessageForwardInfo != null && m.hasOwnProperty("businessMessageForwardInfo")) {
                d.businessMessageForwardInfo = $root.proto.ContextInfo.BusinessMessageForwardInfo.toObject(m.businessMessageForwardInfo, o);
                if (o.oneofs)
                    d._businessMessageForwardInfo = "businessMessageForwardInfo";
            }
            if (m.smbClientCampaignId != null && m.hasOwnProperty("smbClientCampaignId")) {
                d.smbClientCampaignId = m.smbClientCampaignId;
                if (o.oneofs)
                    d._smbClientCampaignId = "smbClientCampaignId";
            }
            if (m.smbServerCampaignId != null && m.hasOwnProperty("smbServerCampaignId")) {
                d.smbServerCampaignId = m.smbServerCampaignId;
                if (o.oneofs)
                    d._smbServerCampaignId = "smbServerCampaignId";
            }
            if (m.dataSharingContext != null && m.hasOwnProperty("dataSharingContext")) {
                d.dataSharingContext = $root.proto.ContextInfo.DataSharingContext.toObject(m.dataSharingContext, o);
                if (o.oneofs)
                    d._dataSharingContext = "dataSharingContext";
            }
            if (m.alwaysShowAdAttribution != null && m.hasOwnProperty("alwaysShowAdAttribution")) {
                d.alwaysShowAdAttribution = m.alwaysShowAdAttribution;
                if (o.oneofs)
                    d._alwaysShowAdAttribution = "alwaysShowAdAttribution";
            }
            if (m.featureEligibilities != null && m.hasOwnProperty("featureEligibilities")) {
                d.featureEligibilities = $root.proto.ContextInfo.FeatureEligibilities.toObject(m.featureEligibilities, o);
                if (o.oneofs)
                    d._featureEligibilities = "featureEligibilities";
            }
            if (m.entryPointConversionExternalSource != null && m.hasOwnProperty("entryPointConversionExternalSource")) {
                d.entryPointConversionExternalSource = m.entryPointConversionExternalSource;
                if (o.oneofs)
                    d._entryPointConversionExternalSource = "entryPointConversionExternalSource";
            }
            if (m.entryPointConversionExternalMedium != null && m.hasOwnProperty("entryPointConversionExternalMedium")) {
                d.entryPointConversionExternalMedium = m.entryPointConversionExternalMedium;
                if (o.oneofs)
                    d._entryPointConversionExternalMedium = "entryPointConversionExternalMedium";
            }
            if (m.ctwaSignals != null && m.hasOwnProperty("ctwaSignals")) {
                d.ctwaSignals = m.ctwaSignals;
                if (o.oneofs)
                    d._ctwaSignals = "ctwaSignals";
            }
            if (m.ctwaPayload != null && m.hasOwnProperty("ctwaPayload")) {
                d.ctwaPayload = o.bytes === String ? $util.base64.encode(m.ctwaPayload, 0, m.ctwaPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.ctwaPayload) : m.ctwaPayload;
                if (o.oneofs)
                    d._ctwaPayload = "ctwaPayload";
            }
            if (m.forwardedAiBotMessageInfo != null && m.hasOwnProperty("forwardedAiBotMessageInfo")) {
                d.forwardedAiBotMessageInfo = $root.proto.ForwardedAIBotMessageInfo.toObject(m.forwardedAiBotMessageInfo, o);
                if (o.oneofs)
                    d._forwardedAiBotMessageInfo = "forwardedAiBotMessageInfo";
            }
            if (m.statusAttributionType != null && m.hasOwnProperty("statusAttributionType")) {
                d.statusAttributionType = o.enums === String ? $root.proto.ContextInfo.StatusAttributionType[m.statusAttributionType] === undefined ? m.statusAttributionType : $root.proto.ContextInfo.StatusAttributionType[m.statusAttributionType] : m.statusAttributionType;
                if (o.oneofs)
                    d._statusAttributionType = "statusAttributionType";
            }
            if (m.urlTrackingMap != null && m.hasOwnProperty("urlTrackingMap")) {
                d.urlTrackingMap = $root.proto.UrlTrackingMap.toObject(m.urlTrackingMap, o);
                if (o.oneofs)
                    d._urlTrackingMap = "urlTrackingMap";
            }
            if (m.pairedMediaType != null && m.hasOwnProperty("pairedMediaType")) {
                d.pairedMediaType = o.enums === String ? $root.proto.ContextInfo.PairedMediaType[m.pairedMediaType] === undefined ? m.pairedMediaType : $root.proto.ContextInfo.PairedMediaType[m.pairedMediaType] : m.pairedMediaType;
                if (o.oneofs)
                    d._pairedMediaType = "pairedMediaType";
            }
            if (m.rankingVersion != null && m.hasOwnProperty("rankingVersion")) {
                d.rankingVersion = m.rankingVersion;
                if (o.oneofs)
                    d._rankingVersion = "rankingVersion";
            }
            if (m.memberLabel != null && m.hasOwnProperty("memberLabel")) {
                d.memberLabel = $root.proto.MemberLabel.toObject(m.memberLabel, o);
                if (o.oneofs)
                    d._memberLabel = "memberLabel";
            }
            if (m.isQuestion != null && m.hasOwnProperty("isQuestion")) {
                d.isQuestion = m.isQuestion;
                if (o.oneofs)
                    d._isQuestion = "isQuestion";
            }
            if (m.statusSourceType != null && m.hasOwnProperty("statusSourceType")) {
                d.statusSourceType = o.enums === String ? $root.proto.ContextInfo.StatusSourceType[m.statusSourceType] === undefined ? m.statusSourceType : $root.proto.ContextInfo.StatusSourceType[m.statusSourceType] : m.statusSourceType;
                if (o.oneofs)
                    d._statusSourceType = "statusSourceType";
            }
            if (m.statusAttributions && m.statusAttributions.length) {
                d.statusAttributions = [];
                for (var j = 0; j < m.statusAttributions.length; ++j) {
                    d.statusAttributions[j] = $root.proto.StatusAttribution.toObject(m.statusAttributions[j], o);
                }
            }
            if (m.isGroupStatus != null && m.hasOwnProperty("isGroupStatus")) {
                d.isGroupStatus = m.isGroupStatus;
                if (o.oneofs)
                    d._isGroupStatus = "isGroupStatus";
            }
            if (m.forwardOrigin != null && m.hasOwnProperty("forwardOrigin")) {
                d.forwardOrigin = o.enums === String ? $root.proto.ContextInfo.ForwardOrigin[m.forwardOrigin] === undefined ? m.forwardOrigin : $root.proto.ContextInfo.ForwardOrigin[m.forwardOrigin] : m.forwardOrigin;
                if (o.oneofs)
                    d._forwardOrigin = "forwardOrigin";
            }
            if (m.questionReplyQuotedMessage != null && m.hasOwnProperty("questionReplyQuotedMessage")) {
                d.questionReplyQuotedMessage = $root.proto.ContextInfo.QuestionReplyQuotedMessage.toObject(m.questionReplyQuotedMessage, o);
                if (o.oneofs)
                    d._questionReplyQuotedMessage = "questionReplyQuotedMessage";
            }
            if (m.statusAudienceMetadata != null && m.hasOwnProperty("statusAudienceMetadata")) {
                d.statusAudienceMetadata = $root.proto.ContextInfo.StatusAudienceMetadata.toObject(m.statusAudienceMetadata, o);
                if (o.oneofs)
                    d._statusAudienceMetadata = "statusAudienceMetadata";
            }
            if (m.nonJidMentions != null && m.hasOwnProperty("nonJidMentions")) {
                d.nonJidMentions = m.nonJidMentions;
                if (o.oneofs)
                    d._nonJidMentions = "nonJidMentions";
            }
            if (m.quotedType != null && m.hasOwnProperty("quotedType")) {
                d.quotedType = o.enums === String ? $root.proto.ContextInfo.QuotedType[m.quotedType] === undefined ? m.quotedType : $root.proto.ContextInfo.QuotedType[m.quotedType] : m.quotedType;
                if (o.oneofs)
                    d._quotedType = "quotedType";
            }
            if (m.botMessageSharingInfo != null && m.hasOwnProperty("botMessageSharingInfo")) {
                d.botMessageSharingInfo = $root.proto.BotMessageSharingInfo.toObject(m.botMessageSharingInfo, o);
                if (o.oneofs)
                    d._botMessageSharingInfo = "botMessageSharingInfo";
            }
            return d;
        };

        ContextInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ContextInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ContextInfo";
        };

        ContextInfo.AdReplyInfo = (function() {

            function AdReplyInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AdReplyInfo.prototype.advertiserName = null;
            AdReplyInfo.prototype.mediaType = null;
            AdReplyInfo.prototype.jpegThumbnail = null;
            AdReplyInfo.prototype.caption = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AdReplyInfo.prototype, "_advertiserName", {
                get: $util.oneOfGetter($oneOfFields = ["advertiserName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AdReplyInfo.prototype, "_mediaType", {
                get: $util.oneOfGetter($oneOfFields = ["mediaType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AdReplyInfo.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AdReplyInfo.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AdReplyInfo.create = function create(properties) {
                return new AdReplyInfo(properties);
            };

            AdReplyInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.advertiserName != null && Object.hasOwnProperty.call(m, "advertiserName"))
                    w.uint32(10).string(m.advertiserName);
                if (m.mediaType != null && Object.hasOwnProperty.call(m, "mediaType"))
                    w.uint32(16).int32(m.mediaType);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(130).bytes(m.jpegThumbnail);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(138).string(m.caption);
                return w;
            };

            AdReplyInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.AdReplyInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.advertiserName = r.string();
                            break;
                        }
                    case 2: {
                            m.mediaType = r.int32();
                            break;
                        }
                    case 16: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 17: {
                            m.caption = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AdReplyInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.AdReplyInfo)
                    return d;
                var m = new $root.proto.ContextInfo.AdReplyInfo();
                if (d.advertiserName != null) {
                    m.advertiserName = String(d.advertiserName);
                }
                switch (d.mediaType) {
                default:
                    if (typeof d.mediaType === "number") {
                        m.mediaType = d.mediaType;
                        break;
                    }
                    break;
                case "NONE":
                case 0:
                    m.mediaType = 0;
                    break;
                case "IMAGE":
                case 1:
                    m.mediaType = 1;
                    break;
                case "VIDEO":
                case 2:
                    m.mediaType = 2;
                    break;
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                return m;
            };

            AdReplyInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.advertiserName != null && m.hasOwnProperty("advertiserName")) {
                    d.advertiserName = m.advertiserName;
                    if (o.oneofs)
                        d._advertiserName = "advertiserName";
                }
                if (m.mediaType != null && m.hasOwnProperty("mediaType")) {
                    d.mediaType = o.enums === String ? $root.proto.ContextInfo.AdReplyInfo.MediaType[m.mediaType] === undefined ? m.mediaType : $root.proto.ContextInfo.AdReplyInfo.MediaType[m.mediaType] : m.mediaType;
                    if (o.oneofs)
                        d._mediaType = "mediaType";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                return d;
            };

            AdReplyInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AdReplyInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.AdReplyInfo";
            };

            AdReplyInfo.MediaType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "NONE"] = 0;
                values[valuesById[1] = "IMAGE"] = 1;
                values[valuesById[2] = "VIDEO"] = 2;
                return values;
            })();

            return AdReplyInfo;
        })();

        ContextInfo.BusinessMessageForwardInfo = (function() {

            function BusinessMessageForwardInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BusinessMessageForwardInfo.prototype.businessOwnerJid = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BusinessMessageForwardInfo.prototype, "_businessOwnerJid", {
                get: $util.oneOfGetter($oneOfFields = ["businessOwnerJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BusinessMessageForwardInfo.create = function create(properties) {
                return new BusinessMessageForwardInfo(properties);
            };

            BusinessMessageForwardInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.businessOwnerJid != null && Object.hasOwnProperty.call(m, "businessOwnerJid"))
                    w.uint32(10).string(m.businessOwnerJid);
                return w;
            };

            BusinessMessageForwardInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.BusinessMessageForwardInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.businessOwnerJid = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BusinessMessageForwardInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.BusinessMessageForwardInfo)
                    return d;
                var m = new $root.proto.ContextInfo.BusinessMessageForwardInfo();
                if (d.businessOwnerJid != null) {
                    m.businessOwnerJid = String(d.businessOwnerJid);
                }
                return m;
            };

            BusinessMessageForwardInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.businessOwnerJid != null && m.hasOwnProperty("businessOwnerJid")) {
                    d.businessOwnerJid = m.businessOwnerJid;
                    if (o.oneofs)
                        d._businessOwnerJid = "businessOwnerJid";
                }
                return d;
            };

            BusinessMessageForwardInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BusinessMessageForwardInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.BusinessMessageForwardInfo";
            };

            return BusinessMessageForwardInfo;
        })();

        ContextInfo.DataSharingContext = (function() {

            function DataSharingContext(p) {
                this.parameters = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DataSharingContext.prototype.showMmDisclosure = null;
            DataSharingContext.prototype.encryptedSignalTokenConsented = null;
            DataSharingContext.prototype.parameters = $util.emptyArray;
            DataSharingContext.prototype.dataSharingFlags = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DataSharingContext.prototype, "_showMmDisclosure", {
                get: $util.oneOfGetter($oneOfFields = ["showMmDisclosure"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DataSharingContext.prototype, "_encryptedSignalTokenConsented", {
                get: $util.oneOfGetter($oneOfFields = ["encryptedSignalTokenConsented"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DataSharingContext.prototype, "_dataSharingFlags", {
                get: $util.oneOfGetter($oneOfFields = ["dataSharingFlags"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DataSharingContext.create = function create(properties) {
                return new DataSharingContext(properties);
            };

            DataSharingContext.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.showMmDisclosure != null && Object.hasOwnProperty.call(m, "showMmDisclosure"))
                    w.uint32(8).bool(m.showMmDisclosure);
                if (m.encryptedSignalTokenConsented != null && Object.hasOwnProperty.call(m, "encryptedSignalTokenConsented"))
                    w.uint32(18).string(m.encryptedSignalTokenConsented);
                if (m.parameters != null && m.parameters.length) {
                    for (var i = 0; i < m.parameters.length; ++i)
                        $root.proto.ContextInfo.DataSharingContext.Parameters.encode(m.parameters[i], w.uint32(26).fork()).ldelim();
                }
                if (m.dataSharingFlags != null && Object.hasOwnProperty.call(m, "dataSharingFlags"))
                    w.uint32(32).int32(m.dataSharingFlags);
                return w;
            };

            DataSharingContext.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.DataSharingContext();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.showMmDisclosure = r.bool();
                            break;
                        }
                    case 2: {
                            m.encryptedSignalTokenConsented = r.string();
                            break;
                        }
                    case 3: {
                            if (!(m.parameters && m.parameters.length))
                                m.parameters = [];
                            m.parameters.push($root.proto.ContextInfo.DataSharingContext.Parameters.decode(r, r.uint32()));
                            break;
                        }
                    case 4: {
                            m.dataSharingFlags = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DataSharingContext.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.DataSharingContext)
                    return d;
                var m = new $root.proto.ContextInfo.DataSharingContext();
                if (d.showMmDisclosure != null) {
                    m.showMmDisclosure = Boolean(d.showMmDisclosure);
                }
                if (d.encryptedSignalTokenConsented != null) {
                    m.encryptedSignalTokenConsented = String(d.encryptedSignalTokenConsented);
                }
                if (d.parameters) {
                    if (!Array.isArray(d.parameters))
                        throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: array expected");
                    m.parameters = [];
                    for (var i = 0; i < d.parameters.length; ++i) {
                        if (typeof d.parameters[i] !== "object")
                            throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: object expected");
                        m.parameters[i] = $root.proto.ContextInfo.DataSharingContext.Parameters.fromObject(d.parameters[i]);
                    }
                }
                if (d.dataSharingFlags != null) {
                    m.dataSharingFlags = d.dataSharingFlags | 0;
                }
                return m;
            };

            DataSharingContext.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.parameters = [];
                }
                if (m.showMmDisclosure != null && m.hasOwnProperty("showMmDisclosure")) {
                    d.showMmDisclosure = m.showMmDisclosure;
                    if (o.oneofs)
                        d._showMmDisclosure = "showMmDisclosure";
                }
                if (m.encryptedSignalTokenConsented != null && m.hasOwnProperty("encryptedSignalTokenConsented")) {
                    d.encryptedSignalTokenConsented = m.encryptedSignalTokenConsented;
                    if (o.oneofs)
                        d._encryptedSignalTokenConsented = "encryptedSignalTokenConsented";
                }
                if (m.parameters && m.parameters.length) {
                    d.parameters = [];
                    for (var j = 0; j < m.parameters.length; ++j) {
                        d.parameters[j] = $root.proto.ContextInfo.DataSharingContext.Parameters.toObject(m.parameters[j], o);
                    }
                }
                if (m.dataSharingFlags != null && m.hasOwnProperty("dataSharingFlags")) {
                    d.dataSharingFlags = m.dataSharingFlags;
                    if (o.oneofs)
                        d._dataSharingFlags = "dataSharingFlags";
                }
                return d;
            };

            DataSharingContext.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DataSharingContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.DataSharingContext";
            };

            DataSharingContext.DataSharingFlags = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "SHOW_MM_DISCLOSURE_ON_CLICK"] = 1;
                values[valuesById[2] = "SHOW_MM_DISCLOSURE_ON_READ"] = 2;
                return values;
            })();

            DataSharingContext.Parameters = (function() {

                function Parameters(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Parameters.prototype.key = null;
                Parameters.prototype.stringData = null;
                Parameters.prototype.intData = null;
                Parameters.prototype.floatData = null;
                Parameters.prototype.contents = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Parameters.prototype, "_key", {
                    get: $util.oneOfGetter($oneOfFields = ["key"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Parameters.prototype, "_stringData", {
                    get: $util.oneOfGetter($oneOfFields = ["stringData"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Parameters.prototype, "_intData", {
                    get: $util.oneOfGetter($oneOfFields = ["intData"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Parameters.prototype, "_floatData", {
                    get: $util.oneOfGetter($oneOfFields = ["floatData"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Parameters.prototype, "_contents", {
                    get: $util.oneOfGetter($oneOfFields = ["contents"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Parameters.create = function create(properties) {
                    return new Parameters(properties);
                };

                Parameters.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                        w.uint32(10).string(m.key);
                    if (m.stringData != null && Object.hasOwnProperty.call(m, "stringData"))
                        w.uint32(18).string(m.stringData);
                    if (m.intData != null && Object.hasOwnProperty.call(m, "intData"))
                        w.uint32(24).int64(m.intData);
                    if (m.floatData != null && Object.hasOwnProperty.call(m, "floatData"))
                        w.uint32(37).float(m.floatData);
                    if (m.contents != null && Object.hasOwnProperty.call(m, "contents"))
                        $root.proto.ContextInfo.DataSharingContext.Parameters.encode(m.contents, w.uint32(42).fork()).ldelim();
                    return w;
                };

                Parameters.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.DataSharingContext.Parameters();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.key = r.string();
                                break;
                            }
                        case 2: {
                                m.stringData = r.string();
                                break;
                            }
                        case 3: {
                                m.intData = r.int64();
                                break;
                            }
                        case 4: {
                                m.floatData = r.float();
                                break;
                            }
                        case 5: {
                                m.contents = $root.proto.ContextInfo.DataSharingContext.Parameters.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Parameters.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.ContextInfo.DataSharingContext.Parameters)
                        return d;
                    var m = new $root.proto.ContextInfo.DataSharingContext.Parameters();
                    if (d.key != null) {
                        m.key = String(d.key);
                    }
                    if (d.stringData != null) {
                        m.stringData = String(d.stringData);
                    }
                    if (d.intData != null) {
                        if ($util.Long)
                            (m.intData = $util.Long.fromValue(d.intData)).unsigned = false;
                        else if (typeof d.intData === "string")
                            m.intData = parseInt(d.intData, 10);
                        else if (typeof d.intData === "number")
                            m.intData = d.intData;
                        else if (typeof d.intData === "object")
                            m.intData = new $util.LongBits(d.intData.low >>> 0, d.intData.high >>> 0).toNumber();
                    }
                    if (d.floatData != null) {
                        m.floatData = Number(d.floatData);
                    }
                    if (d.contents != null) {
                        if (typeof d.contents !== "object")
                            throw TypeError(".proto.ContextInfo.DataSharingContext.Parameters.contents: object expected");
                        m.contents = $root.proto.ContextInfo.DataSharingContext.Parameters.fromObject(d.contents);
                    }
                    return m;
                };

                Parameters.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.key != null && m.hasOwnProperty("key")) {
                        d.key = m.key;
                        if (o.oneofs)
                            d._key = "key";
                    }
                    if (m.stringData != null && m.hasOwnProperty("stringData")) {
                        d.stringData = m.stringData;
                        if (o.oneofs)
                            d._stringData = "stringData";
                    }
                    if (m.intData != null && m.hasOwnProperty("intData")) {
                        if (typeof m.intData === "number")
                            d.intData = o.longs === String ? String(m.intData) : m.intData;
                        else
                            d.intData = o.longs === String ? longToString(m.intData) : o.longs === Number ? longToNumber(m.intData) : m.intData;
                        if (o.oneofs)
                            d._intData = "intData";
                    }
                    if (m.floatData != null && m.hasOwnProperty("floatData")) {
                        d.floatData = o.json && !isFinite(m.floatData) ? String(m.floatData) : m.floatData;
                        if (o.oneofs)
                            d._floatData = "floatData";
                    }
                    if (m.contents != null && m.hasOwnProperty("contents")) {
                        d.contents = $root.proto.ContextInfo.DataSharingContext.Parameters.toObject(m.contents, o);
                        if (o.oneofs)
                            d._contents = "contents";
                    }
                    return d;
                };

                Parameters.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Parameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.ContextInfo.DataSharingContext.Parameters";
                };

                return Parameters;
            })();

            return DataSharingContext;
        })();

        ContextInfo.ExternalAdReplyInfo = (function() {

            function ExternalAdReplyInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ExternalAdReplyInfo.prototype.title = null;
            ExternalAdReplyInfo.prototype.body = null;
            ExternalAdReplyInfo.prototype.mediaType = null;
            ExternalAdReplyInfo.prototype.thumbnailUrl = null;
            ExternalAdReplyInfo.prototype.mediaUrl = null;
            ExternalAdReplyInfo.prototype.thumbnail = null;
            ExternalAdReplyInfo.prototype.sourceType = null;
            ExternalAdReplyInfo.prototype.sourceId = null;
            ExternalAdReplyInfo.prototype.sourceUrl = null;
            ExternalAdReplyInfo.prototype.containsAutoReply = null;
            ExternalAdReplyInfo.prototype.renderLargerThumbnail = null;
            ExternalAdReplyInfo.prototype.showAdAttribution = null;
            ExternalAdReplyInfo.prototype.ctwaClid = null;
            ExternalAdReplyInfo.prototype.ref = null;
            ExternalAdReplyInfo.prototype.clickToWhatsappCall = null;
            ExternalAdReplyInfo.prototype.adContextPreviewDismissed = null;
            ExternalAdReplyInfo.prototype.sourceApp = null;
            ExternalAdReplyInfo.prototype.automatedGreetingMessageShown = null;
            ExternalAdReplyInfo.prototype.greetingMessageBody = null;
            ExternalAdReplyInfo.prototype.ctaPayload = null;
            ExternalAdReplyInfo.prototype.disableNudge = null;
            ExternalAdReplyInfo.prototype.originalImageUrl = null;
            ExternalAdReplyInfo.prototype.automatedGreetingMessageCtaType = null;
            ExternalAdReplyInfo.prototype.wtwaAdFormat = null;
            ExternalAdReplyInfo.prototype.adType = null;
            ExternalAdReplyInfo.prototype.wtwaWebsiteUrl = null;
            ExternalAdReplyInfo.prototype.adPreviewUrl = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_body", {
                get: $util.oneOfGetter($oneOfFields = ["body"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_mediaType", {
                get: $util.oneOfGetter($oneOfFields = ["mediaType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_thumbnailUrl", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_mediaUrl", {
                get: $util.oneOfGetter($oneOfFields = ["mediaUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_thumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_sourceType", {
                get: $util.oneOfGetter($oneOfFields = ["sourceType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_sourceId", {
                get: $util.oneOfGetter($oneOfFields = ["sourceId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_sourceUrl", {
                get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_containsAutoReply", {
                get: $util.oneOfGetter($oneOfFields = ["containsAutoReply"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_renderLargerThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["renderLargerThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_showAdAttribution", {
                get: $util.oneOfGetter($oneOfFields = ["showAdAttribution"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_ctwaClid", {
                get: $util.oneOfGetter($oneOfFields = ["ctwaClid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_ref", {
                get: $util.oneOfGetter($oneOfFields = ["ref"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_clickToWhatsappCall", {
                get: $util.oneOfGetter($oneOfFields = ["clickToWhatsappCall"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_adContextPreviewDismissed", {
                get: $util.oneOfGetter($oneOfFields = ["adContextPreviewDismissed"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_sourceApp", {
                get: $util.oneOfGetter($oneOfFields = ["sourceApp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_automatedGreetingMessageShown", {
                get: $util.oneOfGetter($oneOfFields = ["automatedGreetingMessageShown"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_greetingMessageBody", {
                get: $util.oneOfGetter($oneOfFields = ["greetingMessageBody"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_ctaPayload", {
                get: $util.oneOfGetter($oneOfFields = ["ctaPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_disableNudge", {
                get: $util.oneOfGetter($oneOfFields = ["disableNudge"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_originalImageUrl", {
                get: $util.oneOfGetter($oneOfFields = ["originalImageUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_automatedGreetingMessageCtaType", {
                get: $util.oneOfGetter($oneOfFields = ["automatedGreetingMessageCtaType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_wtwaAdFormat", {
                get: $util.oneOfGetter($oneOfFields = ["wtwaAdFormat"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_adType", {
                get: $util.oneOfGetter($oneOfFields = ["adType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_wtwaWebsiteUrl", {
                get: $util.oneOfGetter($oneOfFields = ["wtwaWebsiteUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalAdReplyInfo.prototype, "_adPreviewUrl", {
                get: $util.oneOfGetter($oneOfFields = ["adPreviewUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ExternalAdReplyInfo.create = function create(properties) {
                return new ExternalAdReplyInfo(properties);
            };

            ExternalAdReplyInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(10).string(m.title);
                if (m.body != null && Object.hasOwnProperty.call(m, "body"))
                    w.uint32(18).string(m.body);
                if (m.mediaType != null && Object.hasOwnProperty.call(m, "mediaType"))
                    w.uint32(24).int32(m.mediaType);
                if (m.thumbnailUrl != null && Object.hasOwnProperty.call(m, "thumbnailUrl"))
                    w.uint32(34).string(m.thumbnailUrl);
                if (m.mediaUrl != null && Object.hasOwnProperty.call(m, "mediaUrl"))
                    w.uint32(42).string(m.mediaUrl);
                if (m.thumbnail != null && Object.hasOwnProperty.call(m, "thumbnail"))
                    w.uint32(50).bytes(m.thumbnail);
                if (m.sourceType != null && Object.hasOwnProperty.call(m, "sourceType"))
                    w.uint32(58).string(m.sourceType);
                if (m.sourceId != null && Object.hasOwnProperty.call(m, "sourceId"))
                    w.uint32(66).string(m.sourceId);
                if (m.sourceUrl != null && Object.hasOwnProperty.call(m, "sourceUrl"))
                    w.uint32(74).string(m.sourceUrl);
                if (m.containsAutoReply != null && Object.hasOwnProperty.call(m, "containsAutoReply"))
                    w.uint32(80).bool(m.containsAutoReply);
                if (m.renderLargerThumbnail != null && Object.hasOwnProperty.call(m, "renderLargerThumbnail"))
                    w.uint32(88).bool(m.renderLargerThumbnail);
                if (m.showAdAttribution != null && Object.hasOwnProperty.call(m, "showAdAttribution"))
                    w.uint32(96).bool(m.showAdAttribution);
                if (m.ctwaClid != null && Object.hasOwnProperty.call(m, "ctwaClid"))
                    w.uint32(106).string(m.ctwaClid);
                if (m.ref != null && Object.hasOwnProperty.call(m, "ref"))
                    w.uint32(114).string(m.ref);
                if (m.clickToWhatsappCall != null && Object.hasOwnProperty.call(m, "clickToWhatsappCall"))
                    w.uint32(120).bool(m.clickToWhatsappCall);
                if (m.adContextPreviewDismissed != null && Object.hasOwnProperty.call(m, "adContextPreviewDismissed"))
                    w.uint32(128).bool(m.adContextPreviewDismissed);
                if (m.sourceApp != null && Object.hasOwnProperty.call(m, "sourceApp"))
                    w.uint32(138).string(m.sourceApp);
                if (m.automatedGreetingMessageShown != null && Object.hasOwnProperty.call(m, "automatedGreetingMessageShown"))
                    w.uint32(144).bool(m.automatedGreetingMessageShown);
                if (m.greetingMessageBody != null && Object.hasOwnProperty.call(m, "greetingMessageBody"))
                    w.uint32(154).string(m.greetingMessageBody);
                if (m.ctaPayload != null && Object.hasOwnProperty.call(m, "ctaPayload"))
                    w.uint32(162).string(m.ctaPayload);
                if (m.disableNudge != null && Object.hasOwnProperty.call(m, "disableNudge"))
                    w.uint32(168).bool(m.disableNudge);
                if (m.originalImageUrl != null && Object.hasOwnProperty.call(m, "originalImageUrl"))
                    w.uint32(178).string(m.originalImageUrl);
                if (m.automatedGreetingMessageCtaType != null && Object.hasOwnProperty.call(m, "automatedGreetingMessageCtaType"))
                    w.uint32(186).string(m.automatedGreetingMessageCtaType);
                if (m.wtwaAdFormat != null && Object.hasOwnProperty.call(m, "wtwaAdFormat"))
                    w.uint32(192).bool(m.wtwaAdFormat);
                if (m.adType != null && Object.hasOwnProperty.call(m, "adType"))
                    w.uint32(200).int32(m.adType);
                if (m.wtwaWebsiteUrl != null && Object.hasOwnProperty.call(m, "wtwaWebsiteUrl"))
                    w.uint32(210).string(m.wtwaWebsiteUrl);
                if (m.adPreviewUrl != null && Object.hasOwnProperty.call(m, "adPreviewUrl"))
                    w.uint32(218).string(m.adPreviewUrl);
                return w;
            };

            ExternalAdReplyInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.ExternalAdReplyInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.title = r.string();
                            break;
                        }
                    case 2: {
                            m.body = r.string();
                            break;
                        }
                    case 3: {
                            m.mediaType = r.int32();
                            break;
                        }
                    case 4: {
                            m.thumbnailUrl = r.string();
                            break;
                        }
                    case 5: {
                            m.mediaUrl = r.string();
                            break;
                        }
                    case 6: {
                            m.thumbnail = r.bytes();
                            break;
                        }
                    case 7: {
                            m.sourceType = r.string();
                            break;
                        }
                    case 8: {
                            m.sourceId = r.string();
                            break;
                        }
                    case 9: {
                            m.sourceUrl = r.string();
                            break;
                        }
                    case 10: {
                            m.containsAutoReply = r.bool();
                            break;
                        }
                    case 11: {
                            m.renderLargerThumbnail = r.bool();
                            break;
                        }
                    case 12: {
                            m.showAdAttribution = r.bool();
                            break;
                        }
                    case 13: {
                            m.ctwaClid = r.string();
                            break;
                        }
                    case 14: {
                            m.ref = r.string();
                            break;
                        }
                    case 15: {
                            m.clickToWhatsappCall = r.bool();
                            break;
                        }
                    case 16: {
                            m.adContextPreviewDismissed = r.bool();
                            break;
                        }
                    case 17: {
                            m.sourceApp = r.string();
                            break;
                        }
                    case 18: {
                            m.automatedGreetingMessageShown = r.bool();
                            break;
                        }
                    case 19: {
                            m.greetingMessageBody = r.string();
                            break;
                        }
                    case 20: {
                            m.ctaPayload = r.string();
                            break;
                        }
                    case 21: {
                            m.disableNudge = r.bool();
                            break;
                        }
                    case 22: {
                            m.originalImageUrl = r.string();
                            break;
                        }
                    case 23: {
                            m.automatedGreetingMessageCtaType = r.string();
                            break;
                        }
                    case 24: {
                            m.wtwaAdFormat = r.bool();
                            break;
                        }
                    case 25: {
                            m.adType = r.int32();
                            break;
                        }
                    case 26: {
                            m.wtwaWebsiteUrl = r.string();
                            break;
                        }
                    case 27: {
                            m.adPreviewUrl = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ExternalAdReplyInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.ExternalAdReplyInfo)
                    return d;
                var m = new $root.proto.ContextInfo.ExternalAdReplyInfo();
                if (d.title != null) {
                    m.title = String(d.title);
                }
                if (d.body != null) {
                    m.body = String(d.body);
                }
                switch (d.mediaType) {
                default:
                    if (typeof d.mediaType === "number") {
                        m.mediaType = d.mediaType;
                        break;
                    }
                    break;
                case "NONE":
                case 0:
                    m.mediaType = 0;
                    break;
                case "IMAGE":
                case 1:
                    m.mediaType = 1;
                    break;
                case "VIDEO":
                case 2:
                    m.mediaType = 2;
                    break;
                }
                if (d.thumbnailUrl != null) {
                    m.thumbnailUrl = String(d.thumbnailUrl);
                }
                if (d.mediaUrl != null) {
                    m.mediaUrl = String(d.mediaUrl);
                }
                if (d.thumbnail != null) {
                    if (typeof d.thumbnail === "string")
                        $util.base64.decode(d.thumbnail, m.thumbnail = $util.newBuffer($util.base64.length(d.thumbnail)), 0);
                    else if (d.thumbnail.length >= 0)
                        m.thumbnail = d.thumbnail;
                }
                if (d.sourceType != null) {
                    m.sourceType = String(d.sourceType);
                }
                if (d.sourceId != null) {
                    m.sourceId = String(d.sourceId);
                }
                if (d.sourceUrl != null) {
                    m.sourceUrl = String(d.sourceUrl);
                }
                if (d.containsAutoReply != null) {
                    m.containsAutoReply = Boolean(d.containsAutoReply);
                }
                if (d.renderLargerThumbnail != null) {
                    m.renderLargerThumbnail = Boolean(d.renderLargerThumbnail);
                }
                if (d.showAdAttribution != null) {
                    m.showAdAttribution = Boolean(d.showAdAttribution);
                }
                if (d.ctwaClid != null) {
                    m.ctwaClid = String(d.ctwaClid);
                }
                if (d.ref != null) {
                    m.ref = String(d.ref);
                }
                if (d.clickToWhatsappCall != null) {
                    m.clickToWhatsappCall = Boolean(d.clickToWhatsappCall);
                }
                if (d.adContextPreviewDismissed != null) {
                    m.adContextPreviewDismissed = Boolean(d.adContextPreviewDismissed);
                }
                if (d.sourceApp != null) {
                    m.sourceApp = String(d.sourceApp);
                }
                if (d.automatedGreetingMessageShown != null) {
                    m.automatedGreetingMessageShown = Boolean(d.automatedGreetingMessageShown);
                }
                if (d.greetingMessageBody != null) {
                    m.greetingMessageBody = String(d.greetingMessageBody);
                }
                if (d.ctaPayload != null) {
                    m.ctaPayload = String(d.ctaPayload);
                }
                if (d.disableNudge != null) {
                    m.disableNudge = Boolean(d.disableNudge);
                }
                if (d.originalImageUrl != null) {
                    m.originalImageUrl = String(d.originalImageUrl);
                }
                if (d.automatedGreetingMessageCtaType != null) {
                    m.automatedGreetingMessageCtaType = String(d.automatedGreetingMessageCtaType);
                }
                if (d.wtwaAdFormat != null) {
                    m.wtwaAdFormat = Boolean(d.wtwaAdFormat);
                }
                switch (d.adType) {
                default:
                    if (typeof d.adType === "number") {
                        m.adType = d.adType;
                        break;
                    }
                    break;
                case "CTWA":
                case 0:
                    m.adType = 0;
                    break;
                case "CAWC":
                case 1:
                    m.adType = 1;
                    break;
                }
                if (d.wtwaWebsiteUrl != null) {
                    m.wtwaWebsiteUrl = String(d.wtwaWebsiteUrl);
                }
                if (d.adPreviewUrl != null) {
                    m.adPreviewUrl = String(d.adPreviewUrl);
                }
                return m;
            };

            ExternalAdReplyInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.body != null && m.hasOwnProperty("body")) {
                    d.body = m.body;
                    if (o.oneofs)
                        d._body = "body";
                }
                if (m.mediaType != null && m.hasOwnProperty("mediaType")) {
                    d.mediaType = o.enums === String ? $root.proto.ContextInfo.ExternalAdReplyInfo.MediaType[m.mediaType] === undefined ? m.mediaType : $root.proto.ContextInfo.ExternalAdReplyInfo.MediaType[m.mediaType] : m.mediaType;
                    if (o.oneofs)
                        d._mediaType = "mediaType";
                }
                if (m.thumbnailUrl != null && m.hasOwnProperty("thumbnailUrl")) {
                    d.thumbnailUrl = m.thumbnailUrl;
                    if (o.oneofs)
                        d._thumbnailUrl = "thumbnailUrl";
                }
                if (m.mediaUrl != null && m.hasOwnProperty("mediaUrl")) {
                    d.mediaUrl = m.mediaUrl;
                    if (o.oneofs)
                        d._mediaUrl = "mediaUrl";
                }
                if (m.thumbnail != null && m.hasOwnProperty("thumbnail")) {
                    d.thumbnail = o.bytes === String ? $util.base64.encode(m.thumbnail, 0, m.thumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnail) : m.thumbnail;
                    if (o.oneofs)
                        d._thumbnail = "thumbnail";
                }
                if (m.sourceType != null && m.hasOwnProperty("sourceType")) {
                    d.sourceType = m.sourceType;
                    if (o.oneofs)
                        d._sourceType = "sourceType";
                }
                if (m.sourceId != null && m.hasOwnProperty("sourceId")) {
                    d.sourceId = m.sourceId;
                    if (o.oneofs)
                        d._sourceId = "sourceId";
                }
                if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) {
                    d.sourceUrl = m.sourceUrl;
                    if (o.oneofs)
                        d._sourceUrl = "sourceUrl";
                }
                if (m.containsAutoReply != null && m.hasOwnProperty("containsAutoReply")) {
                    d.containsAutoReply = m.containsAutoReply;
                    if (o.oneofs)
                        d._containsAutoReply = "containsAutoReply";
                }
                if (m.renderLargerThumbnail != null && m.hasOwnProperty("renderLargerThumbnail")) {
                    d.renderLargerThumbnail = m.renderLargerThumbnail;
                    if (o.oneofs)
                        d._renderLargerThumbnail = "renderLargerThumbnail";
                }
                if (m.showAdAttribution != null && m.hasOwnProperty("showAdAttribution")) {
                    d.showAdAttribution = m.showAdAttribution;
                    if (o.oneofs)
                        d._showAdAttribution = "showAdAttribution";
                }
                if (m.ctwaClid != null && m.hasOwnProperty("ctwaClid")) {
                    d.ctwaClid = m.ctwaClid;
                    if (o.oneofs)
                        d._ctwaClid = "ctwaClid";
                }
                if (m.ref != null && m.hasOwnProperty("ref")) {
                    d.ref = m.ref;
                    if (o.oneofs)
                        d._ref = "ref";
                }
                if (m.clickToWhatsappCall != null && m.hasOwnProperty("clickToWhatsappCall")) {
                    d.clickToWhatsappCall = m.clickToWhatsappCall;
                    if (o.oneofs)
                        d._clickToWhatsappCall = "clickToWhatsappCall";
                }
                if (m.adContextPreviewDismissed != null && m.hasOwnProperty("adContextPreviewDismissed")) {
                    d.adContextPreviewDismissed = m.adContextPreviewDismissed;
                    if (o.oneofs)
                        d._adContextPreviewDismissed = "adContextPreviewDismissed";
                }
                if (m.sourceApp != null && m.hasOwnProperty("sourceApp")) {
                    d.sourceApp = m.sourceApp;
                    if (o.oneofs)
                        d._sourceApp = "sourceApp";
                }
                if (m.automatedGreetingMessageShown != null && m.hasOwnProperty("automatedGreetingMessageShown")) {
                    d.automatedGreetingMessageShown = m.automatedGreetingMessageShown;
                    if (o.oneofs)
                        d._automatedGreetingMessageShown = "automatedGreetingMessageShown";
                }
                if (m.greetingMessageBody != null && m.hasOwnProperty("greetingMessageBody")) {
                    d.greetingMessageBody = m.greetingMessageBody;
                    if (o.oneofs)
                        d._greetingMessageBody = "greetingMessageBody";
                }
                if (m.ctaPayload != null && m.hasOwnProperty("ctaPayload")) {
                    d.ctaPayload = m.ctaPayload;
                    if (o.oneofs)
                        d._ctaPayload = "ctaPayload";
                }
                if (m.disableNudge != null && m.hasOwnProperty("disableNudge")) {
                    d.disableNudge = m.disableNudge;
                    if (o.oneofs)
                        d._disableNudge = "disableNudge";
                }
                if (m.originalImageUrl != null && m.hasOwnProperty("originalImageUrl")) {
                    d.originalImageUrl = m.originalImageUrl;
                    if (o.oneofs)
                        d._originalImageUrl = "originalImageUrl";
                }
                if (m.automatedGreetingMessageCtaType != null && m.hasOwnProperty("automatedGreetingMessageCtaType")) {
                    d.automatedGreetingMessageCtaType = m.automatedGreetingMessageCtaType;
                    if (o.oneofs)
                        d._automatedGreetingMessageCtaType = "automatedGreetingMessageCtaType";
                }
                if (m.wtwaAdFormat != null && m.hasOwnProperty("wtwaAdFormat")) {
                    d.wtwaAdFormat = m.wtwaAdFormat;
                    if (o.oneofs)
                        d._wtwaAdFormat = "wtwaAdFormat";
                }
                if (m.adType != null && m.hasOwnProperty("adType")) {
                    d.adType = o.enums === String ? $root.proto.ContextInfo.ExternalAdReplyInfo.AdType[m.adType] === undefined ? m.adType : $root.proto.ContextInfo.ExternalAdReplyInfo.AdType[m.adType] : m.adType;
                    if (o.oneofs)
                        d._adType = "adType";
                }
                if (m.wtwaWebsiteUrl != null && m.hasOwnProperty("wtwaWebsiteUrl")) {
                    d.wtwaWebsiteUrl = m.wtwaWebsiteUrl;
                    if (o.oneofs)
                        d._wtwaWebsiteUrl = "wtwaWebsiteUrl";
                }
                if (m.adPreviewUrl != null && m.hasOwnProperty("adPreviewUrl")) {
                    d.adPreviewUrl = m.adPreviewUrl;
                    if (o.oneofs)
                        d._adPreviewUrl = "adPreviewUrl";
                }
                return d;
            };

            ExternalAdReplyInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ExternalAdReplyInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.ExternalAdReplyInfo";
            };

            ExternalAdReplyInfo.AdType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "CTWA"] = 0;
                values[valuesById[1] = "CAWC"] = 1;
                return values;
            })();

            ExternalAdReplyInfo.MediaType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "NONE"] = 0;
                values[valuesById[1] = "IMAGE"] = 1;
                values[valuesById[2] = "VIDEO"] = 2;
                return values;
            })();

            return ExternalAdReplyInfo;
        })();

        ContextInfo.FeatureEligibilities = (function() {

            function FeatureEligibilities(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            FeatureEligibilities.prototype.cannotBeReactedTo = null;
            FeatureEligibilities.prototype.cannotBeRanked = null;
            FeatureEligibilities.prototype.canRequestFeedback = null;
            FeatureEligibilities.prototype.canBeReshared = null;
            FeatureEligibilities.prototype.canReceiveMultiReact = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(FeatureEligibilities.prototype, "_cannotBeReactedTo", {
                get: $util.oneOfGetter($oneOfFields = ["cannotBeReactedTo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(FeatureEligibilities.prototype, "_cannotBeRanked", {
                get: $util.oneOfGetter($oneOfFields = ["cannotBeRanked"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(FeatureEligibilities.prototype, "_canRequestFeedback", {
                get: $util.oneOfGetter($oneOfFields = ["canRequestFeedback"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(FeatureEligibilities.prototype, "_canBeReshared", {
                get: $util.oneOfGetter($oneOfFields = ["canBeReshared"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(FeatureEligibilities.prototype, "_canReceiveMultiReact", {
                get: $util.oneOfGetter($oneOfFields = ["canReceiveMultiReact"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            FeatureEligibilities.create = function create(properties) {
                return new FeatureEligibilities(properties);
            };

            FeatureEligibilities.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.cannotBeReactedTo != null && Object.hasOwnProperty.call(m, "cannotBeReactedTo"))
                    w.uint32(8).bool(m.cannotBeReactedTo);
                if (m.cannotBeRanked != null && Object.hasOwnProperty.call(m, "cannotBeRanked"))
                    w.uint32(16).bool(m.cannotBeRanked);
                if (m.canRequestFeedback != null && Object.hasOwnProperty.call(m, "canRequestFeedback"))
                    w.uint32(24).bool(m.canRequestFeedback);
                if (m.canBeReshared != null && Object.hasOwnProperty.call(m, "canBeReshared"))
                    w.uint32(32).bool(m.canBeReshared);
                if (m.canReceiveMultiReact != null && Object.hasOwnProperty.call(m, "canReceiveMultiReact"))
                    w.uint32(40).bool(m.canReceiveMultiReact);
                return w;
            };

            FeatureEligibilities.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.FeatureEligibilities();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.cannotBeReactedTo = r.bool();
                            break;
                        }
                    case 2: {
                            m.cannotBeRanked = r.bool();
                            break;
                        }
                    case 3: {
                            m.canRequestFeedback = r.bool();
                            break;
                        }
                    case 4: {
                            m.canBeReshared = r.bool();
                            break;
                        }
                    case 5: {
                            m.canReceiveMultiReact = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            FeatureEligibilities.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.FeatureEligibilities)
                    return d;
                var m = new $root.proto.ContextInfo.FeatureEligibilities();
                if (d.cannotBeReactedTo != null) {
                    m.cannotBeReactedTo = Boolean(d.cannotBeReactedTo);
                }
                if (d.cannotBeRanked != null) {
                    m.cannotBeRanked = Boolean(d.cannotBeRanked);
                }
                if (d.canRequestFeedback != null) {
                    m.canRequestFeedback = Boolean(d.canRequestFeedback);
                }
                if (d.canBeReshared != null) {
                    m.canBeReshared = Boolean(d.canBeReshared);
                }
                if (d.canReceiveMultiReact != null) {
                    m.canReceiveMultiReact = Boolean(d.canReceiveMultiReact);
                }
                return m;
            };

            FeatureEligibilities.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.cannotBeReactedTo != null && m.hasOwnProperty("cannotBeReactedTo")) {
                    d.cannotBeReactedTo = m.cannotBeReactedTo;
                    if (o.oneofs)
                        d._cannotBeReactedTo = "cannotBeReactedTo";
                }
                if (m.cannotBeRanked != null && m.hasOwnProperty("cannotBeRanked")) {
                    d.cannotBeRanked = m.cannotBeRanked;
                    if (o.oneofs)
                        d._cannotBeRanked = "cannotBeRanked";
                }
                if (m.canRequestFeedback != null && m.hasOwnProperty("canRequestFeedback")) {
                    d.canRequestFeedback = m.canRequestFeedback;
                    if (o.oneofs)
                        d._canRequestFeedback = "canRequestFeedback";
                }
                if (m.canBeReshared != null && m.hasOwnProperty("canBeReshared")) {
                    d.canBeReshared = m.canBeReshared;
                    if (o.oneofs)
                        d._canBeReshared = "canBeReshared";
                }
                if (m.canReceiveMultiReact != null && m.hasOwnProperty("canReceiveMultiReact")) {
                    d.canReceiveMultiReact = m.canReceiveMultiReact;
                    if (o.oneofs)
                        d._canReceiveMultiReact = "canReceiveMultiReact";
                }
                return d;
            };

            FeatureEligibilities.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            FeatureEligibilities.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.FeatureEligibilities";
            };

            return FeatureEligibilities;
        })();

        ContextInfo.ForwardOrigin = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "CHAT"] = 1;
            values[valuesById[2] = "STATUS"] = 2;
            values[valuesById[3] = "CHANNELS"] = 3;
            values[valuesById[4] = "META_AI"] = 4;
            values[valuesById[5] = "UGC"] = 5;
            return values;
        })();

        ContextInfo.ForwardedNewsletterMessageInfo = (function() {

            function ForwardedNewsletterMessageInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ForwardedNewsletterMessageInfo.prototype.newsletterJid = null;
            ForwardedNewsletterMessageInfo.prototype.serverMessageId = null;
            ForwardedNewsletterMessageInfo.prototype.newsletterName = null;
            ForwardedNewsletterMessageInfo.prototype.contentType = null;
            ForwardedNewsletterMessageInfo.prototype.accessibilityText = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_newsletterJid", {
                get: $util.oneOfGetter($oneOfFields = ["newsletterJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_serverMessageId", {
                get: $util.oneOfGetter($oneOfFields = ["serverMessageId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_newsletterName", {
                get: $util.oneOfGetter($oneOfFields = ["newsletterName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_contentType", {
                get: $util.oneOfGetter($oneOfFields = ["contentType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_accessibilityText", {
                get: $util.oneOfGetter($oneOfFields = ["accessibilityText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ForwardedNewsletterMessageInfo.create = function create(properties) {
                return new ForwardedNewsletterMessageInfo(properties);
            };

            ForwardedNewsletterMessageInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.newsletterJid != null && Object.hasOwnProperty.call(m, "newsletterJid"))
                    w.uint32(10).string(m.newsletterJid);
                if (m.serverMessageId != null && Object.hasOwnProperty.call(m, "serverMessageId"))
                    w.uint32(16).int32(m.serverMessageId);
                if (m.newsletterName != null && Object.hasOwnProperty.call(m, "newsletterName"))
                    w.uint32(26).string(m.newsletterName);
                if (m.contentType != null && Object.hasOwnProperty.call(m, "contentType"))
                    w.uint32(32).int32(m.contentType);
                if (m.accessibilityText != null && Object.hasOwnProperty.call(m, "accessibilityText"))
                    w.uint32(42).string(m.accessibilityText);
                return w;
            };

            ForwardedNewsletterMessageInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.ForwardedNewsletterMessageInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.newsletterJid = r.string();
                            break;
                        }
                    case 2: {
                            m.serverMessageId = r.int32();
                            break;
                        }
                    case 3: {
                            m.newsletterName = r.string();
                            break;
                        }
                    case 4: {
                            m.contentType = r.int32();
                            break;
                        }
                    case 5: {
                            m.accessibilityText = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ForwardedNewsletterMessageInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.ForwardedNewsletterMessageInfo)
                    return d;
                var m = new $root.proto.ContextInfo.ForwardedNewsletterMessageInfo();
                if (d.newsletterJid != null) {
                    m.newsletterJid = String(d.newsletterJid);
                }
                if (d.serverMessageId != null) {
                    m.serverMessageId = d.serverMessageId | 0;
                }
                if (d.newsletterName != null) {
                    m.newsletterName = String(d.newsletterName);
                }
                switch (d.contentType) {
                default:
                    if (typeof d.contentType === "number") {
                        m.contentType = d.contentType;
                        break;
                    }
                    break;
                case "UPDATE":
                case 1:
                    m.contentType = 1;
                    break;
                case "UPDATE_CARD":
                case 2:
                    m.contentType = 2;
                    break;
                case "LINK_CARD":
                case 3:
                    m.contentType = 3;
                    break;
                }
                if (d.accessibilityText != null) {
                    m.accessibilityText = String(d.accessibilityText);
                }
                return m;
            };

            ForwardedNewsletterMessageInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.newsletterJid != null && m.hasOwnProperty("newsletterJid")) {
                    d.newsletterJid = m.newsletterJid;
                    if (o.oneofs)
                        d._newsletterJid = "newsletterJid";
                }
                if (m.serverMessageId != null && m.hasOwnProperty("serverMessageId")) {
                    d.serverMessageId = m.serverMessageId;
                    if (o.oneofs)
                        d._serverMessageId = "serverMessageId";
                }
                if (m.newsletterName != null && m.hasOwnProperty("newsletterName")) {
                    d.newsletterName = m.newsletterName;
                    if (o.oneofs)
                        d._newsletterName = "newsletterName";
                }
                if (m.contentType != null && m.hasOwnProperty("contentType")) {
                    d.contentType = o.enums === String ? $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[m.contentType] === undefined ? m.contentType : $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[m.contentType] : m.contentType;
                    if (o.oneofs)
                        d._contentType = "contentType";
                }
                if (m.accessibilityText != null && m.hasOwnProperty("accessibilityText")) {
                    d.accessibilityText = m.accessibilityText;
                    if (o.oneofs)
                        d._accessibilityText = "accessibilityText";
                }
                return d;
            };

            ForwardedNewsletterMessageInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ForwardedNewsletterMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.ForwardedNewsletterMessageInfo";
            };

            ForwardedNewsletterMessageInfo.ContentType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "UPDATE"] = 1;
                values[valuesById[2] = "UPDATE_CARD"] = 2;
                values[valuesById[3] = "LINK_CARD"] = 3;
                return values;
            })();

            return ForwardedNewsletterMessageInfo;
        })();

        ContextInfo.PairedMediaType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "NOT_PAIRED_MEDIA"] = 0;
            values[valuesById[1] = "SD_VIDEO_PARENT"] = 1;
            values[valuesById[2] = "HD_VIDEO_CHILD"] = 2;
            values[valuesById[3] = "SD_IMAGE_PARENT"] = 3;
            values[valuesById[4] = "HD_IMAGE_CHILD"] = 4;
            values[valuesById[5] = "MOTION_PHOTO_PARENT"] = 5;
            values[valuesById[6] = "MOTION_PHOTO_CHILD"] = 6;
            values[valuesById[7] = "HEVC_VIDEO_PARENT"] = 7;
            values[valuesById[8] = "HEVC_VIDEO_CHILD"] = 8;
            return values;
        })();

        ContextInfo.QuestionReplyQuotedMessage = (function() {

            function QuestionReplyQuotedMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            QuestionReplyQuotedMessage.prototype.serverQuestionId = null;
            QuestionReplyQuotedMessage.prototype.quotedQuestion = null;
            QuestionReplyQuotedMessage.prototype.quotedResponse = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuestionReplyQuotedMessage.prototype, "_serverQuestionId", {
                get: $util.oneOfGetter($oneOfFields = ["serverQuestionId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuestionReplyQuotedMessage.prototype, "_quotedQuestion", {
                get: $util.oneOfGetter($oneOfFields = ["quotedQuestion"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuestionReplyQuotedMessage.prototype, "_quotedResponse", {
                get: $util.oneOfGetter($oneOfFields = ["quotedResponse"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            QuestionReplyQuotedMessage.create = function create(properties) {
                return new QuestionReplyQuotedMessage(properties);
            };

            QuestionReplyQuotedMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.serverQuestionId != null && Object.hasOwnProperty.call(m, "serverQuestionId"))
                    w.uint32(8).int32(m.serverQuestionId);
                if (m.quotedQuestion != null && Object.hasOwnProperty.call(m, "quotedQuestion"))
                    $root.proto.Message.encode(m.quotedQuestion, w.uint32(18).fork()).ldelim();
                if (m.quotedResponse != null && Object.hasOwnProperty.call(m, "quotedResponse"))
                    $root.proto.Message.encode(m.quotedResponse, w.uint32(26).fork()).ldelim();
                return w;
            };

            QuestionReplyQuotedMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.QuestionReplyQuotedMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.serverQuestionId = r.int32();
                            break;
                        }
                    case 2: {
                            m.quotedQuestion = $root.proto.Message.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.quotedResponse = $root.proto.Message.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            QuestionReplyQuotedMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.QuestionReplyQuotedMessage)
                    return d;
                var m = new $root.proto.ContextInfo.QuestionReplyQuotedMessage();
                if (d.serverQuestionId != null) {
                    m.serverQuestionId = d.serverQuestionId | 0;
                }
                if (d.quotedQuestion != null) {
                    if (typeof d.quotedQuestion !== "object")
                        throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedQuestion: object expected");
                    m.quotedQuestion = $root.proto.Message.fromObject(d.quotedQuestion);
                }
                if (d.quotedResponse != null) {
                    if (typeof d.quotedResponse !== "object")
                        throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedResponse: object expected");
                    m.quotedResponse = $root.proto.Message.fromObject(d.quotedResponse);
                }
                return m;
            };

            QuestionReplyQuotedMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.serverQuestionId != null && m.hasOwnProperty("serverQuestionId")) {
                    d.serverQuestionId = m.serverQuestionId;
                    if (o.oneofs)
                        d._serverQuestionId = "serverQuestionId";
                }
                if (m.quotedQuestion != null && m.hasOwnProperty("quotedQuestion")) {
                    d.quotedQuestion = $root.proto.Message.toObject(m.quotedQuestion, o);
                    if (o.oneofs)
                        d._quotedQuestion = "quotedQuestion";
                }
                if (m.quotedResponse != null && m.hasOwnProperty("quotedResponse")) {
                    d.quotedResponse = $root.proto.Message.toObject(m.quotedResponse, o);
                    if (o.oneofs)
                        d._quotedResponse = "quotedResponse";
                }
                return d;
            };

            QuestionReplyQuotedMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            QuestionReplyQuotedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.QuestionReplyQuotedMessage";
            };

            return QuestionReplyQuotedMessage;
        })();

        ContextInfo.QuotedType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "EXPLICIT"] = 0;
            values[valuesById[1] = "AUTO"] = 1;
            return values;
        })();

        ContextInfo.StatusAttributionType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "NONE"] = 0;
            values[valuesById[1] = "RESHARED_FROM_MENTION"] = 1;
            values[valuesById[2] = "RESHARED_FROM_POST"] = 2;
            values[valuesById[3] = "RESHARED_FROM_POST_MANY_TIMES"] = 3;
            values[valuesById[4] = "FORWARDED_FROM_STATUS"] = 4;
            return values;
        })();

        ContextInfo.StatusAudienceMetadata = (function() {

            function StatusAudienceMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StatusAudienceMetadata.prototype.audienceType = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusAudienceMetadata.prototype, "_audienceType", {
                get: $util.oneOfGetter($oneOfFields = ["audienceType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StatusAudienceMetadata.create = function create(properties) {
                return new StatusAudienceMetadata(properties);
            };

            StatusAudienceMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.audienceType != null && Object.hasOwnProperty.call(m, "audienceType"))
                    w.uint32(8).int32(m.audienceType);
                return w;
            };

            StatusAudienceMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.StatusAudienceMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.audienceType = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StatusAudienceMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.StatusAudienceMetadata)
                    return d;
                var m = new $root.proto.ContextInfo.StatusAudienceMetadata();
                switch (d.audienceType) {
                default:
                    if (typeof d.audienceType === "number") {
                        m.audienceType = d.audienceType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.audienceType = 0;
                    break;
                case "CLOSE_FRIENDS":
                case 1:
                    m.audienceType = 1;
                    break;
                }
                return m;
            };

            StatusAudienceMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.audienceType != null && m.hasOwnProperty("audienceType")) {
                    d.audienceType = o.enums === String ? $root.proto.ContextInfo.StatusAudienceMetadata.AudienceType[m.audienceType] === undefined ? m.audienceType : $root.proto.ContextInfo.StatusAudienceMetadata.AudienceType[m.audienceType] : m.audienceType;
                    if (o.oneofs)
                        d._audienceType = "audienceType";
                }
                return d;
            };

            StatusAudienceMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StatusAudienceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.StatusAudienceMetadata";
            };

            StatusAudienceMetadata.AudienceType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "CLOSE_FRIENDS"] = 1;
                return values;
            })();

            return StatusAudienceMetadata;
        })();

        ContextInfo.StatusSourceType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "IMAGE"] = 0;
            values[valuesById[1] = "VIDEO"] = 1;
            values[valuesById[2] = "GIF"] = 2;
            values[valuesById[3] = "AUDIO"] = 3;
            values[valuesById[4] = "TEXT"] = 4;
            values[valuesById[5] = "MUSIC_STANDALONE"] = 5;
            return values;
        })();

        ContextInfo.UTMInfo = (function() {

            function UTMInfo(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            UTMInfo.prototype.utmSource = null;
            UTMInfo.prototype.utmCampaign = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UTMInfo.prototype, "_utmSource", {
                get: $util.oneOfGetter($oneOfFields = ["utmSource"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UTMInfo.prototype, "_utmCampaign", {
                get: $util.oneOfGetter($oneOfFields = ["utmCampaign"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            UTMInfo.create = function create(properties) {
                return new UTMInfo(properties);
            };

            UTMInfo.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.utmSource != null && Object.hasOwnProperty.call(m, "utmSource"))
                    w.uint32(10).string(m.utmSource);
                if (m.utmCampaign != null && Object.hasOwnProperty.call(m, "utmCampaign"))
                    w.uint32(18).string(m.utmCampaign);
                return w;
            };

            UTMInfo.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContextInfo.UTMInfo();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.utmSource = r.string();
                            break;
                        }
                    case 2: {
                            m.utmCampaign = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            UTMInfo.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.ContextInfo.UTMInfo)
                    return d;
                var m = new $root.proto.ContextInfo.UTMInfo();
                if (d.utmSource != null) {
                    m.utmSource = String(d.utmSource);
                }
                if (d.utmCampaign != null) {
                    m.utmCampaign = String(d.utmCampaign);
                }
                return m;
            };

            UTMInfo.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.utmSource != null && m.hasOwnProperty("utmSource")) {
                    d.utmSource = m.utmSource;
                    if (o.oneofs)
                        d._utmSource = "utmSource";
                }
                if (m.utmCampaign != null && m.hasOwnProperty("utmCampaign")) {
                    d.utmCampaign = m.utmCampaign;
                    if (o.oneofs)
                        d._utmCampaign = "utmCampaign";
                }
                return d;
            };

            UTMInfo.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            UTMInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.ContextInfo.UTMInfo";
            };

            return UTMInfo;
        })();

        return ContextInfo;
    })();

    proto.Conversation = (function() {

        function Conversation(p) {
            this.messages = [];
            this.participant = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Conversation.prototype.id = "";
        Conversation.prototype.messages = $util.emptyArray;
        Conversation.prototype.newJid = null;
        Conversation.prototype.oldJid = null;
        Conversation.prototype.lastMsgTimestamp = null;
        Conversation.prototype.unreadCount = null;
        Conversation.prototype.readOnly = null;
        Conversation.prototype.endOfHistoryTransfer = null;
        Conversation.prototype.ephemeralExpiration = null;
        Conversation.prototype.ephemeralSettingTimestamp = null;
        Conversation.prototype.endOfHistoryTransferType = null;
        Conversation.prototype.conversationTimestamp = null;
        Conversation.prototype.name = null;
        Conversation.prototype.pHash = null;
        Conversation.prototype.notSpam = null;
        Conversation.prototype.archived = null;
        Conversation.prototype.disappearingMode = null;
        Conversation.prototype.unreadMentionCount = null;
        Conversation.prototype.markedAsUnread = null;
        Conversation.prototype.participant = $util.emptyArray;
        Conversation.prototype.tcToken = null;
        Conversation.prototype.tcTokenTimestamp = null;
        Conversation.prototype.contactPrimaryIdentityKey = null;
        Conversation.prototype.pinned = null;
        Conversation.prototype.muteEndTime = null;
        Conversation.prototype.wallpaper = null;
        Conversation.prototype.mediaVisibility = null;
        Conversation.prototype.tcTokenSenderTimestamp = null;
        Conversation.prototype.suspended = null;
        Conversation.prototype.terminated = null;
        Conversation.prototype.createdAt = null;
        Conversation.prototype.createdBy = null;
        Conversation.prototype.description = null;
        Conversation.prototype.support = null;
        Conversation.prototype.isParentGroup = null;
        Conversation.prototype.parentGroupId = null;
        Conversation.prototype.isDefaultSubgroup = null;
        Conversation.prototype.displayName = null;
        Conversation.prototype.pnJid = null;
        Conversation.prototype.shareOwnPn = null;
        Conversation.prototype.pnhDuplicateLidThread = null;
        Conversation.prototype.lidJid = null;
        Conversation.prototype.username = null;
        Conversation.prototype.lidOriginType = null;
        Conversation.prototype.commentsCount = null;
        Conversation.prototype.locked = null;
        Conversation.prototype.systemMessageToInsert = null;
        Conversation.prototype.capiCreatedGroup = null;
        Conversation.prototype.accountLid = null;
        Conversation.prototype.limitSharing = null;
        Conversation.prototype.limitSharingSettingTimestamp = null;
        Conversation.prototype.limitSharingTrigger = null;
        Conversation.prototype.limitSharingInitiatedByMe = null;
        Conversation.prototype.maibaAiThreadEnabled = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_newJid", {
            get: $util.oneOfGetter($oneOfFields = ["newJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_oldJid", {
            get: $util.oneOfGetter($oneOfFields = ["oldJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_lastMsgTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["lastMsgTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_unreadCount", {
            get: $util.oneOfGetter($oneOfFields = ["unreadCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_readOnly", {
            get: $util.oneOfGetter($oneOfFields = ["readOnly"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_endOfHistoryTransfer", {
            get: $util.oneOfGetter($oneOfFields = ["endOfHistoryTransfer"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_ephemeralExpiration", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralExpiration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_ephemeralSettingTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralSettingTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_endOfHistoryTransferType", {
            get: $util.oneOfGetter($oneOfFields = ["endOfHistoryTransferType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_conversationTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["conversationTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_name", {
            get: $util.oneOfGetter($oneOfFields = ["name"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_pHash", {
            get: $util.oneOfGetter($oneOfFields = ["pHash"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_notSpam", {
            get: $util.oneOfGetter($oneOfFields = ["notSpam"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_archived", {
            get: $util.oneOfGetter($oneOfFields = ["archived"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_disappearingMode", {
            get: $util.oneOfGetter($oneOfFields = ["disappearingMode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_unreadMentionCount", {
            get: $util.oneOfGetter($oneOfFields = ["unreadMentionCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_markedAsUnread", {
            get: $util.oneOfGetter($oneOfFields = ["markedAsUnread"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_tcToken", {
            get: $util.oneOfGetter($oneOfFields = ["tcToken"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_tcTokenTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["tcTokenTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_contactPrimaryIdentityKey", {
            get: $util.oneOfGetter($oneOfFields = ["contactPrimaryIdentityKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_pinned", {
            get: $util.oneOfGetter($oneOfFields = ["pinned"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_muteEndTime", {
            get: $util.oneOfGetter($oneOfFields = ["muteEndTime"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_wallpaper", {
            get: $util.oneOfGetter($oneOfFields = ["wallpaper"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_mediaVisibility", {
            get: $util.oneOfGetter($oneOfFields = ["mediaVisibility"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_tcTokenSenderTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["tcTokenSenderTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_suspended", {
            get: $util.oneOfGetter($oneOfFields = ["suspended"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_terminated", {
            get: $util.oneOfGetter($oneOfFields = ["terminated"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_createdAt", {
            get: $util.oneOfGetter($oneOfFields = ["createdAt"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_createdBy", {
            get: $util.oneOfGetter($oneOfFields = ["createdBy"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_description", {
            get: $util.oneOfGetter($oneOfFields = ["description"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_support", {
            get: $util.oneOfGetter($oneOfFields = ["support"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_isParentGroup", {
            get: $util.oneOfGetter($oneOfFields = ["isParentGroup"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_parentGroupId", {
            get: $util.oneOfGetter($oneOfFields = ["parentGroupId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_isDefaultSubgroup", {
            get: $util.oneOfGetter($oneOfFields = ["isDefaultSubgroup"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_displayName", {
            get: $util.oneOfGetter($oneOfFields = ["displayName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_pnJid", {
            get: $util.oneOfGetter($oneOfFields = ["pnJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_shareOwnPn", {
            get: $util.oneOfGetter($oneOfFields = ["shareOwnPn"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_pnhDuplicateLidThread", {
            get: $util.oneOfGetter($oneOfFields = ["pnhDuplicateLidThread"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_lidJid", {
            get: $util.oneOfGetter($oneOfFields = ["lidJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_username", {
            get: $util.oneOfGetter($oneOfFields = ["username"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_lidOriginType", {
            get: $util.oneOfGetter($oneOfFields = ["lidOriginType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_commentsCount", {
            get: $util.oneOfGetter($oneOfFields = ["commentsCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_locked", {
            get: $util.oneOfGetter($oneOfFields = ["locked"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_systemMessageToInsert", {
            get: $util.oneOfGetter($oneOfFields = ["systemMessageToInsert"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_capiCreatedGroup", {
            get: $util.oneOfGetter($oneOfFields = ["capiCreatedGroup"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_accountLid", {
            get: $util.oneOfGetter($oneOfFields = ["accountLid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_limitSharing", {
            get: $util.oneOfGetter($oneOfFields = ["limitSharing"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_limitSharingSettingTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["limitSharingSettingTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_limitSharingTrigger", {
            get: $util.oneOfGetter($oneOfFields = ["limitSharingTrigger"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_limitSharingInitiatedByMe", {
            get: $util.oneOfGetter($oneOfFields = ["limitSharingInitiatedByMe"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Conversation.prototype, "_maibaAiThreadEnabled", {
            get: $util.oneOfGetter($oneOfFields = ["maibaAiThreadEnabled"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Conversation.create = function create(properties) {
            return new Conversation(properties);
        };

        Conversation.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(10).string(m.id);
            if (m.messages != null && m.messages.length) {
                for (var i = 0; i < m.messages.length; ++i)
                    $root.proto.HistorySyncMsg.encode(m.messages[i], w.uint32(18).fork()).ldelim();
            }
            if (m.newJid != null && Object.hasOwnProperty.call(m, "newJid"))
                w.uint32(26).string(m.newJid);
            if (m.oldJid != null && Object.hasOwnProperty.call(m, "oldJid"))
                w.uint32(34).string(m.oldJid);
            if (m.lastMsgTimestamp != null && Object.hasOwnProperty.call(m, "lastMsgTimestamp"))
                w.uint32(40).uint64(m.lastMsgTimestamp);
            if (m.unreadCount != null && Object.hasOwnProperty.call(m, "unreadCount"))
                w.uint32(48).uint32(m.unreadCount);
            if (m.readOnly != null && Object.hasOwnProperty.call(m, "readOnly"))
                w.uint32(56).bool(m.readOnly);
            if (m.endOfHistoryTransfer != null && Object.hasOwnProperty.call(m, "endOfHistoryTransfer"))
                w.uint32(64).bool(m.endOfHistoryTransfer);
            if (m.ephemeralExpiration != null && Object.hasOwnProperty.call(m, "ephemeralExpiration"))
                w.uint32(72).uint32(m.ephemeralExpiration);
            if (m.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(m, "ephemeralSettingTimestamp"))
                w.uint32(80).int64(m.ephemeralSettingTimestamp);
            if (m.endOfHistoryTransferType != null && Object.hasOwnProperty.call(m, "endOfHistoryTransferType"))
                w.uint32(88).int32(m.endOfHistoryTransferType);
            if (m.conversationTimestamp != null && Object.hasOwnProperty.call(m, "conversationTimestamp"))
                w.uint32(96).uint64(m.conversationTimestamp);
            if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                w.uint32(106).string(m.name);
            if (m.pHash != null && Object.hasOwnProperty.call(m, "pHash"))
                w.uint32(114).string(m.pHash);
            if (m.notSpam != null && Object.hasOwnProperty.call(m, "notSpam"))
                w.uint32(120).bool(m.notSpam);
            if (m.archived != null && Object.hasOwnProperty.call(m, "archived"))
                w.uint32(128).bool(m.archived);
            if (m.disappearingMode != null && Object.hasOwnProperty.call(m, "disappearingMode"))
                $root.proto.DisappearingMode.encode(m.disappearingMode, w.uint32(138).fork()).ldelim();
            if (m.unreadMentionCount != null && Object.hasOwnProperty.call(m, "unreadMentionCount"))
                w.uint32(144).uint32(m.unreadMentionCount);
            if (m.markedAsUnread != null && Object.hasOwnProperty.call(m, "markedAsUnread"))
                w.uint32(152).bool(m.markedAsUnread);
            if (m.participant != null && m.participant.length) {
                for (var i = 0; i < m.participant.length; ++i)
                    $root.proto.GroupParticipant.encode(m.participant[i], w.uint32(162).fork()).ldelim();
            }
            if (m.tcToken != null && Object.hasOwnProperty.call(m, "tcToken"))
                w.uint32(170).bytes(m.tcToken);
            if (m.tcTokenTimestamp != null && Object.hasOwnProperty.call(m, "tcTokenTimestamp"))
                w.uint32(176).uint64(m.tcTokenTimestamp);
            if (m.contactPrimaryIdentityKey != null && Object.hasOwnProperty.call(m, "contactPrimaryIdentityKey"))
                w.uint32(186).bytes(m.contactPrimaryIdentityKey);
            if (m.pinned != null && Object.hasOwnProperty.call(m, "pinned"))
                w.uint32(192).uint32(m.pinned);
            if (m.muteEndTime != null && Object.hasOwnProperty.call(m, "muteEndTime"))
                w.uint32(200).uint64(m.muteEndTime);
            if (m.wallpaper != null && Object.hasOwnProperty.call(m, "wallpaper"))
                $root.proto.WallpaperSettings.encode(m.wallpaper, w.uint32(210).fork()).ldelim();
            if (m.mediaVisibility != null && Object.hasOwnProperty.call(m, "mediaVisibility"))
                w.uint32(216).int32(m.mediaVisibility);
            if (m.tcTokenSenderTimestamp != null && Object.hasOwnProperty.call(m, "tcTokenSenderTimestamp"))
                w.uint32(224).uint64(m.tcTokenSenderTimestamp);
            if (m.suspended != null && Object.hasOwnProperty.call(m, "suspended"))
                w.uint32(232).bool(m.suspended);
            if (m.terminated != null && Object.hasOwnProperty.call(m, "terminated"))
                w.uint32(240).bool(m.terminated);
            if (m.createdAt != null && Object.hasOwnProperty.call(m, "createdAt"))
                w.uint32(248).uint64(m.createdAt);
            if (m.createdBy != null && Object.hasOwnProperty.call(m, "createdBy"))
                w.uint32(258).string(m.createdBy);
            if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                w.uint32(266).string(m.description);
            if (m.support != null && Object.hasOwnProperty.call(m, "support"))
                w.uint32(272).bool(m.support);
            if (m.isParentGroup != null && Object.hasOwnProperty.call(m, "isParentGroup"))
                w.uint32(280).bool(m.isParentGroup);
            if (m.isDefaultSubgroup != null && Object.hasOwnProperty.call(m, "isDefaultSubgroup"))
                w.uint32(288).bool(m.isDefaultSubgroup);
            if (m.parentGroupId != null && Object.hasOwnProperty.call(m, "parentGroupId"))
                w.uint32(298).string(m.parentGroupId);
            if (m.displayName != null && Object.hasOwnProperty.call(m, "displayName"))
                w.uint32(306).string(m.displayName);
            if (m.pnJid != null && Object.hasOwnProperty.call(m, "pnJid"))
                w.uint32(314).string(m.pnJid);
            if (m.shareOwnPn != null && Object.hasOwnProperty.call(m, "shareOwnPn"))
                w.uint32(320).bool(m.shareOwnPn);
            if (m.pnhDuplicateLidThread != null && Object.hasOwnProperty.call(m, "pnhDuplicateLidThread"))
                w.uint32(328).bool(m.pnhDuplicateLidThread);
            if (m.lidJid != null && Object.hasOwnProperty.call(m, "lidJid"))
                w.uint32(338).string(m.lidJid);
            if (m.username != null && Object.hasOwnProperty.call(m, "username"))
                w.uint32(346).string(m.username);
            if (m.lidOriginType != null && Object.hasOwnProperty.call(m, "lidOriginType"))
                w.uint32(354).string(m.lidOriginType);
            if (m.commentsCount != null && Object.hasOwnProperty.call(m, "commentsCount"))
                w.uint32(360).uint32(m.commentsCount);
            if (m.locked != null && Object.hasOwnProperty.call(m, "locked"))
                w.uint32(368).bool(m.locked);
            if (m.systemMessageToInsert != null && Object.hasOwnProperty.call(m, "systemMessageToInsert"))
                w.uint32(376).int32(m.systemMessageToInsert);
            if (m.capiCreatedGroup != null && Object.hasOwnProperty.call(m, "capiCreatedGroup"))
                w.uint32(384).bool(m.capiCreatedGroup);
            if (m.accountLid != null && Object.hasOwnProperty.call(m, "accountLid"))
                w.uint32(394).string(m.accountLid);
            if (m.limitSharing != null && Object.hasOwnProperty.call(m, "limitSharing"))
                w.uint32(400).bool(m.limitSharing);
            if (m.limitSharingSettingTimestamp != null && Object.hasOwnProperty.call(m, "limitSharingSettingTimestamp"))
                w.uint32(408).int64(m.limitSharingSettingTimestamp);
            if (m.limitSharingTrigger != null && Object.hasOwnProperty.call(m, "limitSharingTrigger"))
                w.uint32(416).int32(m.limitSharingTrigger);
            if (m.limitSharingInitiatedByMe != null && Object.hasOwnProperty.call(m, "limitSharingInitiatedByMe"))
                w.uint32(424).bool(m.limitSharingInitiatedByMe);
            if (m.maibaAiThreadEnabled != null && Object.hasOwnProperty.call(m, "maibaAiThreadEnabled"))
                w.uint32(432).bool(m.maibaAiThreadEnabled);
            return w;
        };

        Conversation.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Conversation();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.string();
                        break;
                    }
                case 2: {
                        if (!(m.messages && m.messages.length))
                            m.messages = [];
                        m.messages.push($root.proto.HistorySyncMsg.decode(r, r.uint32()));
                        break;
                    }
                case 3: {
                        m.newJid = r.string();
                        break;
                    }
                case 4: {
                        m.oldJid = r.string();
                        break;
                    }
                case 5: {
                        m.lastMsgTimestamp = r.uint64();
                        break;
                    }
                case 6: {
                        m.unreadCount = r.uint32();
                        break;
                    }
                case 7: {
                        m.readOnly = r.bool();
                        break;
                    }
                case 8: {
                        m.endOfHistoryTransfer = r.bool();
                        break;
                    }
                case 9: {
                        m.ephemeralExpiration = r.uint32();
                        break;
                    }
                case 10: {
                        m.ephemeralSettingTimestamp = r.int64();
                        break;
                    }
                case 11: {
                        m.endOfHistoryTransferType = r.int32();
                        break;
                    }
                case 12: {
                        m.conversationTimestamp = r.uint64();
                        break;
                    }
                case 13: {
                        m.name = r.string();
                        break;
                    }
                case 14: {
                        m.pHash = r.string();
                        break;
                    }
                case 15: {
                        m.notSpam = r.bool();
                        break;
                    }
                case 16: {
                        m.archived = r.bool();
                        break;
                    }
                case 17: {
                        m.disappearingMode = $root.proto.DisappearingMode.decode(r, r.uint32());
                        break;
                    }
                case 18: {
                        m.unreadMentionCount = r.uint32();
                        break;
                    }
                case 19: {
                        m.markedAsUnread = r.bool();
                        break;
                    }
                case 20: {
                        if (!(m.participant && m.participant.length))
                            m.participant = [];
                        m.participant.push($root.proto.GroupParticipant.decode(r, r.uint32()));
                        break;
                    }
                case 21: {
                        m.tcToken = r.bytes();
                        break;
                    }
                case 22: {
                        m.tcTokenTimestamp = r.uint64();
                        break;
                    }
                case 23: {
                        m.contactPrimaryIdentityKey = r.bytes();
                        break;
                    }
                case 24: {
                        m.pinned = r.uint32();
                        break;
                    }
                case 25: {
                        m.muteEndTime = r.uint64();
                        break;
                    }
                case 26: {
                        m.wallpaper = $root.proto.WallpaperSettings.decode(r, r.uint32());
                        break;
                    }
                case 27: {
                        m.mediaVisibility = r.int32();
                        break;
                    }
                case 28: {
                        m.tcTokenSenderTimestamp = r.uint64();
                        break;
                    }
                case 29: {
                        m.suspended = r.bool();
                        break;
                    }
                case 30: {
                        m.terminated = r.bool();
                        break;
                    }
                case 31: {
                        m.createdAt = r.uint64();
                        break;
                    }
                case 32: {
                        m.createdBy = r.string();
                        break;
                    }
                case 33: {
                        m.description = r.string();
                        break;
                    }
                case 34: {
                        m.support = r.bool();
                        break;
                    }
                case 35: {
                        m.isParentGroup = r.bool();
                        break;
                    }
                case 37: {
                        m.parentGroupId = r.string();
                        break;
                    }
                case 36: {
                        m.isDefaultSubgroup = r.bool();
                        break;
                    }
                case 38: {
                        m.displayName = r.string();
                        break;
                    }
                case 39: {
                        m.pnJid = r.string();
                        break;
                    }
                case 40: {
                        m.shareOwnPn = r.bool();
                        break;
                    }
                case 41: {
                        m.pnhDuplicateLidThread = r.bool();
                        break;
                    }
                case 42: {
                        m.lidJid = r.string();
                        break;
                    }
                case 43: {
                        m.username = r.string();
                        break;
                    }
                case 44: {
                        m.lidOriginType = r.string();
                        break;
                    }
                case 45: {
                        m.commentsCount = r.uint32();
                        break;
                    }
                case 46: {
                        m.locked = r.bool();
                        break;
                    }
                case 47: {
                        m.systemMessageToInsert = r.int32();
                        break;
                    }
                case 48: {
                        m.capiCreatedGroup = r.bool();
                        break;
                    }
                case 49: {
                        m.accountLid = r.string();
                        break;
                    }
                case 50: {
                        m.limitSharing = r.bool();
                        break;
                    }
                case 51: {
                        m.limitSharingSettingTimestamp = r.int64();
                        break;
                    }
                case 52: {
                        m.limitSharingTrigger = r.int32();
                        break;
                    }
                case 53: {
                        m.limitSharingInitiatedByMe = r.bool();
                        break;
                    }
                case 54: {
                        m.maibaAiThreadEnabled = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Conversation.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Conversation)
                return d;
            var m = new $root.proto.Conversation();
            if (d.id != null) {
                m.id = String(d.id);
            }
            if (d.messages) {
                if (!Array.isArray(d.messages))
                    throw TypeError(".proto.Conversation.messages: array expected");
                m.messages = [];
                for (var i = 0; i < d.messages.length; ++i) {
                    if (typeof d.messages[i] !== "object")
                        throw TypeError(".proto.Conversation.messages: object expected");
                    m.messages[i] = $root.proto.HistorySyncMsg.fromObject(d.messages[i]);
                }
            }
            if (d.newJid != null) {
                m.newJid = String(d.newJid);
            }
            if (d.oldJid != null) {
                m.oldJid = String(d.oldJid);
            }
            if (d.lastMsgTimestamp != null) {
                if ($util.Long)
                    (m.lastMsgTimestamp = $util.Long.fromValue(d.lastMsgTimestamp)).unsigned = true;
                else if (typeof d.lastMsgTimestamp === "string")
                    m.lastMsgTimestamp = parseInt(d.lastMsgTimestamp, 10);
                else if (typeof d.lastMsgTimestamp === "number")
                    m.lastMsgTimestamp = d.lastMsgTimestamp;
                else if (typeof d.lastMsgTimestamp === "object")
                    m.lastMsgTimestamp = new $util.LongBits(d.lastMsgTimestamp.low >>> 0, d.lastMsgTimestamp.high >>> 0).toNumber(true);
            }
            if (d.unreadCount != null) {
                m.unreadCount = d.unreadCount >>> 0;
            }
            if (d.readOnly != null) {
                m.readOnly = Boolean(d.readOnly);
            }
            if (d.endOfHistoryTransfer != null) {
                m.endOfHistoryTransfer = Boolean(d.endOfHistoryTransfer);
            }
            if (d.ephemeralExpiration != null) {
                m.ephemeralExpiration = d.ephemeralExpiration >>> 0;
            }
            if (d.ephemeralSettingTimestamp != null) {
                if ($util.Long)
                    (m.ephemeralSettingTimestamp = $util.Long.fromValue(d.ephemeralSettingTimestamp)).unsigned = false;
                else if (typeof d.ephemeralSettingTimestamp === "string")
                    m.ephemeralSettingTimestamp = parseInt(d.ephemeralSettingTimestamp, 10);
                else if (typeof d.ephemeralSettingTimestamp === "number")
                    m.ephemeralSettingTimestamp = d.ephemeralSettingTimestamp;
                else if (typeof d.ephemeralSettingTimestamp === "object")
                    m.ephemeralSettingTimestamp = new $util.LongBits(d.ephemeralSettingTimestamp.low >>> 0, d.ephemeralSettingTimestamp.high >>> 0).toNumber();
            }
            switch (d.endOfHistoryTransferType) {
            default:
                if (typeof d.endOfHistoryTransferType === "number") {
                    m.endOfHistoryTransferType = d.endOfHistoryTransferType;
                    break;
                }
                break;
            case "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY":
            case 0:
                m.endOfHistoryTransferType = 0;
                break;
            case "COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY":
            case 1:
                m.endOfHistoryTransferType = 1;
                break;
            case "COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY":
            case 2:
                m.endOfHistoryTransferType = 2;
                break;
            }
            if (d.conversationTimestamp != null) {
                if ($util.Long)
                    (m.conversationTimestamp = $util.Long.fromValue(d.conversationTimestamp)).unsigned = true;
                else if (typeof d.conversationTimestamp === "string")
                    m.conversationTimestamp = parseInt(d.conversationTimestamp, 10);
                else if (typeof d.conversationTimestamp === "number")
                    m.conversationTimestamp = d.conversationTimestamp;
                else if (typeof d.conversationTimestamp === "object")
                    m.conversationTimestamp = new $util.LongBits(d.conversationTimestamp.low >>> 0, d.conversationTimestamp.high >>> 0).toNumber(true);
            }
            if (d.name != null) {
                m.name = String(d.name);
            }
            if (d.pHash != null) {
                m.pHash = String(d.pHash);
            }
            if (d.notSpam != null) {
                m.notSpam = Boolean(d.notSpam);
            }
            if (d.archived != null) {
                m.archived = Boolean(d.archived);
            }
            if (d.disappearingMode != null) {
                if (typeof d.disappearingMode !== "object")
                    throw TypeError(".proto.Conversation.disappearingMode: object expected");
                m.disappearingMode = $root.proto.DisappearingMode.fromObject(d.disappearingMode);
            }
            if (d.unreadMentionCount != null) {
                m.unreadMentionCount = d.unreadMentionCount >>> 0;
            }
            if (d.markedAsUnread != null) {
                m.markedAsUnread = Boolean(d.markedAsUnread);
            }
            if (d.participant) {
                if (!Array.isArray(d.participant))
                    throw TypeError(".proto.Conversation.participant: array expected");
                m.participant = [];
                for (var i = 0; i < d.participant.length; ++i) {
                    if (typeof d.participant[i] !== "object")
                        throw TypeError(".proto.Conversation.participant: object expected");
                    m.participant[i] = $root.proto.GroupParticipant.fromObject(d.participant[i]);
                }
            }
            if (d.tcToken != null) {
                if (typeof d.tcToken === "string")
                    $util.base64.decode(d.tcToken, m.tcToken = $util.newBuffer($util.base64.length(d.tcToken)), 0);
                else if (d.tcToken.length >= 0)
                    m.tcToken = d.tcToken;
            }
            if (d.tcTokenTimestamp != null) {
                if ($util.Long)
                    (m.tcTokenTimestamp = $util.Long.fromValue(d.tcTokenTimestamp)).unsigned = true;
                else if (typeof d.tcTokenTimestamp === "string")
                    m.tcTokenTimestamp = parseInt(d.tcTokenTimestamp, 10);
                else if (typeof d.tcTokenTimestamp === "number")
                    m.tcTokenTimestamp = d.tcTokenTimestamp;
                else if (typeof d.tcTokenTimestamp === "object")
                    m.tcTokenTimestamp = new $util.LongBits(d.tcTokenTimestamp.low >>> 0, d.tcTokenTimestamp.high >>> 0).toNumber(true);
            }
            if (d.contactPrimaryIdentityKey != null) {
                if (typeof d.contactPrimaryIdentityKey === "string")
                    $util.base64.decode(d.contactPrimaryIdentityKey, m.contactPrimaryIdentityKey = $util.newBuffer($util.base64.length(d.contactPrimaryIdentityKey)), 0);
                else if (d.contactPrimaryIdentityKey.length >= 0)
                    m.contactPrimaryIdentityKey = d.contactPrimaryIdentityKey;
            }
            if (d.pinned != null) {
                m.pinned = d.pinned >>> 0;
            }
            if (d.muteEndTime != null) {
                if ($util.Long)
                    (m.muteEndTime = $util.Long.fromValue(d.muteEndTime)).unsigned = true;
                else if (typeof d.muteEndTime === "string")
                    m.muteEndTime = parseInt(d.muteEndTime, 10);
                else if (typeof d.muteEndTime === "number")
                    m.muteEndTime = d.muteEndTime;
                else if (typeof d.muteEndTime === "object")
                    m.muteEndTime = new $util.LongBits(d.muteEndTime.low >>> 0, d.muteEndTime.high >>> 0).toNumber(true);
            }
            if (d.wallpaper != null) {
                if (typeof d.wallpaper !== "object")
                    throw TypeError(".proto.Conversation.wallpaper: object expected");
                m.wallpaper = $root.proto.WallpaperSettings.fromObject(d.wallpaper);
            }
            switch (d.mediaVisibility) {
            default:
                if (typeof d.mediaVisibility === "number") {
                    m.mediaVisibility = d.mediaVisibility;
                    break;
                }
                break;
            case "DEFAULT":
            case 0:
                m.mediaVisibility = 0;
                break;
            case "OFF":
            case 1:
                m.mediaVisibility = 1;
                break;
            case "ON":
            case 2:
                m.mediaVisibility = 2;
                break;
            }
            if (d.tcTokenSenderTimestamp != null) {
                if ($util.Long)
                    (m.tcTokenSenderTimestamp = $util.Long.fromValue(d.tcTokenSenderTimestamp)).unsigned = true;
                else if (typeof d.tcTokenSenderTimestamp === "string")
                    m.tcTokenSenderTimestamp = parseInt(d.tcTokenSenderTimestamp, 10);
                else if (typeof d.tcTokenSenderTimestamp === "number")
                    m.tcTokenSenderTimestamp = d.tcTokenSenderTimestamp;
                else if (typeof d.tcTokenSenderTimestamp === "object")
                    m.tcTokenSenderTimestamp = new $util.LongBits(d.tcTokenSenderTimestamp.low >>> 0, d.tcTokenSenderTimestamp.high >>> 0).toNumber(true);
            }
            if (d.suspended != null) {
                m.suspended = Boolean(d.suspended);
            }
            if (d.terminated != null) {
                m.terminated = Boolean(d.terminated);
            }
            if (d.createdAt != null) {
                if ($util.Long)
                    (m.createdAt = $util.Long.fromValue(d.createdAt)).unsigned = true;
                else if (typeof d.createdAt === "string")
                    m.createdAt = parseInt(d.createdAt, 10);
                else if (typeof d.createdAt === "number")
                    m.createdAt = d.createdAt;
                else if (typeof d.createdAt === "object")
                    m.createdAt = new $util.LongBits(d.createdAt.low >>> 0, d.createdAt.high >>> 0).toNumber(true);
            }
            if (d.createdBy != null) {
                m.createdBy = String(d.createdBy);
            }
            if (d.description != null) {
                m.description = String(d.description);
            }
            if (d.support != null) {
                m.support = Boolean(d.support);
            }
            if (d.isParentGroup != null) {
                m.isParentGroup = Boolean(d.isParentGroup);
            }
            if (d.parentGroupId != null) {
                m.parentGroupId = String(d.parentGroupId);
            }
            if (d.isDefaultSubgroup != null) {
                m.isDefaultSubgroup = Boolean(d.isDefaultSubgroup);
            }
            if (d.displayName != null) {
                m.displayName = String(d.displayName);
            }
            if (d.pnJid != null) {
                m.pnJid = String(d.pnJid);
            }
            if (d.shareOwnPn != null) {
                m.shareOwnPn = Boolean(d.shareOwnPn);
            }
            if (d.pnhDuplicateLidThread != null) {
                m.pnhDuplicateLidThread = Boolean(d.pnhDuplicateLidThread);
            }
            if (d.lidJid != null) {
                m.lidJid = String(d.lidJid);
            }
            if (d.username != null) {
                m.username = String(d.username);
            }
            if (d.lidOriginType != null) {
                m.lidOriginType = String(d.lidOriginType);
            }
            if (d.commentsCount != null) {
                m.commentsCount = d.commentsCount >>> 0;
            }
            if (d.locked != null) {
                m.locked = Boolean(d.locked);
            }
            switch (d.systemMessageToInsert) {
            default:
                if (typeof d.systemMessageToInsert === "number") {
                    m.systemMessageToInsert = d.systemMessageToInsert;
                    break;
                }
                break;
            case "E2EE_MSG":
            case 1:
                m.systemMessageToInsert = 1;
                break;
            case "NE2EE_SELF":
            case 2:
                m.systemMessageToInsert = 2;
                break;
            case "NE2EE_OTHER":
            case 3:
                m.systemMessageToInsert = 3;
                break;
            }
            if (d.capiCreatedGroup != null) {
                m.capiCreatedGroup = Boolean(d.capiCreatedGroup);
            }
            if (d.accountLid != null) {
                m.accountLid = String(d.accountLid);
            }
            if (d.limitSharing != null) {
                m.limitSharing = Boolean(d.limitSharing);
            }
            if (d.limitSharingSettingTimestamp != null) {
                if ($util.Long)
                    (m.limitSharingSettingTimestamp = $util.Long.fromValue(d.limitSharingSettingTimestamp)).unsigned = false;
                else if (typeof d.limitSharingSettingTimestamp === "string")
                    m.limitSharingSettingTimestamp = parseInt(d.limitSharingSettingTimestamp, 10);
                else if (typeof d.limitSharingSettingTimestamp === "number")
                    m.limitSharingSettingTimestamp = d.limitSharingSettingTimestamp;
                else if (typeof d.limitSharingSettingTimestamp === "object")
                    m.limitSharingSettingTimestamp = new $util.LongBits(d.limitSharingSettingTimestamp.low >>> 0, d.limitSharingSettingTimestamp.high >>> 0).toNumber();
            }
            switch (d.limitSharingTrigger) {
            default:
                if (typeof d.limitSharingTrigger === "number") {
                    m.limitSharingTrigger = d.limitSharingTrigger;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.limitSharingTrigger = 0;
                break;
            case "CHAT_SETTING":
            case 1:
                m.limitSharingTrigger = 1;
                break;
            case "BIZ_SUPPORTS_FB_HOSTING":
            case 2:
                m.limitSharingTrigger = 2;
                break;
            case "UNKNOWN_GROUP":
            case 3:
                m.limitSharingTrigger = 3;
                break;
            }
            if (d.limitSharingInitiatedByMe != null) {
                m.limitSharingInitiatedByMe = Boolean(d.limitSharingInitiatedByMe);
            }
            if (d.maibaAiThreadEnabled != null) {
                m.maibaAiThreadEnabled = Boolean(d.maibaAiThreadEnabled);
            }
            return m;
        };

        Conversation.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.messages = [];
                d.participant = [];
            }
            if (o.defaults) {
                d.id = "";
            }
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
            }
            if (m.messages && m.messages.length) {
                d.messages = [];
                for (var j = 0; j < m.messages.length; ++j) {
                    d.messages[j] = $root.proto.HistorySyncMsg.toObject(m.messages[j], o);
                }
            }
            if (m.newJid != null && m.hasOwnProperty("newJid")) {
                d.newJid = m.newJid;
                if (o.oneofs)
                    d._newJid = "newJid";
            }
            if (m.oldJid != null && m.hasOwnProperty("oldJid")) {
                d.oldJid = m.oldJid;
                if (o.oneofs)
                    d._oldJid = "oldJid";
            }
            if (m.lastMsgTimestamp != null && m.hasOwnProperty("lastMsgTimestamp")) {
                if (typeof m.lastMsgTimestamp === "number")
                    d.lastMsgTimestamp = o.longs === String ? String(m.lastMsgTimestamp) : m.lastMsgTimestamp;
                else
                    d.lastMsgTimestamp = o.longs === String ? longToString(m.lastMsgTimestamp, true) : o.longs === Number ? longToNumber(m.lastMsgTimestamp, true) : m.lastMsgTimestamp;
                if (o.oneofs)
                    d._lastMsgTimestamp = "lastMsgTimestamp";
            }
            if (m.unreadCount != null && m.hasOwnProperty("unreadCount")) {
                d.unreadCount = m.unreadCount;
                if (o.oneofs)
                    d._unreadCount = "unreadCount";
            }
            if (m.readOnly != null && m.hasOwnProperty("readOnly")) {
                d.readOnly = m.readOnly;
                if (o.oneofs)
                    d._readOnly = "readOnly";
            }
            if (m.endOfHistoryTransfer != null && m.hasOwnProperty("endOfHistoryTransfer")) {
                d.endOfHistoryTransfer = m.endOfHistoryTransfer;
                if (o.oneofs)
                    d._endOfHistoryTransfer = "endOfHistoryTransfer";
            }
            if (m.ephemeralExpiration != null && m.hasOwnProperty("ephemeralExpiration")) {
                d.ephemeralExpiration = m.ephemeralExpiration;
                if (o.oneofs)
                    d._ephemeralExpiration = "ephemeralExpiration";
            }
            if (m.ephemeralSettingTimestamp != null && m.hasOwnProperty("ephemeralSettingTimestamp")) {
                if (typeof m.ephemeralSettingTimestamp === "number")
                    d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp;
                else
                    d.ephemeralSettingTimestamp = o.longs === String ? longToString(m.ephemeralSettingTimestamp) : o.longs === Number ? longToNumber(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp;
                if (o.oneofs)
                    d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp";
            }
            if (m.endOfHistoryTransferType != null && m.hasOwnProperty("endOfHistoryTransferType")) {
                d.endOfHistoryTransferType = o.enums === String ? $root.proto.Conversation.EndOfHistoryTransferType[m.endOfHistoryTransferType] === undefined ? m.endOfHistoryTransferType : $root.proto.Conversation.EndOfHistoryTransferType[m.endOfHistoryTransferType] : m.endOfHistoryTransferType;
                if (o.oneofs)
                    d._endOfHistoryTransferType = "endOfHistoryTransferType";
            }
            if (m.conversationTimestamp != null && m.hasOwnProperty("conversationTimestamp")) {
                if (typeof m.conversationTimestamp === "number")
                    d.conversationTimestamp = o.longs === String ? String(m.conversationTimestamp) : m.conversationTimestamp;
                else
                    d.conversationTimestamp = o.longs === String ? longToString(m.conversationTimestamp, true) : o.longs === Number ? longToNumber(m.conversationTimestamp, true) : m.conversationTimestamp;
                if (o.oneofs)
                    d._conversationTimestamp = "conversationTimestamp";
            }
            if (m.name != null && m.hasOwnProperty("name")) {
                d.name = m.name;
                if (o.oneofs)
                    d._name = "name";
            }
            if (m.pHash != null && m.hasOwnProperty("pHash")) {
                d.pHash = m.pHash;
                if (o.oneofs)
                    d._pHash = "pHash";
            }
            if (m.notSpam != null && m.hasOwnProperty("notSpam")) {
                d.notSpam = m.notSpam;
                if (o.oneofs)
                    d._notSpam = "notSpam";
            }
            if (m.archived != null && m.hasOwnProperty("archived")) {
                d.archived = m.archived;
                if (o.oneofs)
                    d._archived = "archived";
            }
            if (m.disappearingMode != null && m.hasOwnProperty("disappearingMode")) {
                d.disappearingMode = $root.proto.DisappearingMode.toObject(m.disappearingMode, o);
                if (o.oneofs)
                    d._disappearingMode = "disappearingMode";
            }
            if (m.unreadMentionCount != null && m.hasOwnProperty("unreadMentionCount")) {
                d.unreadMentionCount = m.unreadMentionCount;
                if (o.oneofs)
                    d._unreadMentionCount = "unreadMentionCount";
            }
            if (m.markedAsUnread != null && m.hasOwnProperty("markedAsUnread")) {
                d.markedAsUnread = m.markedAsUnread;
                if (o.oneofs)
                    d._markedAsUnread = "markedAsUnread";
            }
            if (m.participant && m.participant.length) {
                d.participant = [];
                for (var j = 0; j < m.participant.length; ++j) {
                    d.participant[j] = $root.proto.GroupParticipant.toObject(m.participant[j], o);
                }
            }
            if (m.tcToken != null && m.hasOwnProperty("tcToken")) {
                d.tcToken = o.bytes === String ? $util.base64.encode(m.tcToken, 0, m.tcToken.length) : o.bytes === Array ? Array.prototype.slice.call(m.tcToken) : m.tcToken;
                if (o.oneofs)
                    d._tcToken = "tcToken";
            }
            if (m.tcTokenTimestamp != null && m.hasOwnProperty("tcTokenTimestamp")) {
                if (typeof m.tcTokenTimestamp === "number")
                    d.tcTokenTimestamp = o.longs === String ? String(m.tcTokenTimestamp) : m.tcTokenTimestamp;
                else
                    d.tcTokenTimestamp = o.longs === String ? longToString(m.tcTokenTimestamp, true) : o.longs === Number ? longToNumber(m.tcTokenTimestamp, true) : m.tcTokenTimestamp;
                if (o.oneofs)
                    d._tcTokenTimestamp = "tcTokenTimestamp";
            }
            if (m.contactPrimaryIdentityKey != null && m.hasOwnProperty("contactPrimaryIdentityKey")) {
                d.contactPrimaryIdentityKey = o.bytes === String ? $util.base64.encode(m.contactPrimaryIdentityKey, 0, m.contactPrimaryIdentityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.contactPrimaryIdentityKey) : m.contactPrimaryIdentityKey;
                if (o.oneofs)
                    d._contactPrimaryIdentityKey = "contactPrimaryIdentityKey";
            }
            if (m.pinned != null && m.hasOwnProperty("pinned")) {
                d.pinned = m.pinned;
                if (o.oneofs)
                    d._pinned = "pinned";
            }
            if (m.muteEndTime != null && m.hasOwnProperty("muteEndTime")) {
                if (typeof m.muteEndTime === "number")
                    d.muteEndTime = o.longs === String ? String(m.muteEndTime) : m.muteEndTime;
                else
                    d.muteEndTime = o.longs === String ? longToString(m.muteEndTime, true) : o.longs === Number ? longToNumber(m.muteEndTime, true) : m.muteEndTime;
                if (o.oneofs)
                    d._muteEndTime = "muteEndTime";
            }
            if (m.wallpaper != null && m.hasOwnProperty("wallpaper")) {
                d.wallpaper = $root.proto.WallpaperSettings.toObject(m.wallpaper, o);
                if (o.oneofs)
                    d._wallpaper = "wallpaper";
            }
            if (m.mediaVisibility != null && m.hasOwnProperty("mediaVisibility")) {
                d.mediaVisibility = o.enums === String ? $root.proto.MediaVisibility[m.mediaVisibility] === undefined ? m.mediaVisibility : $root.proto.MediaVisibility[m.mediaVisibility] : m.mediaVisibility;
                if (o.oneofs)
                    d._mediaVisibility = "mediaVisibility";
            }
            if (m.tcTokenSenderTimestamp != null && m.hasOwnProperty("tcTokenSenderTimestamp")) {
                if (typeof m.tcTokenSenderTimestamp === "number")
                    d.tcTokenSenderTimestamp = o.longs === String ? String(m.tcTokenSenderTimestamp) : m.tcTokenSenderTimestamp;
                else
                    d.tcTokenSenderTimestamp = o.longs === String ? longToString(m.tcTokenSenderTimestamp, true) : o.longs === Number ? longToNumber(m.tcTokenSenderTimestamp, true) : m.tcTokenSenderTimestamp;
                if (o.oneofs)
                    d._tcTokenSenderTimestamp = "tcTokenSenderTimestamp";
            }
            if (m.suspended != null && m.hasOwnProperty("suspended")) {
                d.suspended = m.suspended;
                if (o.oneofs)
                    d._suspended = "suspended";
            }
            if (m.terminated != null && m.hasOwnProperty("terminated")) {
                d.terminated = m.terminated;
                if (o.oneofs)
                    d._terminated = "terminated";
            }
            if (m.createdAt != null && m.hasOwnProperty("createdAt")) {
                if (typeof m.createdAt === "number")
                    d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt;
                else
                    d.createdAt = o.longs === String ? longToString(m.createdAt, true) : o.longs === Number ? longToNumber(m.createdAt, true) : m.createdAt;
                if (o.oneofs)
                    d._createdAt = "createdAt";
            }
            if (m.createdBy != null && m.hasOwnProperty("createdBy")) {
                d.createdBy = m.createdBy;
                if (o.oneofs)
                    d._createdBy = "createdBy";
            }
            if (m.description != null && m.hasOwnProperty("description")) {
                d.description = m.description;
                if (o.oneofs)
                    d._description = "description";
            }
            if (m.support != null && m.hasOwnProperty("support")) {
                d.support = m.support;
                if (o.oneofs)
                    d._support = "support";
            }
            if (m.isParentGroup != null && m.hasOwnProperty("isParentGroup")) {
                d.isParentGroup = m.isParentGroup;
                if (o.oneofs)
                    d._isParentGroup = "isParentGroup";
            }
            if (m.isDefaultSubgroup != null && m.hasOwnProperty("isDefaultSubgroup")) {
                d.isDefaultSubgroup = m.isDefaultSubgroup;
                if (o.oneofs)
                    d._isDefaultSubgroup = "isDefaultSubgroup";
            }
            if (m.parentGroupId != null && m.hasOwnProperty("parentGroupId")) {
                d.parentGroupId = m.parentGroupId;
                if (o.oneofs)
                    d._parentGroupId = "parentGroupId";
            }
            if (m.displayName != null && m.hasOwnProperty("displayName")) {
                d.displayName = m.displayName;
                if (o.oneofs)
                    d._displayName = "displayName";
            }
            if (m.pnJid != null && m.hasOwnProperty("pnJid")) {
                d.pnJid = m.pnJid;
                if (o.oneofs)
                    d._pnJid = "pnJid";
            }
            if (m.shareOwnPn != null && m.hasOwnProperty("shareOwnPn")) {
                d.shareOwnPn = m.shareOwnPn;
                if (o.oneofs)
                    d._shareOwnPn = "shareOwnPn";
            }
            if (m.pnhDuplicateLidThread != null && m.hasOwnProperty("pnhDuplicateLidThread")) {
                d.pnhDuplicateLidThread = m.pnhDuplicateLidThread;
                if (o.oneofs)
                    d._pnhDuplicateLidThread = "pnhDuplicateLidThread";
            }
            if (m.lidJid != null && m.hasOwnProperty("lidJid")) {
                d.lidJid = m.lidJid;
                if (o.oneofs)
                    d._lidJid = "lidJid";
            }
            if (m.username != null && m.hasOwnProperty("username")) {
                d.username = m.username;
                if (o.oneofs)
                    d._username = "username";
            }
            if (m.lidOriginType != null && m.hasOwnProperty("lidOriginType")) {
                d.lidOriginType = m.lidOriginType;
                if (o.oneofs)
                    d._lidOriginType = "lidOriginType";
            }
            if (m.commentsCount != null && m.hasOwnProperty("commentsCount")) {
                d.commentsCount = m.commentsCount;
                if (o.oneofs)
                    d._commentsCount = "commentsCount";
            }
            if (m.locked != null && m.hasOwnProperty("locked")) {
                d.locked = m.locked;
                if (o.oneofs)
                    d._locked = "locked";
            }
            if (m.systemMessageToInsert != null && m.hasOwnProperty("systemMessageToInsert")) {
                d.systemMessageToInsert = o.enums === String ? $root.proto.PrivacySystemMessage[m.systemMessageToInsert] === undefined ? m.systemMessageToInsert : $root.proto.PrivacySystemMessage[m.systemMessageToInsert] : m.systemMessageToInsert;
                if (o.oneofs)
                    d._systemMessageToInsert = "systemMessageToInsert";
            }
            if (m.capiCreatedGroup != null && m.hasOwnProperty("capiCreatedGroup")) {
                d.capiCreatedGroup = m.capiCreatedGroup;
                if (o.oneofs)
                    d._capiCreatedGroup = "capiCreatedGroup";
            }
            if (m.accountLid != null && m.hasOwnProperty("accountLid")) {
                d.accountLid = m.accountLid;
                if (o.oneofs)
                    d._accountLid = "accountLid";
            }
            if (m.limitSharing != null && m.hasOwnProperty("limitSharing")) {
                d.limitSharing = m.limitSharing;
                if (o.oneofs)
                    d._limitSharing = "limitSharing";
            }
            if (m.limitSharingSettingTimestamp != null && m.hasOwnProperty("limitSharingSettingTimestamp")) {
                if (typeof m.limitSharingSettingTimestamp === "number")
                    d.limitSharingSettingTimestamp = o.longs === String ? String(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp;
                else
                    d.limitSharingSettingTimestamp = o.longs === String ? longToString(m.limitSharingSettingTimestamp) : o.longs === Number ? longToNumber(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp;
                if (o.oneofs)
                    d._limitSharingSettingTimestamp = "limitSharingSettingTimestamp";
            }
            if (m.limitSharingTrigger != null && m.hasOwnProperty("limitSharingTrigger")) {
                d.limitSharingTrigger = o.enums === String ? $root.proto.LimitSharing.TriggerType[m.limitSharingTrigger] === undefined ? m.limitSharingTrigger : $root.proto.LimitSharing.TriggerType[m.limitSharingTrigger] : m.limitSharingTrigger;
                if (o.oneofs)
                    d._limitSharingTrigger = "limitSharingTrigger";
            }
            if (m.limitSharingInitiatedByMe != null && m.hasOwnProperty("limitSharingInitiatedByMe")) {
                d.limitSharingInitiatedByMe = m.limitSharingInitiatedByMe;
                if (o.oneofs)
                    d._limitSharingInitiatedByMe = "limitSharingInitiatedByMe";
            }
            if (m.maibaAiThreadEnabled != null && m.hasOwnProperty("maibaAiThreadEnabled")) {
                d.maibaAiThreadEnabled = m.maibaAiThreadEnabled;
                if (o.oneofs)
                    d._maibaAiThreadEnabled = "maibaAiThreadEnabled";
            }
            return d;
        };

        Conversation.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Conversation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Conversation";
        };

        Conversation.EndOfHistoryTransferType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY"] = 0;
            values[valuesById[1] = "COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY"] = 1;
            values[valuesById[2] = "COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY"] = 2;
            return values;
        })();

        return Conversation;
    })();

    proto.DeviceCapabilities = (function() {

        function DeviceCapabilities(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        DeviceCapabilities.prototype.chatLockSupportLevel = null;
        DeviceCapabilities.prototype.lidMigration = null;
        DeviceCapabilities.prototype.businessBroadcast = null;
        DeviceCapabilities.prototype.userHasAvatar = null;
        DeviceCapabilities.prototype.memberNameTagPrimarySupport = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceCapabilities.prototype, "_chatLockSupportLevel", {
            get: $util.oneOfGetter($oneOfFields = ["chatLockSupportLevel"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceCapabilities.prototype, "_lidMigration", {
            get: $util.oneOfGetter($oneOfFields = ["lidMigration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceCapabilities.prototype, "_businessBroadcast", {
            get: $util.oneOfGetter($oneOfFields = ["businessBroadcast"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceCapabilities.prototype, "_userHasAvatar", {
            get: $util.oneOfGetter($oneOfFields = ["userHasAvatar"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceCapabilities.prototype, "_memberNameTagPrimarySupport", {
            get: $util.oneOfGetter($oneOfFields = ["memberNameTagPrimarySupport"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        DeviceCapabilities.create = function create(properties) {
            return new DeviceCapabilities(properties);
        };

        DeviceCapabilities.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.chatLockSupportLevel != null && Object.hasOwnProperty.call(m, "chatLockSupportLevel"))
                w.uint32(8).int32(m.chatLockSupportLevel);
            if (m.lidMigration != null && Object.hasOwnProperty.call(m, "lidMigration"))
                $root.proto.DeviceCapabilities.LIDMigration.encode(m.lidMigration, w.uint32(18).fork()).ldelim();
            if (m.businessBroadcast != null && Object.hasOwnProperty.call(m, "businessBroadcast"))
                $root.proto.DeviceCapabilities.BusinessBroadcast.encode(m.businessBroadcast, w.uint32(26).fork()).ldelim();
            if (m.userHasAvatar != null && Object.hasOwnProperty.call(m, "userHasAvatar"))
                $root.proto.DeviceCapabilities.UserHasAvatar.encode(m.userHasAvatar, w.uint32(34).fork()).ldelim();
            if (m.memberNameTagPrimarySupport != null && Object.hasOwnProperty.call(m, "memberNameTagPrimarySupport"))
                w.uint32(40).int32(m.memberNameTagPrimarySupport);
            return w;
        };

        DeviceCapabilities.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.chatLockSupportLevel = r.int32();
                        break;
                    }
                case 2: {
                        m.lidMigration = $root.proto.DeviceCapabilities.LIDMigration.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.businessBroadcast = $root.proto.DeviceCapabilities.BusinessBroadcast.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.userHasAvatar = $root.proto.DeviceCapabilities.UserHasAvatar.decode(r, r.uint32());
                        break;
                    }
                case 5: {
                        m.memberNameTagPrimarySupport = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        DeviceCapabilities.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.DeviceCapabilities)
                return d;
            var m = new $root.proto.DeviceCapabilities();
            switch (d.chatLockSupportLevel) {
            default:
                if (typeof d.chatLockSupportLevel === "number") {
                    m.chatLockSupportLevel = d.chatLockSupportLevel;
                    break;
                }
                break;
            case "NONE":
            case 0:
                m.chatLockSupportLevel = 0;
                break;
            case "MINIMAL":
            case 1:
                m.chatLockSupportLevel = 1;
                break;
            case "FULL":
            case 2:
                m.chatLockSupportLevel = 2;
                break;
            }
            if (d.lidMigration != null) {
                if (typeof d.lidMigration !== "object")
                    throw TypeError(".proto.DeviceCapabilities.lidMigration: object expected");
                m.lidMigration = $root.proto.DeviceCapabilities.LIDMigration.fromObject(d.lidMigration);
            }
            if (d.businessBroadcast != null) {
                if (typeof d.businessBroadcast !== "object")
                    throw TypeError(".proto.DeviceCapabilities.businessBroadcast: object expected");
                m.businessBroadcast = $root.proto.DeviceCapabilities.BusinessBroadcast.fromObject(d.businessBroadcast);
            }
            if (d.userHasAvatar != null) {
                if (typeof d.userHasAvatar !== "object")
                    throw TypeError(".proto.DeviceCapabilities.userHasAvatar: object expected");
                m.userHasAvatar = $root.proto.DeviceCapabilities.UserHasAvatar.fromObject(d.userHasAvatar);
            }
            switch (d.memberNameTagPrimarySupport) {
            default:
                if (typeof d.memberNameTagPrimarySupport === "number") {
                    m.memberNameTagPrimarySupport = d.memberNameTagPrimarySupport;
                    break;
                }
                break;
            case "DISABLED":
            case 0:
                m.memberNameTagPrimarySupport = 0;
                break;
            case "RECEIVER_ENABLED":
            case 1:
                m.memberNameTagPrimarySupport = 1;
                break;
            case "SENDER_ENABLED":
            case 2:
                m.memberNameTagPrimarySupport = 2;
                break;
            }
            return m;
        };

        DeviceCapabilities.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.chatLockSupportLevel != null && m.hasOwnProperty("chatLockSupportLevel")) {
                d.chatLockSupportLevel = o.enums === String ? $root.proto.DeviceCapabilities.ChatLockSupportLevel[m.chatLockSupportLevel] === undefined ? m.chatLockSupportLevel : $root.proto.DeviceCapabilities.ChatLockSupportLevel[m.chatLockSupportLevel] : m.chatLockSupportLevel;
                if (o.oneofs)
                    d._chatLockSupportLevel = "chatLockSupportLevel";
            }
            if (m.lidMigration != null && m.hasOwnProperty("lidMigration")) {
                d.lidMigration = $root.proto.DeviceCapabilities.LIDMigration.toObject(m.lidMigration, o);
                if (o.oneofs)
                    d._lidMigration = "lidMigration";
            }
            if (m.businessBroadcast != null && m.hasOwnProperty("businessBroadcast")) {
                d.businessBroadcast = $root.proto.DeviceCapabilities.BusinessBroadcast.toObject(m.businessBroadcast, o);
                if (o.oneofs)
                    d._businessBroadcast = "businessBroadcast";
            }
            if (m.userHasAvatar != null && m.hasOwnProperty("userHasAvatar")) {
                d.userHasAvatar = $root.proto.DeviceCapabilities.UserHasAvatar.toObject(m.userHasAvatar, o);
                if (o.oneofs)
                    d._userHasAvatar = "userHasAvatar";
            }
            if (m.memberNameTagPrimarySupport != null && m.hasOwnProperty("memberNameTagPrimarySupport")) {
                d.memberNameTagPrimarySupport = o.enums === String ? $root.proto.DeviceCapabilities.MemberNameTagPrimarySupport[m.memberNameTagPrimarySupport] === undefined ? m.memberNameTagPrimarySupport : $root.proto.DeviceCapabilities.MemberNameTagPrimarySupport[m.memberNameTagPrimarySupport] : m.memberNameTagPrimarySupport;
                if (o.oneofs)
                    d._memberNameTagPrimarySupport = "memberNameTagPrimarySupport";
            }
            return d;
        };

        DeviceCapabilities.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        DeviceCapabilities.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.DeviceCapabilities";
        };

        DeviceCapabilities.BusinessBroadcast = (function() {

            function BusinessBroadcast(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BusinessBroadcast.prototype.importListEnabled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BusinessBroadcast.prototype, "_importListEnabled", {
                get: $util.oneOfGetter($oneOfFields = ["importListEnabled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BusinessBroadcast.create = function create(properties) {
                return new BusinessBroadcast(properties);
            };

            BusinessBroadcast.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.importListEnabled != null && Object.hasOwnProperty.call(m, "importListEnabled"))
                    w.uint32(8).bool(m.importListEnabled);
                return w;
            };

            BusinessBroadcast.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities.BusinessBroadcast();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.importListEnabled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BusinessBroadcast.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.DeviceCapabilities.BusinessBroadcast)
                    return d;
                var m = new $root.proto.DeviceCapabilities.BusinessBroadcast();
                if (d.importListEnabled != null) {
                    m.importListEnabled = Boolean(d.importListEnabled);
                }
                return m;
            };

            BusinessBroadcast.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.importListEnabled != null && m.hasOwnProperty("importListEnabled")) {
                    d.importListEnabled = m.importListEnabled;
                    if (o.oneofs)
                        d._importListEnabled = "importListEnabled";
                }
                return d;
            };

            BusinessBroadcast.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BusinessBroadcast.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.DeviceCapabilities.BusinessBroadcast";
            };

            return BusinessBroadcast;
        })();

        DeviceCapabilities.ChatLockSupportLevel = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "NONE"] = 0;
            values[valuesById[1] = "MINIMAL"] = 1;
            values[valuesById[2] = "FULL"] = 2;
            return values;
        })();

        DeviceCapabilities.LIDMigration = (function() {

            function LIDMigration(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LIDMigration.prototype.chatDbMigrationTimestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LIDMigration.prototype, "_chatDbMigrationTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["chatDbMigrationTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LIDMigration.create = function create(properties) {
                return new LIDMigration(properties);
            };

            LIDMigration.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.chatDbMigrationTimestamp != null && Object.hasOwnProperty.call(m, "chatDbMigrationTimestamp"))
                    w.uint32(8).uint64(m.chatDbMigrationTimestamp);
                return w;
            };

            LIDMigration.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities.LIDMigration();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.chatDbMigrationTimestamp = r.uint64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LIDMigration.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.DeviceCapabilities.LIDMigration)
                    return d;
                var m = new $root.proto.DeviceCapabilities.LIDMigration();
                if (d.chatDbMigrationTimestamp != null) {
                    if ($util.Long)
                        (m.chatDbMigrationTimestamp = $util.Long.fromValue(d.chatDbMigrationTimestamp)).unsigned = true;
                    else if (typeof d.chatDbMigrationTimestamp === "string")
                        m.chatDbMigrationTimestamp = parseInt(d.chatDbMigrationTimestamp, 10);
                    else if (typeof d.chatDbMigrationTimestamp === "number")
                        m.chatDbMigrationTimestamp = d.chatDbMigrationTimestamp;
                    else if (typeof d.chatDbMigrationTimestamp === "object")
                        m.chatDbMigrationTimestamp = new $util.LongBits(d.chatDbMigrationTimestamp.low >>> 0, d.chatDbMigrationTimestamp.high >>> 0).toNumber(true);
                }
                return m;
            };

            LIDMigration.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.chatDbMigrationTimestamp != null && m.hasOwnProperty("chatDbMigrationTimestamp")) {
                    if (typeof m.chatDbMigrationTimestamp === "number")
                        d.chatDbMigrationTimestamp = o.longs === String ? String(m.chatDbMigrationTimestamp) : m.chatDbMigrationTimestamp;
                    else
                        d.chatDbMigrationTimestamp = o.longs === String ? longToString(m.chatDbMigrationTimestamp, true) : o.longs === Number ? longToNumber(m.chatDbMigrationTimestamp, true) : m.chatDbMigrationTimestamp;
                    if (o.oneofs)
                        d._chatDbMigrationTimestamp = "chatDbMigrationTimestamp";
                }
                return d;
            };

            LIDMigration.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LIDMigration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.DeviceCapabilities.LIDMigration";
            };

            return LIDMigration;
        })();

        DeviceCapabilities.MemberNameTagPrimarySupport = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "DISABLED"] = 0;
            values[valuesById[1] = "RECEIVER_ENABLED"] = 1;
            values[valuesById[2] = "SENDER_ENABLED"] = 2;
            return values;
        })();

        DeviceCapabilities.UserHasAvatar = (function() {

            function UserHasAvatar(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            UserHasAvatar.prototype.userHasAvatar = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserHasAvatar.prototype, "_userHasAvatar", {
                get: $util.oneOfGetter($oneOfFields = ["userHasAvatar"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            UserHasAvatar.create = function create(properties) {
                return new UserHasAvatar(properties);
            };

            UserHasAvatar.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.userHasAvatar != null && Object.hasOwnProperty.call(m, "userHasAvatar"))
                    w.uint32(8).bool(m.userHasAvatar);
                return w;
            };

            UserHasAvatar.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities.UserHasAvatar();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.userHasAvatar = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            UserHasAvatar.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.DeviceCapabilities.UserHasAvatar)
                    return d;
                var m = new $root.proto.DeviceCapabilities.UserHasAvatar();
                if (d.userHasAvatar != null) {
                    m.userHasAvatar = Boolean(d.userHasAvatar);
                }
                return m;
            };

            UserHasAvatar.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.userHasAvatar != null && m.hasOwnProperty("userHasAvatar")) {
                    d.userHasAvatar = m.userHasAvatar;
                    if (o.oneofs)
                        d._userHasAvatar = "userHasAvatar";
                }
                return d;
            };

            UserHasAvatar.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            UserHasAvatar.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.DeviceCapabilities.UserHasAvatar";
            };

            return UserHasAvatar;
        })();

        return DeviceCapabilities;
    })();

    proto.DeviceConsistencyCodeMessage = (function() {

        function DeviceConsistencyCodeMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        DeviceConsistencyCodeMessage.prototype.generation = null;
        DeviceConsistencyCodeMessage.prototype.signature = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceConsistencyCodeMessage.prototype, "_generation", {
            get: $util.oneOfGetter($oneOfFields = ["generation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceConsistencyCodeMessage.prototype, "_signature", {
            get: $util.oneOfGetter($oneOfFields = ["signature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        DeviceConsistencyCodeMessage.create = function create(properties) {
            return new DeviceConsistencyCodeMessage(properties);
        };

        DeviceConsistencyCodeMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.generation != null && Object.hasOwnProperty.call(m, "generation"))
                w.uint32(8).uint32(m.generation);
            if (m.signature != null && Object.hasOwnProperty.call(m, "signature"))
                w.uint32(18).bytes(m.signature);
            return w;
        };

        DeviceConsistencyCodeMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceConsistencyCodeMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.generation = r.uint32();
                        break;
                    }
                case 2: {
                        m.signature = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        DeviceConsistencyCodeMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.DeviceConsistencyCodeMessage)
                return d;
            var m = new $root.proto.DeviceConsistencyCodeMessage();
            if (d.generation != null) {
                m.generation = d.generation >>> 0;
            }
            if (d.signature != null) {
                if (typeof d.signature === "string")
                    $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0);
                else if (d.signature.length >= 0)
                    m.signature = d.signature;
            }
            return m;
        };

        DeviceConsistencyCodeMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.generation != null && m.hasOwnProperty("generation")) {
                d.generation = m.generation;
                if (o.oneofs)
                    d._generation = "generation";
            }
            if (m.signature != null && m.hasOwnProperty("signature")) {
                d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature;
                if (o.oneofs)
                    d._signature = "signature";
            }
            return d;
        };

        DeviceConsistencyCodeMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        DeviceConsistencyCodeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.DeviceConsistencyCodeMessage";
        };

        return DeviceConsistencyCodeMessage;
    })();

    proto.DeviceListMetadata = (function() {

        function DeviceListMetadata(p) {
            this.senderKeyIndexes = [];
            this.recipientKeyIndexes = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        DeviceListMetadata.prototype.senderKeyHash = null;
        DeviceListMetadata.prototype.senderTimestamp = null;
        DeviceListMetadata.prototype.senderKeyIndexes = $util.emptyArray;
        DeviceListMetadata.prototype.senderAccountType = null;
        DeviceListMetadata.prototype.receiverAccountType = null;
        DeviceListMetadata.prototype.recipientKeyHash = null;
        DeviceListMetadata.prototype.recipientTimestamp = null;
        DeviceListMetadata.prototype.recipientKeyIndexes = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceListMetadata.prototype, "_senderKeyHash", {
            get: $util.oneOfGetter($oneOfFields = ["senderKeyHash"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceListMetadata.prototype, "_senderTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["senderTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceListMetadata.prototype, "_senderAccountType", {
            get: $util.oneOfGetter($oneOfFields = ["senderAccountType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceListMetadata.prototype, "_receiverAccountType", {
            get: $util.oneOfGetter($oneOfFields = ["receiverAccountType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceListMetadata.prototype, "_recipientKeyHash", {
            get: $util.oneOfGetter($oneOfFields = ["recipientKeyHash"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceListMetadata.prototype, "_recipientTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["recipientTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        DeviceListMetadata.create = function create(properties) {
            return new DeviceListMetadata(properties);
        };

        DeviceListMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.senderKeyHash != null && Object.hasOwnProperty.call(m, "senderKeyHash"))
                w.uint32(10).bytes(m.senderKeyHash);
            if (m.senderTimestamp != null && Object.hasOwnProperty.call(m, "senderTimestamp"))
                w.uint32(16).uint64(m.senderTimestamp);
            if (m.senderKeyIndexes != null && m.senderKeyIndexes.length) {
                w.uint32(26).fork();
                for (var i = 0; i < m.senderKeyIndexes.length; ++i)
                    w.uint32(m.senderKeyIndexes[i]);
                w.ldelim();
            }
            if (m.senderAccountType != null && Object.hasOwnProperty.call(m, "senderAccountType"))
                w.uint32(32).int32(m.senderAccountType);
            if (m.receiverAccountType != null && Object.hasOwnProperty.call(m, "receiverAccountType"))
                w.uint32(40).int32(m.receiverAccountType);
            if (m.recipientKeyHash != null && Object.hasOwnProperty.call(m, "recipientKeyHash"))
                w.uint32(66).bytes(m.recipientKeyHash);
            if (m.recipientTimestamp != null && Object.hasOwnProperty.call(m, "recipientTimestamp"))
                w.uint32(72).uint64(m.recipientTimestamp);
            if (m.recipientKeyIndexes != null && m.recipientKeyIndexes.length) {
                w.uint32(82).fork();
                for (var i = 0; i < m.recipientKeyIndexes.length; ++i)
                    w.uint32(m.recipientKeyIndexes[i]);
                w.ldelim();
            }
            return w;
        };

        DeviceListMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceListMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.senderKeyHash = r.bytes();
                        break;
                    }
                case 2: {
                        m.senderTimestamp = r.uint64();
                        break;
                    }
                case 3: {
                        if (!(m.senderKeyIndexes && m.senderKeyIndexes.length))
                            m.senderKeyIndexes = [];
                        if ((t & 7) === 2) {
                            var c2 = r.uint32() + r.pos;
                            while (r.pos < c2)
                                m.senderKeyIndexes.push(r.uint32());
                        } else
                            m.senderKeyIndexes.push(r.uint32());
                        break;
                    }
                case 4: {
                        m.senderAccountType = r.int32();
                        break;
                    }
                case 5: {
                        m.receiverAccountType = r.int32();
                        break;
                    }
                case 8: {
                        m.recipientKeyHash = r.bytes();
                        break;
                    }
                case 9: {
                        m.recipientTimestamp = r.uint64();
                        break;
                    }
                case 10: {
                        if (!(m.recipientKeyIndexes && m.recipientKeyIndexes.length))
                            m.recipientKeyIndexes = [];
                        if ((t & 7) === 2) {
                            var c2 = r.uint32() + r.pos;
                            while (r.pos < c2)
                                m.recipientKeyIndexes.push(r.uint32());
                        } else
                            m.recipientKeyIndexes.push(r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        DeviceListMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.DeviceListMetadata)
                return d;
            var m = new $root.proto.DeviceListMetadata();
            if (d.senderKeyHash != null) {
                if (typeof d.senderKeyHash === "string")
                    $util.base64.decode(d.senderKeyHash, m.senderKeyHash = $util.newBuffer($util.base64.length(d.senderKeyHash)), 0);
                else if (d.senderKeyHash.length >= 0)
                    m.senderKeyHash = d.senderKeyHash;
            }
            if (d.senderTimestamp != null) {
                if ($util.Long)
                    (m.senderTimestamp = $util.Long.fromValue(d.senderTimestamp)).unsigned = true;
                else if (typeof d.senderTimestamp === "string")
                    m.senderTimestamp = parseInt(d.senderTimestamp, 10);
                else if (typeof d.senderTimestamp === "number")
                    m.senderTimestamp = d.senderTimestamp;
                else if (typeof d.senderTimestamp === "object")
                    m.senderTimestamp = new $util.LongBits(d.senderTimestamp.low >>> 0, d.senderTimestamp.high >>> 0).toNumber(true);
            }
            if (d.senderKeyIndexes) {
                if (!Array.isArray(d.senderKeyIndexes))
                    throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected");
                m.senderKeyIndexes = [];
                for (var i = 0; i < d.senderKeyIndexes.length; ++i) {
                    m.senderKeyIndexes[i] = d.senderKeyIndexes[i] >>> 0;
                }
            }
            switch (d.senderAccountType) {
            default:
                if (typeof d.senderAccountType === "number") {
                    m.senderAccountType = d.senderAccountType;
                    break;
                }
                break;
            case "E2EE":
            case 0:
                m.senderAccountType = 0;
                break;
            case "HOSTED":
            case 1:
                m.senderAccountType = 1;
                break;
            }
            switch (d.receiverAccountType) {
            default:
                if (typeof d.receiverAccountType === "number") {
                    m.receiverAccountType = d.receiverAccountType;
                    break;
                }
                break;
            case "E2EE":
            case 0:
                m.receiverAccountType = 0;
                break;
            case "HOSTED":
            case 1:
                m.receiverAccountType = 1;
                break;
            }
            if (d.recipientKeyHash != null) {
                if (typeof d.recipientKeyHash === "string")
                    $util.base64.decode(d.recipientKeyHash, m.recipientKeyHash = $util.newBuffer($util.base64.length(d.recipientKeyHash)), 0);
                else if (d.recipientKeyHash.length >= 0)
                    m.recipientKeyHash = d.recipientKeyHash;
            }
            if (d.recipientTimestamp != null) {
                if ($util.Long)
                    (m.recipientTimestamp = $util.Long.fromValue(d.recipientTimestamp)).unsigned = true;
                else if (typeof d.recipientTimestamp === "string")
                    m.recipientTimestamp = parseInt(d.recipientTimestamp, 10);
                else if (typeof d.recipientTimestamp === "number")
                    m.recipientTimestamp = d.recipientTimestamp;
                else if (typeof d.recipientTimestamp === "object")
                    m.recipientTimestamp = new $util.LongBits(d.recipientTimestamp.low >>> 0, d.recipientTimestamp.high >>> 0).toNumber(true);
            }
            if (d.recipientKeyIndexes) {
                if (!Array.isArray(d.recipientKeyIndexes))
                    throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected");
                m.recipientKeyIndexes = [];
                for (var i = 0; i < d.recipientKeyIndexes.length; ++i) {
                    m.recipientKeyIndexes[i] = d.recipientKeyIndexes[i] >>> 0;
                }
            }
            return m;
        };

        DeviceListMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.senderKeyIndexes = [];
                d.recipientKeyIndexes = [];
            }
            if (m.senderKeyHash != null && m.hasOwnProperty("senderKeyHash")) {
                d.senderKeyHash = o.bytes === String ? $util.base64.encode(m.senderKeyHash, 0, m.senderKeyHash.length) : o.bytes === Array ? Array.prototype.slice.call(m.senderKeyHash) : m.senderKeyHash;
                if (o.oneofs)
                    d._senderKeyHash = "senderKeyHash";
            }
            if (m.senderTimestamp != null && m.hasOwnProperty("senderTimestamp")) {
                if (typeof m.senderTimestamp === "number")
                    d.senderTimestamp = o.longs === String ? String(m.senderTimestamp) : m.senderTimestamp;
                else
                    d.senderTimestamp = o.longs === String ? longToString(m.senderTimestamp, true) : o.longs === Number ? longToNumber(m.senderTimestamp, true) : m.senderTimestamp;
                if (o.oneofs)
                    d._senderTimestamp = "senderTimestamp";
            }
            if (m.senderKeyIndexes && m.senderKeyIndexes.length) {
                d.senderKeyIndexes = [];
                for (var j = 0; j < m.senderKeyIndexes.length; ++j) {
                    d.senderKeyIndexes[j] = m.senderKeyIndexes[j];
                }
            }
            if (m.senderAccountType != null && m.hasOwnProperty("senderAccountType")) {
                d.senderAccountType = o.enums === String ? $root.proto.ADVEncryptionType[m.senderAccountType] === undefined ? m.senderAccountType : $root.proto.ADVEncryptionType[m.senderAccountType] : m.senderAccountType;
                if (o.oneofs)
                    d._senderAccountType = "senderAccountType";
            }
            if (m.receiverAccountType != null && m.hasOwnProperty("receiverAccountType")) {
                d.receiverAccountType = o.enums === String ? $root.proto.ADVEncryptionType[m.receiverAccountType] === undefined ? m.receiverAccountType : $root.proto.ADVEncryptionType[m.receiverAccountType] : m.receiverAccountType;
                if (o.oneofs)
                    d._receiverAccountType = "receiverAccountType";
            }
            if (m.recipientKeyHash != null && m.hasOwnProperty("recipientKeyHash")) {
                d.recipientKeyHash = o.bytes === String ? $util.base64.encode(m.recipientKeyHash, 0, m.recipientKeyHash.length) : o.bytes === Array ? Array.prototype.slice.call(m.recipientKeyHash) : m.recipientKeyHash;
                if (o.oneofs)
                    d._recipientKeyHash = "recipientKeyHash";
            }
            if (m.recipientTimestamp != null && m.hasOwnProperty("recipientTimestamp")) {
                if (typeof m.recipientTimestamp === "number")
                    d.recipientTimestamp = o.longs === String ? String(m.recipientTimestamp) : m.recipientTimestamp;
                else
                    d.recipientTimestamp = o.longs === String ? longToString(m.recipientTimestamp, true) : o.longs === Number ? longToNumber(m.recipientTimestamp, true) : m.recipientTimestamp;
                if (o.oneofs)
                    d._recipientTimestamp = "recipientTimestamp";
            }
            if (m.recipientKeyIndexes && m.recipientKeyIndexes.length) {
                d.recipientKeyIndexes = [];
                for (var j = 0; j < m.recipientKeyIndexes.length; ++j) {
                    d.recipientKeyIndexes[j] = m.recipientKeyIndexes[j];
                }
            }
            return d;
        };

        DeviceListMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        DeviceListMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.DeviceListMetadata";
        };

        return DeviceListMetadata;
    })();

    proto.DeviceProps = (function() {

        function DeviceProps(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        DeviceProps.prototype.os = null;
        DeviceProps.prototype.version = null;
        DeviceProps.prototype.platformType = null;
        DeviceProps.prototype.requireFullSync = null;
        DeviceProps.prototype.historySyncConfig = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceProps.prototype, "_os", {
            get: $util.oneOfGetter($oneOfFields = ["os"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceProps.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceProps.prototype, "_platformType", {
            get: $util.oneOfGetter($oneOfFields = ["platformType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceProps.prototype, "_requireFullSync", {
            get: $util.oneOfGetter($oneOfFields = ["requireFullSync"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DeviceProps.prototype, "_historySyncConfig", {
            get: $util.oneOfGetter($oneOfFields = ["historySyncConfig"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        DeviceProps.create = function create(properties) {
            return new DeviceProps(properties);
        };

        DeviceProps.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.os != null && Object.hasOwnProperty.call(m, "os"))
                w.uint32(10).string(m.os);
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                $root.proto.DeviceProps.AppVersion.encode(m.version, w.uint32(18).fork()).ldelim();
            if (m.platformType != null && Object.hasOwnProperty.call(m, "platformType"))
                w.uint32(24).int32(m.platformType);
            if (m.requireFullSync != null && Object.hasOwnProperty.call(m, "requireFullSync"))
                w.uint32(32).bool(m.requireFullSync);
            if (m.historySyncConfig != null && Object.hasOwnProperty.call(m, "historySyncConfig"))
                $root.proto.DeviceProps.HistorySyncConfig.encode(m.historySyncConfig, w.uint32(42).fork()).ldelim();
            return w;
        };

        DeviceProps.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceProps();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.os = r.string();
                        break;
                    }
                case 2: {
                        m.version = $root.proto.DeviceProps.AppVersion.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.platformType = r.int32();
                        break;
                    }
                case 4: {
                        m.requireFullSync = r.bool();
                        break;
                    }
                case 5: {
                        m.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        DeviceProps.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.DeviceProps)
                return d;
            var m = new $root.proto.DeviceProps();
            if (d.os != null) {
                m.os = String(d.os);
            }
            if (d.version != null) {
                if (typeof d.version !== "object")
                    throw TypeError(".proto.DeviceProps.version: object expected");
                m.version = $root.proto.DeviceProps.AppVersion.fromObject(d.version);
            }
            switch (d.platformType) {
            default:
                if (typeof d.platformType === "number") {
                    m.platformType = d.platformType;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.platformType = 0;
                break;
            case "CHROME":
            case 1:
                m.platformType = 1;
                break;
            case "FIREFOX":
            case 2:
                m.platformType = 2;
                break;
            case "IE":
            case 3:
                m.platformType = 3;
                break;
            case "OPERA":
            case 4:
                m.platformType = 4;
                break;
            case "SAFARI":
            case 5:
                m.platformType = 5;
                break;
            case "EDGE":
            case 6:
                m.platformType = 6;
                break;
            case "DESKTOP":
            case 7:
                m.platformType = 7;
                break;
            case "IPAD":
            case 8:
                m.platformType = 8;
                break;
            case "ANDROID_TABLET":
            case 9:
                m.platformType = 9;
                break;
            case "OHANA":
            case 10:
                m.platformType = 10;
                break;
            case "ALOHA":
            case 11:
                m.platformType = 11;
                break;
            case "CATALINA":
            case 12:
                m.platformType = 12;
                break;
            case "TCL_TV":
            case 13:
                m.platformType = 13;
                break;
            case "IOS_PHONE":
            case 14:
                m.platformType = 14;
                break;
            case "IOS_CATALYST":
            case 15:
                m.platformType = 15;
                break;
            case "ANDROID_PHONE":
            case 16:
                m.platformType = 16;
                break;
            case "ANDROID_AMBIGUOUS":
            case 17:
                m.platformType = 17;
                break;
            case "WEAR_OS":
            case 18:
                m.platformType = 18;
                break;
            case "AR_WRIST":
            case 19:
                m.platformType = 19;
                break;
            case "AR_DEVICE":
            case 20:
                m.platformType = 20;
                break;
            case "UWP":
            case 21:
                m.platformType = 21;
                break;
            case "VR":
            case 22:
                m.platformType = 22;
                break;
            case "CLOUD_API":
            case 23:
                m.platformType = 23;
                break;
            case "SMARTGLASSES":
            case 24:
                m.platformType = 24;
                break;
            }
            if (d.requireFullSync != null) {
                m.requireFullSync = Boolean(d.requireFullSync);
            }
            if (d.historySyncConfig != null) {
                if (typeof d.historySyncConfig !== "object")
                    throw TypeError(".proto.DeviceProps.historySyncConfig: object expected");
                m.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.fromObject(d.historySyncConfig);
            }
            return m;
        };

        DeviceProps.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.os != null && m.hasOwnProperty("os")) {
                d.os = m.os;
                if (o.oneofs)
                    d._os = "os";
            }
            if (m.version != null && m.hasOwnProperty("version")) {
                d.version = $root.proto.DeviceProps.AppVersion.toObject(m.version, o);
                if (o.oneofs)
                    d._version = "version";
            }
            if (m.platformType != null && m.hasOwnProperty("platformType")) {
                d.platformType = o.enums === String ? $root.proto.DeviceProps.PlatformType[m.platformType] === undefined ? m.platformType : $root.proto.DeviceProps.PlatformType[m.platformType] : m.platformType;
                if (o.oneofs)
                    d._platformType = "platformType";
            }
            if (m.requireFullSync != null && m.hasOwnProperty("requireFullSync")) {
                d.requireFullSync = m.requireFullSync;
                if (o.oneofs)
                    d._requireFullSync = "requireFullSync";
            }
            if (m.historySyncConfig != null && m.hasOwnProperty("historySyncConfig")) {
                d.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.toObject(m.historySyncConfig, o);
                if (o.oneofs)
                    d._historySyncConfig = "historySyncConfig";
            }
            return d;
        };

        DeviceProps.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        DeviceProps.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.DeviceProps";
        };

        DeviceProps.AppVersion = (function() {

            function AppVersion(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AppVersion.prototype.primary = null;
            AppVersion.prototype.secondary = null;
            AppVersion.prototype.tertiary = null;
            AppVersion.prototype.quaternary = null;
            AppVersion.prototype.quinary = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppVersion.prototype, "_primary", {
                get: $util.oneOfGetter($oneOfFields = ["primary"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppVersion.prototype, "_secondary", {
                get: $util.oneOfGetter($oneOfFields = ["secondary"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppVersion.prototype, "_tertiary", {
                get: $util.oneOfGetter($oneOfFields = ["tertiary"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppVersion.prototype, "_quaternary", {
                get: $util.oneOfGetter($oneOfFields = ["quaternary"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppVersion.prototype, "_quinary", {
                get: $util.oneOfGetter($oneOfFields = ["quinary"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AppVersion.create = function create(properties) {
                return new AppVersion(properties);
            };

            AppVersion.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.primary != null && Object.hasOwnProperty.call(m, "primary"))
                    w.uint32(8).uint32(m.primary);
                if (m.secondary != null && Object.hasOwnProperty.call(m, "secondary"))
                    w.uint32(16).uint32(m.secondary);
                if (m.tertiary != null && Object.hasOwnProperty.call(m, "tertiary"))
                    w.uint32(24).uint32(m.tertiary);
                if (m.quaternary != null && Object.hasOwnProperty.call(m, "quaternary"))
                    w.uint32(32).uint32(m.quaternary);
                if (m.quinary != null && Object.hasOwnProperty.call(m, "quinary"))
                    w.uint32(40).uint32(m.quinary);
                return w;
            };

            AppVersion.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceProps.AppVersion();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.primary = r.uint32();
                            break;
                        }
                    case 2: {
                            m.secondary = r.uint32();
                            break;
                        }
                    case 3: {
                            m.tertiary = r.uint32();
                            break;
                        }
                    case 4: {
                            m.quaternary = r.uint32();
                            break;
                        }
                    case 5: {
                            m.quinary = r.uint32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AppVersion.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.DeviceProps.AppVersion)
                    return d;
                var m = new $root.proto.DeviceProps.AppVersion();
                if (d.primary != null) {
                    m.primary = d.primary >>> 0;
                }
                if (d.secondary != null) {
                    m.secondary = d.secondary >>> 0;
                }
                if (d.tertiary != null) {
                    m.tertiary = d.tertiary >>> 0;
                }
                if (d.quaternary != null) {
                    m.quaternary = d.quaternary >>> 0;
                }
                if (d.quinary != null) {
                    m.quinary = d.quinary >>> 0;
                }
                return m;
            };

            AppVersion.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.primary != null && m.hasOwnProperty("primary")) {
                    d.primary = m.primary;
                    if (o.oneofs)
                        d._primary = "primary";
                }
                if (m.secondary != null && m.hasOwnProperty("secondary")) {
                    d.secondary = m.secondary;
                    if (o.oneofs)
                        d._secondary = "secondary";
                }
                if (m.tertiary != null && m.hasOwnProperty("tertiary")) {
                    d.tertiary = m.tertiary;
                    if (o.oneofs)
                        d._tertiary = "tertiary";
                }
                if (m.quaternary != null && m.hasOwnProperty("quaternary")) {
                    d.quaternary = m.quaternary;
                    if (o.oneofs)
                        d._quaternary = "quaternary";
                }
                if (m.quinary != null && m.hasOwnProperty("quinary")) {
                    d.quinary = m.quinary;
                    if (o.oneofs)
                        d._quinary = "quinary";
                }
                return d;
            };

            AppVersion.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.DeviceProps.AppVersion";
            };

            return AppVersion;
        })();

        DeviceProps.HistorySyncConfig = (function() {

            function HistorySyncConfig(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            HistorySyncConfig.prototype.fullSyncDaysLimit = null;
            HistorySyncConfig.prototype.fullSyncSizeMbLimit = null;
            HistorySyncConfig.prototype.storageQuotaMb = null;
            HistorySyncConfig.prototype.inlineInitialPayloadInE2EeMsg = null;
            HistorySyncConfig.prototype.recentSyncDaysLimit = null;
            HistorySyncConfig.prototype.supportCallLogHistory = null;
            HistorySyncConfig.prototype.supportBotUserAgentChatHistory = null;
            HistorySyncConfig.prototype.supportCagReactionsAndPolls = null;
            HistorySyncConfig.prototype.supportBizHostedMsg = null;
            HistorySyncConfig.prototype.supportRecentSyncChunkMessageCountTuning = null;
            HistorySyncConfig.prototype.supportHostedGroupMsg = null;
            HistorySyncConfig.prototype.supportFbidBotChatHistory = null;
            HistorySyncConfig.prototype.supportAddOnHistorySyncMigration = null;
            HistorySyncConfig.prototype.supportMessageAssociation = null;
            HistorySyncConfig.prototype.supportGroupHistory = null;
            HistorySyncConfig.prototype.onDemandReady = null;
            HistorySyncConfig.prototype.supportGuestChat = null;
            HistorySyncConfig.prototype.completeOnDemandReady = null;
            HistorySyncConfig.prototype.thumbnailSyncDaysLimit = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_fullSyncDaysLimit", {
                get: $util.oneOfGetter($oneOfFields = ["fullSyncDaysLimit"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_fullSyncSizeMbLimit", {
                get: $util.oneOfGetter($oneOfFields = ["fullSyncSizeMbLimit"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_storageQuotaMb", {
                get: $util.oneOfGetter($oneOfFields = ["storageQuotaMb"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_inlineInitialPayloadInE2EeMsg", {
                get: $util.oneOfGetter($oneOfFields = ["inlineInitialPayloadInE2EeMsg"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_recentSyncDaysLimit", {
                get: $util.oneOfGetter($oneOfFields = ["recentSyncDaysLimit"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportCallLogHistory", {
                get: $util.oneOfGetter($oneOfFields = ["supportCallLogHistory"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportBotUserAgentChatHistory", {
                get: $util.oneOfGetter($oneOfFields = ["supportBotUserAgentChatHistory"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportCagReactionsAndPolls", {
                get: $util.oneOfGetter($oneOfFields = ["supportCagReactionsAndPolls"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportBizHostedMsg", {
                get: $util.oneOfGetter($oneOfFields = ["supportBizHostedMsg"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportRecentSyncChunkMessageCountTuning", {
                get: $util.oneOfGetter($oneOfFields = ["supportRecentSyncChunkMessageCountTuning"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportHostedGroupMsg", {
                get: $util.oneOfGetter($oneOfFields = ["supportHostedGroupMsg"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportFbidBotChatHistory", {
                get: $util.oneOfGetter($oneOfFields = ["supportFbidBotChatHistory"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportAddOnHistorySyncMigration", {
                get: $util.oneOfGetter($oneOfFields = ["supportAddOnHistorySyncMigration"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportMessageAssociation", {
                get: $util.oneOfGetter($oneOfFields = ["supportMessageAssociation"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportGroupHistory", {
                get: $util.oneOfGetter($oneOfFields = ["supportGroupHistory"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_onDemandReady", {
                get: $util.oneOfGetter($oneOfFields = ["onDemandReady"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_supportGuestChat", {
                get: $util.oneOfGetter($oneOfFields = ["supportGuestChat"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_completeOnDemandReady", {
                get: $util.oneOfGetter($oneOfFields = ["completeOnDemandReady"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncConfig.prototype, "_thumbnailSyncDaysLimit", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailSyncDaysLimit"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            HistorySyncConfig.create = function create(properties) {
                return new HistorySyncConfig(properties);
            };

            HistorySyncConfig.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.fullSyncDaysLimit != null && Object.hasOwnProperty.call(m, "fullSyncDaysLimit"))
                    w.uint32(8).uint32(m.fullSyncDaysLimit);
                if (m.fullSyncSizeMbLimit != null && Object.hasOwnProperty.call(m, "fullSyncSizeMbLimit"))
                    w.uint32(16).uint32(m.fullSyncSizeMbLimit);
                if (m.storageQuotaMb != null && Object.hasOwnProperty.call(m, "storageQuotaMb"))
                    w.uint32(24).uint32(m.storageQuotaMb);
                if (m.inlineInitialPayloadInE2EeMsg != null && Object.hasOwnProperty.call(m, "inlineInitialPayloadInE2EeMsg"))
                    w.uint32(32).bool(m.inlineInitialPayloadInE2EeMsg);
                if (m.recentSyncDaysLimit != null && Object.hasOwnProperty.call(m, "recentSyncDaysLimit"))
                    w.uint32(40).uint32(m.recentSyncDaysLimit);
                if (m.supportCallLogHistory != null && Object.hasOwnProperty.call(m, "supportCallLogHistory"))
                    w.uint32(48).bool(m.supportCallLogHistory);
                if (m.supportBotUserAgentChatHistory != null && Object.hasOwnProperty.call(m, "supportBotUserAgentChatHistory"))
                    w.uint32(56).bool(m.supportBotUserAgentChatHistory);
                if (m.supportCagReactionsAndPolls != null && Object.hasOwnProperty.call(m, "supportCagReactionsAndPolls"))
                    w.uint32(64).bool(m.supportCagReactionsAndPolls);
                if (m.supportBizHostedMsg != null && Object.hasOwnProperty.call(m, "supportBizHostedMsg"))
                    w.uint32(72).bool(m.supportBizHostedMsg);
                if (m.supportRecentSyncChunkMessageCountTuning != null && Object.hasOwnProperty.call(m, "supportRecentSyncChunkMessageCountTuning"))
                    w.uint32(80).bool(m.supportRecentSyncChunkMessageCountTuning);
                if (m.supportHostedGroupMsg != null && Object.hasOwnProperty.call(m, "supportHostedGroupMsg"))
                    w.uint32(88).bool(m.supportHostedGroupMsg);
                if (m.supportFbidBotChatHistory != null && Object.hasOwnProperty.call(m, "supportFbidBotChatHistory"))
                    w.uint32(96).bool(m.supportFbidBotChatHistory);
                if (m.supportAddOnHistorySyncMigration != null && Object.hasOwnProperty.call(m, "supportAddOnHistorySyncMigration"))
                    w.uint32(104).bool(m.supportAddOnHistorySyncMigration);
                if (m.supportMessageAssociation != null && Object.hasOwnProperty.call(m, "supportMessageAssociation"))
                    w.uint32(112).bool(m.supportMessageAssociation);
                if (m.supportGroupHistory != null && Object.hasOwnProperty.call(m, "supportGroupHistory"))
                    w.uint32(120).bool(m.supportGroupHistory);
                if (m.onDemandReady != null && Object.hasOwnProperty.call(m, "onDemandReady"))
                    w.uint32(128).bool(m.onDemandReady);
                if (m.supportGuestChat != null && Object.hasOwnProperty.call(m, "supportGuestChat"))
                    w.uint32(136).bool(m.supportGuestChat);
                if (m.completeOnDemandReady != null && Object.hasOwnProperty.call(m, "completeOnDemandReady"))
                    w.uint32(144).bool(m.completeOnDemandReady);
                if (m.thumbnailSyncDaysLimit != null && Object.hasOwnProperty.call(m, "thumbnailSyncDaysLimit"))
                    w.uint32(152).uint32(m.thumbnailSyncDaysLimit);
                return w;
            };

            HistorySyncConfig.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceProps.HistorySyncConfig();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.fullSyncDaysLimit = r.uint32();
                            break;
                        }
                    case 2: {
                            m.fullSyncSizeMbLimit = r.uint32();
                            break;
                        }
                    case 3: {
                            m.storageQuotaMb = r.uint32();
                            break;
                        }
                    case 4: {
                            m.inlineInitialPayloadInE2EeMsg = r.bool();
                            break;
                        }
                    case 5: {
                            m.recentSyncDaysLimit = r.uint32();
                            break;
                        }
                    case 6: {
                            m.supportCallLogHistory = r.bool();
                            break;
                        }
                    case 7: {
                            m.supportBotUserAgentChatHistory = r.bool();
                            break;
                        }
                    case 8: {
                            m.supportCagReactionsAndPolls = r.bool();
                            break;
                        }
                    case 9: {
                            m.supportBizHostedMsg = r.bool();
                            break;
                        }
                    case 10: {
                            m.supportRecentSyncChunkMessageCountTuning = r.bool();
                            break;
                        }
                    case 11: {
                            m.supportHostedGroupMsg = r.bool();
                            break;
                        }
                    case 12: {
                            m.supportFbidBotChatHistory = r.bool();
                            break;
                        }
                    case 13: {
                            m.supportAddOnHistorySyncMigration = r.bool();
                            break;
                        }
                    case 14: {
                            m.supportMessageAssociation = r.bool();
                            break;
                        }
                    case 15: {
                            m.supportGroupHistory = r.bool();
                            break;
                        }
                    case 16: {
                            m.onDemandReady = r.bool();
                            break;
                        }
                    case 17: {
                            m.supportGuestChat = r.bool();
                            break;
                        }
                    case 18: {
                            m.completeOnDemandReady = r.bool();
                            break;
                        }
                    case 19: {
                            m.thumbnailSyncDaysLimit = r.uint32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            HistorySyncConfig.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.DeviceProps.HistorySyncConfig)
                    return d;
                var m = new $root.proto.DeviceProps.HistorySyncConfig();
                if (d.fullSyncDaysLimit != null) {
                    m.fullSyncDaysLimit = d.fullSyncDaysLimit >>> 0;
                }
                if (d.fullSyncSizeMbLimit != null) {
                    m.fullSyncSizeMbLimit = d.fullSyncSizeMbLimit >>> 0;
                }
                if (d.storageQuotaMb != null) {
                    m.storageQuotaMb = d.storageQuotaMb >>> 0;
                }
                if (d.inlineInitialPayloadInE2EeMsg != null) {
                    m.inlineInitialPayloadInE2EeMsg = Boolean(d.inlineInitialPayloadInE2EeMsg);
                }
                if (d.recentSyncDaysLimit != null) {
                    m.recentSyncDaysLimit = d.recentSyncDaysLimit >>> 0;
                }
                if (d.supportCallLogHistory != null) {
                    m.supportCallLogHistory = Boolean(d.supportCallLogHistory);
                }
                if (d.supportBotUserAgentChatHistory != null) {
                    m.supportBotUserAgentChatHistory = Boolean(d.supportBotUserAgentChatHistory);
                }
                if (d.supportCagReactionsAndPolls != null) {
                    m.supportCagReactionsAndPolls = Boolean(d.supportCagReactionsAndPolls);
                }
                if (d.supportBizHostedMsg != null) {
                    m.supportBizHostedMsg = Boolean(d.supportBizHostedMsg);
                }
                if (d.supportRecentSyncChunkMessageCountTuning != null) {
                    m.supportRecentSyncChunkMessageCountTuning = Boolean(d.supportRecentSyncChunkMessageCountTuning);
                }
                if (d.supportHostedGroupMsg != null) {
                    m.supportHostedGroupMsg = Boolean(d.supportHostedGroupMsg);
                }
                if (d.supportFbidBotChatHistory != null) {
                    m.supportFbidBotChatHistory = Boolean(d.supportFbidBotChatHistory);
                }
                if (d.supportAddOnHistorySyncMigration != null) {
                    m.supportAddOnHistorySyncMigration = Boolean(d.supportAddOnHistorySyncMigration);
                }
                if (d.supportMessageAssociation != null) {
                    m.supportMessageAssociation = Boolean(d.supportMessageAssociation);
                }
                if (d.supportGroupHistory != null) {
                    m.supportGroupHistory = Boolean(d.supportGroupHistory);
                }
                if (d.onDemandReady != null) {
                    m.onDemandReady = Boolean(d.onDemandReady);
                }
                if (d.supportGuestChat != null) {
                    m.supportGuestChat = Boolean(d.supportGuestChat);
                }
                if (d.completeOnDemandReady != null) {
                    m.completeOnDemandReady = Boolean(d.completeOnDemandReady);
                }
                if (d.thumbnailSyncDaysLimit != null) {
                    m.thumbnailSyncDaysLimit = d.thumbnailSyncDaysLimit >>> 0;
                }
                return m;
            };

            HistorySyncConfig.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.fullSyncDaysLimit != null && m.hasOwnProperty("fullSyncDaysLimit")) {
                    d.fullSyncDaysLimit = m.fullSyncDaysLimit;
                    if (o.oneofs)
                        d._fullSyncDaysLimit = "fullSyncDaysLimit";
                }
                if (m.fullSyncSizeMbLimit != null && m.hasOwnProperty("fullSyncSizeMbLimit")) {
                    d.fullSyncSizeMbLimit = m.fullSyncSizeMbLimit;
                    if (o.oneofs)
                        d._fullSyncSizeMbLimit = "fullSyncSizeMbLimit";
                }
                if (m.storageQuotaMb != null && m.hasOwnProperty("storageQuotaMb")) {
                    d.storageQuotaMb = m.storageQuotaMb;
                    if (o.oneofs)
                        d._storageQuotaMb = "storageQuotaMb";
                }
                if (m.inlineInitialPayloadInE2EeMsg != null && m.hasOwnProperty("inlineInitialPayloadInE2EeMsg")) {
                    d.inlineInitialPayloadInE2EeMsg = m.inlineInitialPayloadInE2EeMsg;
                    if (o.oneofs)
                        d._inlineInitialPayloadInE2EeMsg = "inlineInitialPayloadInE2EeMsg";
                }
                if (m.recentSyncDaysLimit != null && m.hasOwnProperty("recentSyncDaysLimit")) {
                    d.recentSyncDaysLimit = m.recentSyncDaysLimit;
                    if (o.oneofs)
                        d._recentSyncDaysLimit = "recentSyncDaysLimit";
                }
                if (m.supportCallLogHistory != null && m.hasOwnProperty("supportCallLogHistory")) {
                    d.supportCallLogHistory = m.supportCallLogHistory;
                    if (o.oneofs)
                        d._supportCallLogHistory = "supportCallLogHistory";
                }
                if (m.supportBotUserAgentChatHistory != null && m.hasOwnProperty("supportBotUserAgentChatHistory")) {
                    d.supportBotUserAgentChatHistory = m.supportBotUserAgentChatHistory;
                    if (o.oneofs)
                        d._supportBotUserAgentChatHistory = "supportBotUserAgentChatHistory";
                }
                if (m.supportCagReactionsAndPolls != null && m.hasOwnProperty("supportCagReactionsAndPolls")) {
                    d.supportCagReactionsAndPolls = m.supportCagReactionsAndPolls;
                    if (o.oneofs)
                        d._supportCagReactionsAndPolls = "supportCagReactionsAndPolls";
                }
                if (m.supportBizHostedMsg != null && m.hasOwnProperty("supportBizHostedMsg")) {
                    d.supportBizHostedMsg = m.supportBizHostedMsg;
                    if (o.oneofs)
                        d._supportBizHostedMsg = "supportBizHostedMsg";
                }
                if (m.supportRecentSyncChunkMessageCountTuning != null && m.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")) {
                    d.supportRecentSyncChunkMessageCountTuning = m.supportRecentSyncChunkMessageCountTuning;
                    if (o.oneofs)
                        d._supportRecentSyncChunkMessageCountTuning = "supportRecentSyncChunkMessageCountTuning";
                }
                if (m.supportHostedGroupMsg != null && m.hasOwnProperty("supportHostedGroupMsg")) {
                    d.supportHostedGroupMsg = m.supportHostedGroupMsg;
                    if (o.oneofs)
                        d._supportHostedGroupMsg = "supportHostedGroupMsg";
                }
                if (m.supportFbidBotChatHistory != null && m.hasOwnProperty("supportFbidBotChatHistory")) {
                    d.supportFbidBotChatHistory = m.supportFbidBotChatHistory;
                    if (o.oneofs)
                        d._supportFbidBotChatHistory = "supportFbidBotChatHistory";
                }
                if (m.supportAddOnHistorySyncMigration != null && m.hasOwnProperty("supportAddOnHistorySyncMigration")) {
                    d.supportAddOnHistorySyncMigration = m.supportAddOnHistorySyncMigration;
                    if (o.oneofs)
                        d._supportAddOnHistorySyncMigration = "supportAddOnHistorySyncMigration";
                }
                if (m.supportMessageAssociation != null && m.hasOwnProperty("supportMessageAssociation")) {
                    d.supportMessageAssociation = m.supportMessageAssociation;
                    if (o.oneofs)
                        d._supportMessageAssociation = "supportMessageAssociation";
                }
                if (m.supportGroupHistory != null && m.hasOwnProperty("supportGroupHistory")) {
                    d.supportGroupHistory = m.supportGroupHistory;
                    if (o.oneofs)
                        d._supportGroupHistory = "supportGroupHistory";
                }
                if (m.onDemandReady != null && m.hasOwnProperty("onDemandReady")) {
                    d.onDemandReady = m.onDemandReady;
                    if (o.oneofs)
                        d._onDemandReady = "onDemandReady";
                }
                if (m.supportGuestChat != null && m.hasOwnProperty("supportGuestChat")) {
                    d.supportGuestChat = m.supportGuestChat;
                    if (o.oneofs)
                        d._supportGuestChat = "supportGuestChat";
                }
                if (m.completeOnDemandReady != null && m.hasOwnProperty("completeOnDemandReady")) {
                    d.completeOnDemandReady = m.completeOnDemandReady;
                    if (o.oneofs)
                        d._completeOnDemandReady = "completeOnDemandReady";
                }
                if (m.thumbnailSyncDaysLimit != null && m.hasOwnProperty("thumbnailSyncDaysLimit")) {
                    d.thumbnailSyncDaysLimit = m.thumbnailSyncDaysLimit;
                    if (o.oneofs)
                        d._thumbnailSyncDaysLimit = "thumbnailSyncDaysLimit";
                }
                return d;
            };

            HistorySyncConfig.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            HistorySyncConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.DeviceProps.HistorySyncConfig";
            };

            return HistorySyncConfig;
        })();

        DeviceProps.PlatformType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "CHROME"] = 1;
            values[valuesById[2] = "FIREFOX"] = 2;
            values[valuesById[3] = "IE"] = 3;
            values[valuesById[4] = "OPERA"] = 4;
            values[valuesById[5] = "SAFARI"] = 5;
            values[valuesById[6] = "EDGE"] = 6;
            values[valuesById[7] = "DESKTOP"] = 7;
            values[valuesById[8] = "IPAD"] = 8;
            values[valuesById[9] = "ANDROID_TABLET"] = 9;
            values[valuesById[10] = "OHANA"] = 10;
            values[valuesById[11] = "ALOHA"] = 11;
            values[valuesById[12] = "CATALINA"] = 12;
            values[valuesById[13] = "TCL_TV"] = 13;
            values[valuesById[14] = "IOS_PHONE"] = 14;
            values[valuesById[15] = "IOS_CATALYST"] = 15;
            values[valuesById[16] = "ANDROID_PHONE"] = 16;
            values[valuesById[17] = "ANDROID_AMBIGUOUS"] = 17;
            values[valuesById[18] = "WEAR_OS"] = 18;
            values[valuesById[19] = "AR_WRIST"] = 19;
            values[valuesById[20] = "AR_DEVICE"] = 20;
            values[valuesById[21] = "UWP"] = 21;
            values[valuesById[22] = "VR"] = 22;
            values[valuesById[23] = "CLOUD_API"] = 23;
            values[valuesById[24] = "SMARTGLASSES"] = 24;
            return values;
        })();

        return DeviceProps;
    })();

    proto.DisappearingMode = (function() {

        function DisappearingMode(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        DisappearingMode.prototype.initiator = null;
        DisappearingMode.prototype.trigger = null;
        DisappearingMode.prototype.initiatorDeviceJid = null;
        DisappearingMode.prototype.initiatedByMe = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DisappearingMode.prototype, "_initiator", {
            get: $util.oneOfGetter($oneOfFields = ["initiator"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DisappearingMode.prototype, "_trigger", {
            get: $util.oneOfGetter($oneOfFields = ["trigger"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DisappearingMode.prototype, "_initiatorDeviceJid", {
            get: $util.oneOfGetter($oneOfFields = ["initiatorDeviceJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(DisappearingMode.prototype, "_initiatedByMe", {
            get: $util.oneOfGetter($oneOfFields = ["initiatedByMe"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        DisappearingMode.create = function create(properties) {
            return new DisappearingMode(properties);
        };

        DisappearingMode.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.initiator != null && Object.hasOwnProperty.call(m, "initiator"))
                w.uint32(8).int32(m.initiator);
            if (m.trigger != null && Object.hasOwnProperty.call(m, "trigger"))
                w.uint32(16).int32(m.trigger);
            if (m.initiatorDeviceJid != null && Object.hasOwnProperty.call(m, "initiatorDeviceJid"))
                w.uint32(26).string(m.initiatorDeviceJid);
            if (m.initiatedByMe != null && Object.hasOwnProperty.call(m, "initiatedByMe"))
                w.uint32(32).bool(m.initiatedByMe);
            return w;
        };

        DisappearingMode.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DisappearingMode();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.initiator = r.int32();
                        break;
                    }
                case 2: {
                        m.trigger = r.int32();
                        break;
                    }
                case 3: {
                        m.initiatorDeviceJid = r.string();
                        break;
                    }
                case 4: {
                        m.initiatedByMe = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        DisappearingMode.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.DisappearingMode)
                return d;
            var m = new $root.proto.DisappearingMode();
            switch (d.initiator) {
            default:
                if (typeof d.initiator === "number") {
                    m.initiator = d.initiator;
                    break;
                }
                break;
            case "CHANGED_IN_CHAT":
            case 0:
                m.initiator = 0;
                break;
            case "INITIATED_BY_ME":
            case 1:
                m.initiator = 1;
                break;
            case "INITIATED_BY_OTHER":
            case 2:
                m.initiator = 2;
                break;
            case "BIZ_UPGRADE_FB_HOSTING":
            case 3:
                m.initiator = 3;
                break;
            }
            switch (d.trigger) {
            default:
                if (typeof d.trigger === "number") {
                    m.trigger = d.trigger;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.trigger = 0;
                break;
            case "CHAT_SETTING":
            case 1:
                m.trigger = 1;
                break;
            case "ACCOUNT_SETTING":
            case 2:
                m.trigger = 2;
                break;
            case "BULK_CHANGE":
            case 3:
                m.trigger = 3;
                break;
            case "BIZ_SUPPORTS_FB_HOSTING":
            case 4:
                m.trigger = 4;
                break;
            case "UNKNOWN_GROUPS":
            case 5:
                m.trigger = 5;
                break;
            }
            if (d.initiatorDeviceJid != null) {
                m.initiatorDeviceJid = String(d.initiatorDeviceJid);
            }
            if (d.initiatedByMe != null) {
                m.initiatedByMe = Boolean(d.initiatedByMe);
            }
            return m;
        };

        DisappearingMode.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.initiator != null && m.hasOwnProperty("initiator")) {
                d.initiator = o.enums === String ? $root.proto.DisappearingMode.Initiator[m.initiator] === undefined ? m.initiator : $root.proto.DisappearingMode.Initiator[m.initiator] : m.initiator;
                if (o.oneofs)
                    d._initiator = "initiator";
            }
            if (m.trigger != null && m.hasOwnProperty("trigger")) {
                d.trigger = o.enums === String ? $root.proto.DisappearingMode.Trigger[m.trigger] === undefined ? m.trigger : $root.proto.DisappearingMode.Trigger[m.trigger] : m.trigger;
                if (o.oneofs)
                    d._trigger = "trigger";
            }
            if (m.initiatorDeviceJid != null && m.hasOwnProperty("initiatorDeviceJid")) {
                d.initiatorDeviceJid = m.initiatorDeviceJid;
                if (o.oneofs)
                    d._initiatorDeviceJid = "initiatorDeviceJid";
            }
            if (m.initiatedByMe != null && m.hasOwnProperty("initiatedByMe")) {
                d.initiatedByMe = m.initiatedByMe;
                if (o.oneofs)
                    d._initiatedByMe = "initiatedByMe";
            }
            return d;
        };

        DisappearingMode.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        DisappearingMode.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.DisappearingMode";
        };

        DisappearingMode.Initiator = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "CHANGED_IN_CHAT"] = 0;
            values[valuesById[1] = "INITIATED_BY_ME"] = 1;
            values[valuesById[2] = "INITIATED_BY_OTHER"] = 2;
            values[valuesById[3] = "BIZ_UPGRADE_FB_HOSTING"] = 3;
            return values;
        })();

        DisappearingMode.Trigger = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "CHAT_SETTING"] = 1;
            values[valuesById[2] = "ACCOUNT_SETTING"] = 2;
            values[valuesById[3] = "BULK_CHANGE"] = 3;
            values[valuesById[4] = "BIZ_SUPPORTS_FB_HOSTING"] = 4;
            values[valuesById[5] = "UNKNOWN_GROUPS"] = 5;
            return values;
        })();

        return DisappearingMode;
    })();

    proto.EmbeddedContent = (function() {

        function EmbeddedContent(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        EmbeddedContent.prototype.embeddedMessage = null;
        EmbeddedContent.prototype.embeddedMusic = null;

        let $oneOfFields;

        Object.defineProperty(EmbeddedContent.prototype, "content", {
            get: $util.oneOfGetter($oneOfFields = ["embeddedMessage", "embeddedMusic"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        EmbeddedContent.create = function create(properties) {
            return new EmbeddedContent(properties);
        };

        EmbeddedContent.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.embeddedMessage != null && Object.hasOwnProperty.call(m, "embeddedMessage"))
                $root.proto.EmbeddedMessage.encode(m.embeddedMessage, w.uint32(10).fork()).ldelim();
            if (m.embeddedMusic != null && Object.hasOwnProperty.call(m, "embeddedMusic"))
                $root.proto.EmbeddedMusic.encode(m.embeddedMusic, w.uint32(18).fork()).ldelim();
            return w;
        };

        EmbeddedContent.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EmbeddedContent();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.embeddedMessage = $root.proto.EmbeddedMessage.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.embeddedMusic = $root.proto.EmbeddedMusic.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        EmbeddedContent.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.EmbeddedContent)
                return d;
            var m = new $root.proto.EmbeddedContent();
            if (d.embeddedMessage != null) {
                if (typeof d.embeddedMessage !== "object")
                    throw TypeError(".proto.EmbeddedContent.embeddedMessage: object expected");
                m.embeddedMessage = $root.proto.EmbeddedMessage.fromObject(d.embeddedMessage);
            }
            if (d.embeddedMusic != null) {
                if (typeof d.embeddedMusic !== "object")
                    throw TypeError(".proto.EmbeddedContent.embeddedMusic: object expected");
                m.embeddedMusic = $root.proto.EmbeddedMusic.fromObject(d.embeddedMusic);
            }
            return m;
        };

        EmbeddedContent.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.embeddedMessage != null && m.hasOwnProperty("embeddedMessage")) {
                d.embeddedMessage = $root.proto.EmbeddedMessage.toObject(m.embeddedMessage, o);
                if (o.oneofs)
                    d.content = "embeddedMessage";
            }
            if (m.embeddedMusic != null && m.hasOwnProperty("embeddedMusic")) {
                d.embeddedMusic = $root.proto.EmbeddedMusic.toObject(m.embeddedMusic, o);
                if (o.oneofs)
                    d.content = "embeddedMusic";
            }
            return d;
        };

        EmbeddedContent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        EmbeddedContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.EmbeddedContent";
        };

        return EmbeddedContent;
    })();

    proto.EmbeddedMessage = (function() {

        function EmbeddedMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        EmbeddedMessage.prototype.stanzaId = null;
        EmbeddedMessage.prototype.message = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMessage.prototype, "_stanzaId", {
            get: $util.oneOfGetter($oneOfFields = ["stanzaId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMessage.prototype, "_message", {
            get: $util.oneOfGetter($oneOfFields = ["message"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        EmbeddedMessage.create = function create(properties) {
            return new EmbeddedMessage(properties);
        };

        EmbeddedMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.stanzaId != null && Object.hasOwnProperty.call(m, "stanzaId"))
                w.uint32(10).string(m.stanzaId);
            if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                $root.proto.Message.encode(m.message, w.uint32(18).fork()).ldelim();
            return w;
        };

        EmbeddedMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EmbeddedMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.stanzaId = r.string();
                        break;
                    }
                case 2: {
                        m.message = $root.proto.Message.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        EmbeddedMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.EmbeddedMessage)
                return d;
            var m = new $root.proto.EmbeddedMessage();
            if (d.stanzaId != null) {
                m.stanzaId = String(d.stanzaId);
            }
            if (d.message != null) {
                if (typeof d.message !== "object")
                    throw TypeError(".proto.EmbeddedMessage.message: object expected");
                m.message = $root.proto.Message.fromObject(d.message);
            }
            return m;
        };

        EmbeddedMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) {
                d.stanzaId = m.stanzaId;
                if (o.oneofs)
                    d._stanzaId = "stanzaId";
            }
            if (m.message != null && m.hasOwnProperty("message")) {
                d.message = $root.proto.Message.toObject(m.message, o);
                if (o.oneofs)
                    d._message = "message";
            }
            return d;
        };

        EmbeddedMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        EmbeddedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.EmbeddedMessage";
        };

        return EmbeddedMessage;
    })();

    proto.EmbeddedMusic = (function() {

        function EmbeddedMusic(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        EmbeddedMusic.prototype.musicContentMediaId = null;
        EmbeddedMusic.prototype.songId = null;
        EmbeddedMusic.prototype.author = null;
        EmbeddedMusic.prototype.title = null;
        EmbeddedMusic.prototype.artworkDirectPath = null;
        EmbeddedMusic.prototype.artworkSha256 = null;
        EmbeddedMusic.prototype.artworkEncSha256 = null;
        EmbeddedMusic.prototype.artistAttribution = null;
        EmbeddedMusic.prototype.countryBlocklist = null;
        EmbeddedMusic.prototype.isExplicit = null;
        EmbeddedMusic.prototype.artworkMediaKey = null;
        EmbeddedMusic.prototype.musicSongStartTimeInMs = null;
        EmbeddedMusic.prototype.derivedContentStartTimeInMs = null;
        EmbeddedMusic.prototype.overlapDurationInMs = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_musicContentMediaId", {
            get: $util.oneOfGetter($oneOfFields = ["musicContentMediaId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_songId", {
            get: $util.oneOfGetter($oneOfFields = ["songId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_author", {
            get: $util.oneOfGetter($oneOfFields = ["author"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_title", {
            get: $util.oneOfGetter($oneOfFields = ["title"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_artworkDirectPath", {
            get: $util.oneOfGetter($oneOfFields = ["artworkDirectPath"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_artworkSha256", {
            get: $util.oneOfGetter($oneOfFields = ["artworkSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_artworkEncSha256", {
            get: $util.oneOfGetter($oneOfFields = ["artworkEncSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_artistAttribution", {
            get: $util.oneOfGetter($oneOfFields = ["artistAttribution"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_countryBlocklist", {
            get: $util.oneOfGetter($oneOfFields = ["countryBlocklist"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_isExplicit", {
            get: $util.oneOfGetter($oneOfFields = ["isExplicit"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_artworkMediaKey", {
            get: $util.oneOfGetter($oneOfFields = ["artworkMediaKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_musicSongStartTimeInMs", {
            get: $util.oneOfGetter($oneOfFields = ["musicSongStartTimeInMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_derivedContentStartTimeInMs", {
            get: $util.oneOfGetter($oneOfFields = ["derivedContentStartTimeInMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EmbeddedMusic.prototype, "_overlapDurationInMs", {
            get: $util.oneOfGetter($oneOfFields = ["overlapDurationInMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        EmbeddedMusic.create = function create(properties) {
            return new EmbeddedMusic(properties);
        };

        EmbeddedMusic.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.musicContentMediaId != null && Object.hasOwnProperty.call(m, "musicContentMediaId"))
                w.uint32(10).string(m.musicContentMediaId);
            if (m.songId != null && Object.hasOwnProperty.call(m, "songId"))
                w.uint32(18).string(m.songId);
            if (m.author != null && Object.hasOwnProperty.call(m, "author"))
                w.uint32(26).string(m.author);
            if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                w.uint32(34).string(m.title);
            if (m.artworkDirectPath != null && Object.hasOwnProperty.call(m, "artworkDirectPath"))
                w.uint32(42).string(m.artworkDirectPath);
            if (m.artworkSha256 != null && Object.hasOwnProperty.call(m, "artworkSha256"))
                w.uint32(50).bytes(m.artworkSha256);
            if (m.artworkEncSha256 != null && Object.hasOwnProperty.call(m, "artworkEncSha256"))
                w.uint32(58).bytes(m.artworkEncSha256);
            if (m.artistAttribution != null && Object.hasOwnProperty.call(m, "artistAttribution"))
                w.uint32(66).string(m.artistAttribution);
            if (m.countryBlocklist != null && Object.hasOwnProperty.call(m, "countryBlocklist"))
                w.uint32(74).bytes(m.countryBlocklist);
            if (m.isExplicit != null && Object.hasOwnProperty.call(m, "isExplicit"))
                w.uint32(80).bool(m.isExplicit);
            if (m.artworkMediaKey != null && Object.hasOwnProperty.call(m, "artworkMediaKey"))
                w.uint32(90).bytes(m.artworkMediaKey);
            if (m.musicSongStartTimeInMs != null && Object.hasOwnProperty.call(m, "musicSongStartTimeInMs"))
                w.uint32(96).int64(m.musicSongStartTimeInMs);
            if (m.derivedContentStartTimeInMs != null && Object.hasOwnProperty.call(m, "derivedContentStartTimeInMs"))
                w.uint32(104).int64(m.derivedContentStartTimeInMs);
            if (m.overlapDurationInMs != null && Object.hasOwnProperty.call(m, "overlapDurationInMs"))
                w.uint32(112).int64(m.overlapDurationInMs);
            return w;
        };

        EmbeddedMusic.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EmbeddedMusic();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.musicContentMediaId = r.string();
                        break;
                    }
                case 2: {
                        m.songId = r.string();
                        break;
                    }
                case 3: {
                        m.author = r.string();
                        break;
                    }
                case 4: {
                        m.title = r.string();
                        break;
                    }
                case 5: {
                        m.artworkDirectPath = r.string();
                        break;
                    }
                case 6: {
                        m.artworkSha256 = r.bytes();
                        break;
                    }
                case 7: {
                        m.artworkEncSha256 = r.bytes();
                        break;
                    }
                case 8: {
                        m.artistAttribution = r.string();
                        break;
                    }
                case 9: {
                        m.countryBlocklist = r.bytes();
                        break;
                    }
                case 10: {
                        m.isExplicit = r.bool();
                        break;
                    }
                case 11: {
                        m.artworkMediaKey = r.bytes();
                        break;
                    }
                case 12: {
                        m.musicSongStartTimeInMs = r.int64();
                        break;
                    }
                case 13: {
                        m.derivedContentStartTimeInMs = r.int64();
                        break;
                    }
                case 14: {
                        m.overlapDurationInMs = r.int64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        EmbeddedMusic.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.EmbeddedMusic)
                return d;
            var m = new $root.proto.EmbeddedMusic();
            if (d.musicContentMediaId != null) {
                m.musicContentMediaId = String(d.musicContentMediaId);
            }
            if (d.songId != null) {
                m.songId = String(d.songId);
            }
            if (d.author != null) {
                m.author = String(d.author);
            }
            if (d.title != null) {
                m.title = String(d.title);
            }
            if (d.artworkDirectPath != null) {
                m.artworkDirectPath = String(d.artworkDirectPath);
            }
            if (d.artworkSha256 != null) {
                if (typeof d.artworkSha256 === "string")
                    $util.base64.decode(d.artworkSha256, m.artworkSha256 = $util.newBuffer($util.base64.length(d.artworkSha256)), 0);
                else if (d.artworkSha256.length >= 0)
                    m.artworkSha256 = d.artworkSha256;
            }
            if (d.artworkEncSha256 != null) {
                if (typeof d.artworkEncSha256 === "string")
                    $util.base64.decode(d.artworkEncSha256, m.artworkEncSha256 = $util.newBuffer($util.base64.length(d.artworkEncSha256)), 0);
                else if (d.artworkEncSha256.length >= 0)
                    m.artworkEncSha256 = d.artworkEncSha256;
            }
            if (d.artistAttribution != null) {
                m.artistAttribution = String(d.artistAttribution);
            }
            if (d.countryBlocklist != null) {
                if (typeof d.countryBlocklist === "string")
                    $util.base64.decode(d.countryBlocklist, m.countryBlocklist = $util.newBuffer($util.base64.length(d.countryBlocklist)), 0);
                else if (d.countryBlocklist.length >= 0)
                    m.countryBlocklist = d.countryBlocklist;
            }
            if (d.isExplicit != null) {
                m.isExplicit = Boolean(d.isExplicit);
            }
            if (d.artworkMediaKey != null) {
                if (typeof d.artworkMediaKey === "string")
                    $util.base64.decode(d.artworkMediaKey, m.artworkMediaKey = $util.newBuffer($util.base64.length(d.artworkMediaKey)), 0);
                else if (d.artworkMediaKey.length >= 0)
                    m.artworkMediaKey = d.artworkMediaKey;
            }
            if (d.musicSongStartTimeInMs != null) {
                if ($util.Long)
                    (m.musicSongStartTimeInMs = $util.Long.fromValue(d.musicSongStartTimeInMs)).unsigned = false;
                else if (typeof d.musicSongStartTimeInMs === "string")
                    m.musicSongStartTimeInMs = parseInt(d.musicSongStartTimeInMs, 10);
                else if (typeof d.musicSongStartTimeInMs === "number")
                    m.musicSongStartTimeInMs = d.musicSongStartTimeInMs;
                else if (typeof d.musicSongStartTimeInMs === "object")
                    m.musicSongStartTimeInMs = new $util.LongBits(d.musicSongStartTimeInMs.low >>> 0, d.musicSongStartTimeInMs.high >>> 0).toNumber();
            }
            if (d.derivedContentStartTimeInMs != null) {
                if ($util.Long)
                    (m.derivedContentStartTimeInMs = $util.Long.fromValue(d.derivedContentStartTimeInMs)).unsigned = false;
                else if (typeof d.derivedContentStartTimeInMs === "string")
                    m.derivedContentStartTimeInMs = parseInt(d.derivedContentStartTimeInMs, 10);
                else if (typeof d.derivedContentStartTimeInMs === "number")
                    m.derivedContentStartTimeInMs = d.derivedContentStartTimeInMs;
                else if (typeof d.derivedContentStartTimeInMs === "object")
                    m.derivedContentStartTimeInMs = new $util.LongBits(d.derivedContentStartTimeInMs.low >>> 0, d.derivedContentStartTimeInMs.high >>> 0).toNumber();
            }
            if (d.overlapDurationInMs != null) {
                if ($util.Long)
                    (m.overlapDurationInMs = $util.Long.fromValue(d.overlapDurationInMs)).unsigned = false;
                else if (typeof d.overlapDurationInMs === "string")
                    m.overlapDurationInMs = parseInt(d.overlapDurationInMs, 10);
                else if (typeof d.overlapDurationInMs === "number")
                    m.overlapDurationInMs = d.overlapDurationInMs;
                else if (typeof d.overlapDurationInMs === "object")
                    m.overlapDurationInMs = new $util.LongBits(d.overlapDurationInMs.low >>> 0, d.overlapDurationInMs.high >>> 0).toNumber();
            }
            return m;
        };

        EmbeddedMusic.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.musicContentMediaId != null && m.hasOwnProperty("musicContentMediaId")) {
                d.musicContentMediaId = m.musicContentMediaId;
                if (o.oneofs)
                    d._musicContentMediaId = "musicContentMediaId";
            }
            if (m.songId != null && m.hasOwnProperty("songId")) {
                d.songId = m.songId;
                if (o.oneofs)
                    d._songId = "songId";
            }
            if (m.author != null && m.hasOwnProperty("author")) {
                d.author = m.author;
                if (o.oneofs)
                    d._author = "author";
            }
            if (m.title != null && m.hasOwnProperty("title")) {
                d.title = m.title;
                if (o.oneofs)
                    d._title = "title";
            }
            if (m.artworkDirectPath != null && m.hasOwnProperty("artworkDirectPath")) {
                d.artworkDirectPath = m.artworkDirectPath;
                if (o.oneofs)
                    d._artworkDirectPath = "artworkDirectPath";
            }
            if (m.artworkSha256 != null && m.hasOwnProperty("artworkSha256")) {
                d.artworkSha256 = o.bytes === String ? $util.base64.encode(m.artworkSha256, 0, m.artworkSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.artworkSha256) : m.artworkSha256;
                if (o.oneofs)
                    d._artworkSha256 = "artworkSha256";
            }
            if (m.artworkEncSha256 != null && m.hasOwnProperty("artworkEncSha256")) {
                d.artworkEncSha256 = o.bytes === String ? $util.base64.encode(m.artworkEncSha256, 0, m.artworkEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.artworkEncSha256) : m.artworkEncSha256;
                if (o.oneofs)
                    d._artworkEncSha256 = "artworkEncSha256";
            }
            if (m.artistAttribution != null && m.hasOwnProperty("artistAttribution")) {
                d.artistAttribution = m.artistAttribution;
                if (o.oneofs)
                    d._artistAttribution = "artistAttribution";
            }
            if (m.countryBlocklist != null && m.hasOwnProperty("countryBlocklist")) {
                d.countryBlocklist = o.bytes === String ? $util.base64.encode(m.countryBlocklist, 0, m.countryBlocklist.length) : o.bytes === Array ? Array.prototype.slice.call(m.countryBlocklist) : m.countryBlocklist;
                if (o.oneofs)
                    d._countryBlocklist = "countryBlocklist";
            }
            if (m.isExplicit != null && m.hasOwnProperty("isExplicit")) {
                d.isExplicit = m.isExplicit;
                if (o.oneofs)
                    d._isExplicit = "isExplicit";
            }
            if (m.artworkMediaKey != null && m.hasOwnProperty("artworkMediaKey")) {
                d.artworkMediaKey = o.bytes === String ? $util.base64.encode(m.artworkMediaKey, 0, m.artworkMediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.artworkMediaKey) : m.artworkMediaKey;
                if (o.oneofs)
                    d._artworkMediaKey = "artworkMediaKey";
            }
            if (m.musicSongStartTimeInMs != null && m.hasOwnProperty("musicSongStartTimeInMs")) {
                if (typeof m.musicSongStartTimeInMs === "number")
                    d.musicSongStartTimeInMs = o.longs === String ? String(m.musicSongStartTimeInMs) : m.musicSongStartTimeInMs;
                else
                    d.musicSongStartTimeInMs = o.longs === String ? longToString(m.musicSongStartTimeInMs) : o.longs === Number ? longToNumber(m.musicSongStartTimeInMs) : m.musicSongStartTimeInMs;
                if (o.oneofs)
                    d._musicSongStartTimeInMs = "musicSongStartTimeInMs";
            }
            if (m.derivedContentStartTimeInMs != null && m.hasOwnProperty("derivedContentStartTimeInMs")) {
                if (typeof m.derivedContentStartTimeInMs === "number")
                    d.derivedContentStartTimeInMs = o.longs === String ? String(m.derivedContentStartTimeInMs) : m.derivedContentStartTimeInMs;
                else
                    d.derivedContentStartTimeInMs = o.longs === String ? longToString(m.derivedContentStartTimeInMs) : o.longs === Number ? longToNumber(m.derivedContentStartTimeInMs) : m.derivedContentStartTimeInMs;
                if (o.oneofs)
                    d._derivedContentStartTimeInMs = "derivedContentStartTimeInMs";
            }
            if (m.overlapDurationInMs != null && m.hasOwnProperty("overlapDurationInMs")) {
                if (typeof m.overlapDurationInMs === "number")
                    d.overlapDurationInMs = o.longs === String ? String(m.overlapDurationInMs) : m.overlapDurationInMs;
                else
                    d.overlapDurationInMs = o.longs === String ? longToString(m.overlapDurationInMs) : o.longs === Number ? longToNumber(m.overlapDurationInMs) : m.overlapDurationInMs;
                if (o.oneofs)
                    d._overlapDurationInMs = "overlapDurationInMs";
            }
            return d;
        };

        EmbeddedMusic.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        EmbeddedMusic.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.EmbeddedMusic";
        };

        return EmbeddedMusic;
    })();

    proto.EncryptedPairingRequest = (function() {

        function EncryptedPairingRequest(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        EncryptedPairingRequest.prototype.encryptedPayload = null;
        EncryptedPairingRequest.prototype.iv = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EncryptedPairingRequest.prototype, "_encryptedPayload", {
            get: $util.oneOfGetter($oneOfFields = ["encryptedPayload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EncryptedPairingRequest.prototype, "_iv", {
            get: $util.oneOfGetter($oneOfFields = ["iv"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        EncryptedPairingRequest.create = function create(properties) {
            return new EncryptedPairingRequest(properties);
        };

        EncryptedPairingRequest.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.encryptedPayload != null && Object.hasOwnProperty.call(m, "encryptedPayload"))
                w.uint32(10).bytes(m.encryptedPayload);
            if (m.iv != null && Object.hasOwnProperty.call(m, "iv"))
                w.uint32(18).bytes(m.iv);
            return w;
        };

        EncryptedPairingRequest.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EncryptedPairingRequest();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.encryptedPayload = r.bytes();
                        break;
                    }
                case 2: {
                        m.iv = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        EncryptedPairingRequest.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.EncryptedPairingRequest)
                return d;
            var m = new $root.proto.EncryptedPairingRequest();
            if (d.encryptedPayload != null) {
                if (typeof d.encryptedPayload === "string")
                    $util.base64.decode(d.encryptedPayload, m.encryptedPayload = $util.newBuffer($util.base64.length(d.encryptedPayload)), 0);
                else if (d.encryptedPayload.length >= 0)
                    m.encryptedPayload = d.encryptedPayload;
            }
            if (d.iv != null) {
                if (typeof d.iv === "string")
                    $util.base64.decode(d.iv, m.iv = $util.newBuffer($util.base64.length(d.iv)), 0);
                else if (d.iv.length >= 0)
                    m.iv = d.iv;
            }
            return m;
        };

        EncryptedPairingRequest.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.encryptedPayload != null && m.hasOwnProperty("encryptedPayload")) {
                d.encryptedPayload = o.bytes === String ? $util.base64.encode(m.encryptedPayload, 0, m.encryptedPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encryptedPayload) : m.encryptedPayload;
                if (o.oneofs)
                    d._encryptedPayload = "encryptedPayload";
            }
            if (m.iv != null && m.hasOwnProperty("iv")) {
                d.iv = o.bytes === String ? $util.base64.encode(m.iv, 0, m.iv.length) : o.bytes === Array ? Array.prototype.slice.call(m.iv) : m.iv;
                if (o.oneofs)
                    d._iv = "iv";
            }
            return d;
        };

        EncryptedPairingRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        EncryptedPairingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.EncryptedPairingRequest";
        };

        return EncryptedPairingRequest;
    })();

    proto.EphemeralSetting = (function() {

        function EphemeralSetting(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        EphemeralSetting.prototype.duration = null;
        EphemeralSetting.prototype.timestamp = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EphemeralSetting.prototype, "_duration", {
            get: $util.oneOfGetter($oneOfFields = ["duration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EphemeralSetting.prototype, "_timestamp", {
            get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        EphemeralSetting.create = function create(properties) {
            return new EphemeralSetting(properties);
        };

        EphemeralSetting.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.duration != null && Object.hasOwnProperty.call(m, "duration"))
                w.uint32(13).sfixed32(m.duration);
            if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                w.uint32(17).sfixed64(m.timestamp);
            return w;
        };

        EphemeralSetting.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EphemeralSetting();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.duration = r.sfixed32();
                        break;
                    }
                case 2: {
                        m.timestamp = r.sfixed64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        EphemeralSetting.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.EphemeralSetting)
                return d;
            var m = new $root.proto.EphemeralSetting();
            if (d.duration != null) {
                m.duration = d.duration | 0;
            }
            if (d.timestamp != null) {
                if ($util.Long)
                    (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                else if (typeof d.timestamp === "string")
                    m.timestamp = parseInt(d.timestamp, 10);
                else if (typeof d.timestamp === "number")
                    m.timestamp = d.timestamp;
                else if (typeof d.timestamp === "object")
                    m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
            }
            return m;
        };

        EphemeralSetting.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.duration != null && m.hasOwnProperty("duration")) {
                d.duration = m.duration;
                if (o.oneofs)
                    d._duration = "duration";
            }
            if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                if (typeof m.timestamp === "number")
                    d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                else
                    d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                if (o.oneofs)
                    d._timestamp = "timestamp";
            }
            return d;
        };

        EphemeralSetting.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        EphemeralSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.EphemeralSetting";
        };

        return EphemeralSetting;
    })();

    proto.EventAdditionalMetadata = (function() {

        function EventAdditionalMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        EventAdditionalMetadata.prototype.isStale = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EventAdditionalMetadata.prototype, "_isStale", {
            get: $util.oneOfGetter($oneOfFields = ["isStale"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        EventAdditionalMetadata.create = function create(properties) {
            return new EventAdditionalMetadata(properties);
        };

        EventAdditionalMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.isStale != null && Object.hasOwnProperty.call(m, "isStale"))
                w.uint32(8).bool(m.isStale);
            return w;
        };

        EventAdditionalMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EventAdditionalMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.isStale = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        EventAdditionalMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.EventAdditionalMetadata)
                return d;
            var m = new $root.proto.EventAdditionalMetadata();
            if (d.isStale != null) {
                m.isStale = Boolean(d.isStale);
            }
            return m;
        };

        EventAdditionalMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.isStale != null && m.hasOwnProperty("isStale")) {
                d.isStale = m.isStale;
                if (o.oneofs)
                    d._isStale = "isStale";
            }
            return d;
        };

        EventAdditionalMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        EventAdditionalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.EventAdditionalMetadata";
        };

        return EventAdditionalMetadata;
    })();

    proto.EventResponse = (function() {

        function EventResponse(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        EventResponse.prototype.eventResponseMessageKey = null;
        EventResponse.prototype.timestampMs = null;
        EventResponse.prototype.eventResponseMessage = null;
        EventResponse.prototype.unread = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EventResponse.prototype, "_eventResponseMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["eventResponseMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EventResponse.prototype, "_timestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["timestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EventResponse.prototype, "_eventResponseMessage", {
            get: $util.oneOfGetter($oneOfFields = ["eventResponseMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(EventResponse.prototype, "_unread", {
            get: $util.oneOfGetter($oneOfFields = ["unread"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        EventResponse.create = function create(properties) {
            return new EventResponse(properties);
        };

        EventResponse.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.eventResponseMessageKey != null && Object.hasOwnProperty.call(m, "eventResponseMessageKey"))
                $root.proto.MessageKey.encode(m.eventResponseMessageKey, w.uint32(10).fork()).ldelim();
            if (m.timestampMs != null && Object.hasOwnProperty.call(m, "timestampMs"))
                w.uint32(16).int64(m.timestampMs);
            if (m.eventResponseMessage != null && Object.hasOwnProperty.call(m, "eventResponseMessage"))
                $root.proto.Message.EventResponseMessage.encode(m.eventResponseMessage, w.uint32(26).fork()).ldelim();
            if (m.unread != null && Object.hasOwnProperty.call(m, "unread"))
                w.uint32(32).bool(m.unread);
            return w;
        };

        EventResponse.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EventResponse();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.eventResponseMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.timestampMs = r.int64();
                        break;
                    }
                case 3: {
                        m.eventResponseMessage = $root.proto.Message.EventResponseMessage.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.unread = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        EventResponse.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.EventResponse)
                return d;
            var m = new $root.proto.EventResponse();
            if (d.eventResponseMessageKey != null) {
                if (typeof d.eventResponseMessageKey !== "object")
                    throw TypeError(".proto.EventResponse.eventResponseMessageKey: object expected");
                m.eventResponseMessageKey = $root.proto.MessageKey.fromObject(d.eventResponseMessageKey);
            }
            if (d.timestampMs != null) {
                if ($util.Long)
                    (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false;
                else if (typeof d.timestampMs === "string")
                    m.timestampMs = parseInt(d.timestampMs, 10);
                else if (typeof d.timestampMs === "number")
                    m.timestampMs = d.timestampMs;
                else if (typeof d.timestampMs === "object")
                    m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber();
            }
            if (d.eventResponseMessage != null) {
                if (typeof d.eventResponseMessage !== "object")
                    throw TypeError(".proto.EventResponse.eventResponseMessage: object expected");
                m.eventResponseMessage = $root.proto.Message.EventResponseMessage.fromObject(d.eventResponseMessage);
            }
            if (d.unread != null) {
                m.unread = Boolean(d.unread);
            }
            return m;
        };

        EventResponse.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.eventResponseMessageKey != null && m.hasOwnProperty("eventResponseMessageKey")) {
                d.eventResponseMessageKey = $root.proto.MessageKey.toObject(m.eventResponseMessageKey, o);
                if (o.oneofs)
                    d._eventResponseMessageKey = "eventResponseMessageKey";
            }
            if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) {
                if (typeof m.timestampMs === "number")
                    d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs;
                else
                    d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs;
                if (o.oneofs)
                    d._timestampMs = "timestampMs";
            }
            if (m.eventResponseMessage != null && m.hasOwnProperty("eventResponseMessage")) {
                d.eventResponseMessage = $root.proto.Message.EventResponseMessage.toObject(m.eventResponseMessage, o);
                if (o.oneofs)
                    d._eventResponseMessage = "eventResponseMessage";
            }
            if (m.unread != null && m.hasOwnProperty("unread")) {
                d.unread = m.unread;
                if (o.oneofs)
                    d._unread = "unread";
            }
            return d;
        };

        EventResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        EventResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.EventResponse";
        };

        return EventResponse;
    })();

    proto.ExitCode = (function() {

        function ExitCode(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ExitCode.prototype.code = null;
        ExitCode.prototype.text = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ExitCode.prototype, "_code", {
            get: $util.oneOfGetter($oneOfFields = ["code"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ExitCode.prototype, "_text", {
            get: $util.oneOfGetter($oneOfFields = ["text"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ExitCode.create = function create(properties) {
            return new ExitCode(properties);
        };

        ExitCode.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.code != null && Object.hasOwnProperty.call(m, "code"))
                w.uint32(8).uint64(m.code);
            if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                w.uint32(18).string(m.text);
            return w;
        };

        ExitCode.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ExitCode();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.code = r.uint64();
                        break;
                    }
                case 2: {
                        m.text = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ExitCode.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ExitCode)
                return d;
            var m = new $root.proto.ExitCode();
            if (d.code != null) {
                if ($util.Long)
                    (m.code = $util.Long.fromValue(d.code)).unsigned = true;
                else if (typeof d.code === "string")
                    m.code = parseInt(d.code, 10);
                else if (typeof d.code === "number")
                    m.code = d.code;
                else if (typeof d.code === "object")
                    m.code = new $util.LongBits(d.code.low >>> 0, d.code.high >>> 0).toNumber(true);
            }
            if (d.text != null) {
                m.text = String(d.text);
            }
            return m;
        };

        ExitCode.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.code != null && m.hasOwnProperty("code")) {
                if (typeof m.code === "number")
                    d.code = o.longs === String ? String(m.code) : m.code;
                else
                    d.code = o.longs === String ? longToString(m.code, true) : o.longs === Number ? longToNumber(m.code, true) : m.code;
                if (o.oneofs)
                    d._code = "code";
            }
            if (m.text != null && m.hasOwnProperty("text")) {
                d.text = m.text;
                if (o.oneofs)
                    d._text = "text";
            }
            return d;
        };

        ExitCode.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ExitCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ExitCode";
        };

        return ExitCode;
    })();

    proto.ExternalBlobReference = (function() {

        function ExternalBlobReference(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ExternalBlobReference.prototype.mediaKey = null;
        ExternalBlobReference.prototype.directPath = null;
        ExternalBlobReference.prototype.handle = null;
        ExternalBlobReference.prototype.fileSizeBytes = null;
        ExternalBlobReference.prototype.fileSha256 = null;
        ExternalBlobReference.prototype.fileEncSha256 = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ExternalBlobReference.prototype, "_mediaKey", {
            get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ExternalBlobReference.prototype, "_directPath", {
            get: $util.oneOfGetter($oneOfFields = ["directPath"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ExternalBlobReference.prototype, "_handle", {
            get: $util.oneOfGetter($oneOfFields = ["handle"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ExternalBlobReference.prototype, "_fileSizeBytes", {
            get: $util.oneOfGetter($oneOfFields = ["fileSizeBytes"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ExternalBlobReference.prototype, "_fileSha256", {
            get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ExternalBlobReference.prototype, "_fileEncSha256", {
            get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ExternalBlobReference.create = function create(properties) {
            return new ExternalBlobReference(properties);
        };

        ExternalBlobReference.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                w.uint32(10).bytes(m.mediaKey);
            if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                w.uint32(18).string(m.directPath);
            if (m.handle != null && Object.hasOwnProperty.call(m, "handle"))
                w.uint32(26).string(m.handle);
            if (m.fileSizeBytes != null && Object.hasOwnProperty.call(m, "fileSizeBytes"))
                w.uint32(32).uint64(m.fileSizeBytes);
            if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                w.uint32(42).bytes(m.fileSha256);
            if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                w.uint32(50).bytes(m.fileEncSha256);
            return w;
        };

        ExternalBlobReference.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ExternalBlobReference();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.mediaKey = r.bytes();
                        break;
                    }
                case 2: {
                        m.directPath = r.string();
                        break;
                    }
                case 3: {
                        m.handle = r.string();
                        break;
                    }
                case 4: {
                        m.fileSizeBytes = r.uint64();
                        break;
                    }
                case 5: {
                        m.fileSha256 = r.bytes();
                        break;
                    }
                case 6: {
                        m.fileEncSha256 = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ExternalBlobReference.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ExternalBlobReference)
                return d;
            var m = new $root.proto.ExternalBlobReference();
            if (d.mediaKey != null) {
                if (typeof d.mediaKey === "string")
                    $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                else if (d.mediaKey.length >= 0)
                    m.mediaKey = d.mediaKey;
            }
            if (d.directPath != null) {
                m.directPath = String(d.directPath);
            }
            if (d.handle != null) {
                m.handle = String(d.handle);
            }
            if (d.fileSizeBytes != null) {
                if ($util.Long)
                    (m.fileSizeBytes = $util.Long.fromValue(d.fileSizeBytes)).unsigned = true;
                else if (typeof d.fileSizeBytes === "string")
                    m.fileSizeBytes = parseInt(d.fileSizeBytes, 10);
                else if (typeof d.fileSizeBytes === "number")
                    m.fileSizeBytes = d.fileSizeBytes;
                else if (typeof d.fileSizeBytes === "object")
                    m.fileSizeBytes = new $util.LongBits(d.fileSizeBytes.low >>> 0, d.fileSizeBytes.high >>> 0).toNumber(true);
            }
            if (d.fileSha256 != null) {
                if (typeof d.fileSha256 === "string")
                    $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                else if (d.fileSha256.length >= 0)
                    m.fileSha256 = d.fileSha256;
            }
            if (d.fileEncSha256 != null) {
                if (typeof d.fileEncSha256 === "string")
                    $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                else if (d.fileEncSha256.length >= 0)
                    m.fileEncSha256 = d.fileEncSha256;
            }
            return m;
        };

        ExternalBlobReference.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                if (o.oneofs)
                    d._mediaKey = "mediaKey";
            }
            if (m.directPath != null && m.hasOwnProperty("directPath")) {
                d.directPath = m.directPath;
                if (o.oneofs)
                    d._directPath = "directPath";
            }
            if (m.handle != null && m.hasOwnProperty("handle")) {
                d.handle = m.handle;
                if (o.oneofs)
                    d._handle = "handle";
            }
            if (m.fileSizeBytes != null && m.hasOwnProperty("fileSizeBytes")) {
                if (typeof m.fileSizeBytes === "number")
                    d.fileSizeBytes = o.longs === String ? String(m.fileSizeBytes) : m.fileSizeBytes;
                else
                    d.fileSizeBytes = o.longs === String ? longToString(m.fileSizeBytes, true) : o.longs === Number ? longToNumber(m.fileSizeBytes, true) : m.fileSizeBytes;
                if (o.oneofs)
                    d._fileSizeBytes = "fileSizeBytes";
            }
            if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                if (o.oneofs)
                    d._fileSha256 = "fileSha256";
            }
            if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                if (o.oneofs)
                    d._fileEncSha256 = "fileEncSha256";
            }
            return d;
        };

        ExternalBlobReference.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ExternalBlobReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ExternalBlobReference";
        };

        return ExternalBlobReference;
    })();

    proto.Field = (function() {

        function Field(p) {
            this.subfield = {};
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Field.prototype.minVersion = null;
        Field.prototype.maxVersion = null;
        Field.prototype.notReportableMinVersion = null;
        Field.prototype.isMessage = null;
        Field.prototype.subfield = $util.emptyObject;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Field.prototype, "_minVersion", {
            get: $util.oneOfGetter($oneOfFields = ["minVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Field.prototype, "_maxVersion", {
            get: $util.oneOfGetter($oneOfFields = ["maxVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Field.prototype, "_notReportableMinVersion", {
            get: $util.oneOfGetter($oneOfFields = ["notReportableMinVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Field.prototype, "_isMessage", {
            get: $util.oneOfGetter($oneOfFields = ["isMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Field.create = function create(properties) {
            return new Field(properties);
        };

        Field.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.minVersion != null && Object.hasOwnProperty.call(m, "minVersion"))
                w.uint32(8).uint32(m.minVersion);
            if (m.maxVersion != null && Object.hasOwnProperty.call(m, "maxVersion"))
                w.uint32(16).uint32(m.maxVersion);
            if (m.notReportableMinVersion != null && Object.hasOwnProperty.call(m, "notReportableMinVersion"))
                w.uint32(24).uint32(m.notReportableMinVersion);
            if (m.isMessage != null && Object.hasOwnProperty.call(m, "isMessage"))
                w.uint32(32).bool(m.isMessage);
            if (m.subfield != null && Object.hasOwnProperty.call(m, "subfield")) {
                for (var ks = Object.keys(m.subfield), i = 0; i < ks.length; ++i) {
                    w.uint32(42).fork().uint32(8).uint32(ks[i]);
                    $root.proto.Field.encode(m.subfield[ks[i]], w.uint32(18).fork()).ldelim().ldelim();
                }
            }
            return w;
        };

        Field.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Field(), k, value;
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.minVersion = r.uint32();
                        break;
                    }
                case 2: {
                        m.maxVersion = r.uint32();
                        break;
                    }
                case 3: {
                        m.notReportableMinVersion = r.uint32();
                        break;
                    }
                case 4: {
                        m.isMessage = r.bool();
                        break;
                    }
                case 5: {
                        if (m.subfield === $util.emptyObject)
                            m.subfield = {};
                        var c2 = r.uint32() + r.pos;
                        k = 0;
                        value = null;
                        while (r.pos < c2) {
                            var tag2 = r.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                k = r.uint32();
                                break;
                            case 2:
                                value = $root.proto.Field.decode(r, r.uint32());
                                break;
                            default:
                                r.skipType(tag2 & 7);
                                break;
                            }
                        }
                        m.subfield[k] = value;
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Field.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Field)
                return d;
            var m = new $root.proto.Field();
            if (d.minVersion != null) {
                m.minVersion = d.minVersion >>> 0;
            }
            if (d.maxVersion != null) {
                m.maxVersion = d.maxVersion >>> 0;
            }
            if (d.notReportableMinVersion != null) {
                m.notReportableMinVersion = d.notReportableMinVersion >>> 0;
            }
            if (d.isMessage != null) {
                m.isMessage = Boolean(d.isMessage);
            }
            if (d.subfield) {
                if (typeof d.subfield !== "object")
                    throw TypeError(".proto.Field.subfield: object expected");
                m.subfield = {};
                for (var ks = Object.keys(d.subfield), i = 0; i < ks.length; ++i) {
                    if (typeof d.subfield[ks[i]] !== "object")
                        throw TypeError(".proto.Field.subfield: object expected");
                    m.subfield[ks[i]] = $root.proto.Field.fromObject(d.subfield[ks[i]]);
                }
            }
            return m;
        };

        Field.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.objects || o.defaults) {
                d.subfield = {};
            }
            if (m.minVersion != null && m.hasOwnProperty("minVersion")) {
                d.minVersion = m.minVersion;
                if (o.oneofs)
                    d._minVersion = "minVersion";
            }
            if (m.maxVersion != null && m.hasOwnProperty("maxVersion")) {
                d.maxVersion = m.maxVersion;
                if (o.oneofs)
                    d._maxVersion = "maxVersion";
            }
            if (m.notReportableMinVersion != null && m.hasOwnProperty("notReportableMinVersion")) {
                d.notReportableMinVersion = m.notReportableMinVersion;
                if (o.oneofs)
                    d._notReportableMinVersion = "notReportableMinVersion";
            }
            if (m.isMessage != null && m.hasOwnProperty("isMessage")) {
                d.isMessage = m.isMessage;
                if (o.oneofs)
                    d._isMessage = "isMessage";
            }
            var ks2;
            if (m.subfield && (ks2 = Object.keys(m.subfield)).length) {
                d.subfield = {};
                for (var j = 0; j < ks2.length; ++j) {
                    d.subfield[ks2[j]] = $root.proto.Field.toObject(m.subfield[ks2[j]], o);
                }
            }
            return d;
        };

        Field.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Field";
        };

        return Field;
    })();

    proto.ForwardedAIBotMessageInfo = (function() {

        function ForwardedAIBotMessageInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ForwardedAIBotMessageInfo.prototype.botName = null;
        ForwardedAIBotMessageInfo.prototype.botJid = null;
        ForwardedAIBotMessageInfo.prototype.creatorName = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ForwardedAIBotMessageInfo.prototype, "_botName", {
            get: $util.oneOfGetter($oneOfFields = ["botName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ForwardedAIBotMessageInfo.prototype, "_botJid", {
            get: $util.oneOfGetter($oneOfFields = ["botJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ForwardedAIBotMessageInfo.prototype, "_creatorName", {
            get: $util.oneOfGetter($oneOfFields = ["creatorName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ForwardedAIBotMessageInfo.create = function create(properties) {
            return new ForwardedAIBotMessageInfo(properties);
        };

        ForwardedAIBotMessageInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.botName != null && Object.hasOwnProperty.call(m, "botName"))
                w.uint32(10).string(m.botName);
            if (m.botJid != null && Object.hasOwnProperty.call(m, "botJid"))
                w.uint32(18).string(m.botJid);
            if (m.creatorName != null && Object.hasOwnProperty.call(m, "creatorName"))
                w.uint32(26).string(m.creatorName);
            return w;
        };

        ForwardedAIBotMessageInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ForwardedAIBotMessageInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.botName = r.string();
                        break;
                    }
                case 2: {
                        m.botJid = r.string();
                        break;
                    }
                case 3: {
                        m.creatorName = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ForwardedAIBotMessageInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ForwardedAIBotMessageInfo)
                return d;
            var m = new $root.proto.ForwardedAIBotMessageInfo();
            if (d.botName != null) {
                m.botName = String(d.botName);
            }
            if (d.botJid != null) {
                m.botJid = String(d.botJid);
            }
            if (d.creatorName != null) {
                m.creatorName = String(d.creatorName);
            }
            return m;
        };

        ForwardedAIBotMessageInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.botName != null && m.hasOwnProperty("botName")) {
                d.botName = m.botName;
                if (o.oneofs)
                    d._botName = "botName";
            }
            if (m.botJid != null && m.hasOwnProperty("botJid")) {
                d.botJid = m.botJid;
                if (o.oneofs)
                    d._botJid = "botJid";
            }
            if (m.creatorName != null && m.hasOwnProperty("creatorName")) {
                d.creatorName = m.creatorName;
                if (o.oneofs)
                    d._creatorName = "creatorName";
            }
            return d;
        };

        ForwardedAIBotMessageInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ForwardedAIBotMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ForwardedAIBotMessageInfo";
        };

        return ForwardedAIBotMessageInfo;
    })();

    proto.GlobalSettings = (function() {

        function GlobalSettings(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        GlobalSettings.prototype.lightThemeWallpaper = null;
        GlobalSettings.prototype.mediaVisibility = null;
        GlobalSettings.prototype.darkThemeWallpaper = null;
        GlobalSettings.prototype.autoDownloadWiFi = null;
        GlobalSettings.prototype.autoDownloadCellular = null;
        GlobalSettings.prototype.autoDownloadRoaming = null;
        GlobalSettings.prototype.showIndividualNotificationsPreview = null;
        GlobalSettings.prototype.showGroupNotificationsPreview = null;
        GlobalSettings.prototype.disappearingModeDuration = null;
        GlobalSettings.prototype.disappearingModeTimestamp = null;
        GlobalSettings.prototype.avatarUserSettings = null;
        GlobalSettings.prototype.fontSize = null;
        GlobalSettings.prototype.securityNotifications = null;
        GlobalSettings.prototype.autoUnarchiveChats = null;
        GlobalSettings.prototype.videoQualityMode = null;
        GlobalSettings.prototype.photoQualityMode = null;
        GlobalSettings.prototype.individualNotificationSettings = null;
        GlobalSettings.prototype.groupNotificationSettings = null;
        GlobalSettings.prototype.chatLockSettings = null;
        GlobalSettings.prototype.chatDbLidMigrationTimestamp = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_lightThemeWallpaper", {
            get: $util.oneOfGetter($oneOfFields = ["lightThemeWallpaper"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_mediaVisibility", {
            get: $util.oneOfGetter($oneOfFields = ["mediaVisibility"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_darkThemeWallpaper", {
            get: $util.oneOfGetter($oneOfFields = ["darkThemeWallpaper"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_autoDownloadWiFi", {
            get: $util.oneOfGetter($oneOfFields = ["autoDownloadWiFi"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_autoDownloadCellular", {
            get: $util.oneOfGetter($oneOfFields = ["autoDownloadCellular"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_autoDownloadRoaming", {
            get: $util.oneOfGetter($oneOfFields = ["autoDownloadRoaming"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_showIndividualNotificationsPreview", {
            get: $util.oneOfGetter($oneOfFields = ["showIndividualNotificationsPreview"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_showGroupNotificationsPreview", {
            get: $util.oneOfGetter($oneOfFields = ["showGroupNotificationsPreview"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_disappearingModeDuration", {
            get: $util.oneOfGetter($oneOfFields = ["disappearingModeDuration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_disappearingModeTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["disappearingModeTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_avatarUserSettings", {
            get: $util.oneOfGetter($oneOfFields = ["avatarUserSettings"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_fontSize", {
            get: $util.oneOfGetter($oneOfFields = ["fontSize"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_securityNotifications", {
            get: $util.oneOfGetter($oneOfFields = ["securityNotifications"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_autoUnarchiveChats", {
            get: $util.oneOfGetter($oneOfFields = ["autoUnarchiveChats"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_videoQualityMode", {
            get: $util.oneOfGetter($oneOfFields = ["videoQualityMode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_photoQualityMode", {
            get: $util.oneOfGetter($oneOfFields = ["photoQualityMode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_individualNotificationSettings", {
            get: $util.oneOfGetter($oneOfFields = ["individualNotificationSettings"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_groupNotificationSettings", {
            get: $util.oneOfGetter($oneOfFields = ["groupNotificationSettings"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_chatLockSettings", {
            get: $util.oneOfGetter($oneOfFields = ["chatLockSettings"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GlobalSettings.prototype, "_chatDbLidMigrationTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["chatDbLidMigrationTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        GlobalSettings.create = function create(properties) {
            return new GlobalSettings(properties);
        };

        GlobalSettings.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.lightThemeWallpaper != null && Object.hasOwnProperty.call(m, "lightThemeWallpaper"))
                $root.proto.WallpaperSettings.encode(m.lightThemeWallpaper, w.uint32(10).fork()).ldelim();
            if (m.mediaVisibility != null && Object.hasOwnProperty.call(m, "mediaVisibility"))
                w.uint32(16).int32(m.mediaVisibility);
            if (m.darkThemeWallpaper != null && Object.hasOwnProperty.call(m, "darkThemeWallpaper"))
                $root.proto.WallpaperSettings.encode(m.darkThemeWallpaper, w.uint32(26).fork()).ldelim();
            if (m.autoDownloadWiFi != null && Object.hasOwnProperty.call(m, "autoDownloadWiFi"))
                $root.proto.AutoDownloadSettings.encode(m.autoDownloadWiFi, w.uint32(34).fork()).ldelim();
            if (m.autoDownloadCellular != null && Object.hasOwnProperty.call(m, "autoDownloadCellular"))
                $root.proto.AutoDownloadSettings.encode(m.autoDownloadCellular, w.uint32(42).fork()).ldelim();
            if (m.autoDownloadRoaming != null && Object.hasOwnProperty.call(m, "autoDownloadRoaming"))
                $root.proto.AutoDownloadSettings.encode(m.autoDownloadRoaming, w.uint32(50).fork()).ldelim();
            if (m.showIndividualNotificationsPreview != null && Object.hasOwnProperty.call(m, "showIndividualNotificationsPreview"))
                w.uint32(56).bool(m.showIndividualNotificationsPreview);
            if (m.showGroupNotificationsPreview != null && Object.hasOwnProperty.call(m, "showGroupNotificationsPreview"))
                w.uint32(64).bool(m.showGroupNotificationsPreview);
            if (m.disappearingModeDuration != null && Object.hasOwnProperty.call(m, "disappearingModeDuration"))
                w.uint32(72).int32(m.disappearingModeDuration);
            if (m.disappearingModeTimestamp != null && Object.hasOwnProperty.call(m, "disappearingModeTimestamp"))
                w.uint32(80).int64(m.disappearingModeTimestamp);
            if (m.avatarUserSettings != null && Object.hasOwnProperty.call(m, "avatarUserSettings"))
                $root.proto.AvatarUserSettings.encode(m.avatarUserSettings, w.uint32(90).fork()).ldelim();
            if (m.fontSize != null && Object.hasOwnProperty.call(m, "fontSize"))
                w.uint32(96).int32(m.fontSize);
            if (m.securityNotifications != null && Object.hasOwnProperty.call(m, "securityNotifications"))
                w.uint32(104).bool(m.securityNotifications);
            if (m.autoUnarchiveChats != null && Object.hasOwnProperty.call(m, "autoUnarchiveChats"))
                w.uint32(112).bool(m.autoUnarchiveChats);
            if (m.videoQualityMode != null && Object.hasOwnProperty.call(m, "videoQualityMode"))
                w.uint32(120).int32(m.videoQualityMode);
            if (m.photoQualityMode != null && Object.hasOwnProperty.call(m, "photoQualityMode"))
                w.uint32(128).int32(m.photoQualityMode);
            if (m.individualNotificationSettings != null && Object.hasOwnProperty.call(m, "individualNotificationSettings"))
                $root.proto.NotificationSettings.encode(m.individualNotificationSettings, w.uint32(138).fork()).ldelim();
            if (m.groupNotificationSettings != null && Object.hasOwnProperty.call(m, "groupNotificationSettings"))
                $root.proto.NotificationSettings.encode(m.groupNotificationSettings, w.uint32(146).fork()).ldelim();
            if (m.chatLockSettings != null && Object.hasOwnProperty.call(m, "chatLockSettings"))
                $root.proto.ChatLockSettings.encode(m.chatLockSettings, w.uint32(154).fork()).ldelim();
            if (m.chatDbLidMigrationTimestamp != null && Object.hasOwnProperty.call(m, "chatDbLidMigrationTimestamp"))
                w.uint32(160).int64(m.chatDbLidMigrationTimestamp);
            return w;
        };

        GlobalSettings.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.GlobalSettings();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.lightThemeWallpaper = $root.proto.WallpaperSettings.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.mediaVisibility = r.int32();
                        break;
                    }
                case 3: {
                        m.darkThemeWallpaper = $root.proto.WallpaperSettings.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.autoDownloadWiFi = $root.proto.AutoDownloadSettings.decode(r, r.uint32());
                        break;
                    }
                case 5: {
                        m.autoDownloadCellular = $root.proto.AutoDownloadSettings.decode(r, r.uint32());
                        break;
                    }
                case 6: {
                        m.autoDownloadRoaming = $root.proto.AutoDownloadSettings.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.showIndividualNotificationsPreview = r.bool();
                        break;
                    }
                case 8: {
                        m.showGroupNotificationsPreview = r.bool();
                        break;
                    }
                case 9: {
                        m.disappearingModeDuration = r.int32();
                        break;
                    }
                case 10: {
                        m.disappearingModeTimestamp = r.int64();
                        break;
                    }
                case 11: {
                        m.avatarUserSettings = $root.proto.AvatarUserSettings.decode(r, r.uint32());
                        break;
                    }
                case 12: {
                        m.fontSize = r.int32();
                        break;
                    }
                case 13: {
                        m.securityNotifications = r.bool();
                        break;
                    }
                case 14: {
                        m.autoUnarchiveChats = r.bool();
                        break;
                    }
                case 15: {
                        m.videoQualityMode = r.int32();
                        break;
                    }
                case 16: {
                        m.photoQualityMode = r.int32();
                        break;
                    }
                case 17: {
                        m.individualNotificationSettings = $root.proto.NotificationSettings.decode(r, r.uint32());
                        break;
                    }
                case 18: {
                        m.groupNotificationSettings = $root.proto.NotificationSettings.decode(r, r.uint32());
                        break;
                    }
                case 19: {
                        m.chatLockSettings = $root.proto.ChatLockSettings.decode(r, r.uint32());
                        break;
                    }
                case 20: {
                        m.chatDbLidMigrationTimestamp = r.int64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        GlobalSettings.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.GlobalSettings)
                return d;
            var m = new $root.proto.GlobalSettings();
            if (d.lightThemeWallpaper != null) {
                if (typeof d.lightThemeWallpaper !== "object")
                    throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected");
                m.lightThemeWallpaper = $root.proto.WallpaperSettings.fromObject(d.lightThemeWallpaper);
            }
            switch (d.mediaVisibility) {
            default:
                if (typeof d.mediaVisibility === "number") {
                    m.mediaVisibility = d.mediaVisibility;
                    break;
                }
                break;
            case "DEFAULT":
            case 0:
                m.mediaVisibility = 0;
                break;
            case "OFF":
            case 1:
                m.mediaVisibility = 1;
                break;
            case "ON":
            case 2:
                m.mediaVisibility = 2;
                break;
            }
            if (d.darkThemeWallpaper != null) {
                if (typeof d.darkThemeWallpaper !== "object")
                    throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected");
                m.darkThemeWallpaper = $root.proto.WallpaperSettings.fromObject(d.darkThemeWallpaper);
            }
            if (d.autoDownloadWiFi != null) {
                if (typeof d.autoDownloadWiFi !== "object")
                    throw TypeError(".proto.GlobalSettings.autoDownloadWiFi: object expected");
                m.autoDownloadWiFi = $root.proto.AutoDownloadSettings.fromObject(d.autoDownloadWiFi);
            }
            if (d.autoDownloadCellular != null) {
                if (typeof d.autoDownloadCellular !== "object")
                    throw TypeError(".proto.GlobalSettings.autoDownloadCellular: object expected");
                m.autoDownloadCellular = $root.proto.AutoDownloadSettings.fromObject(d.autoDownloadCellular);
            }
            if (d.autoDownloadRoaming != null) {
                if (typeof d.autoDownloadRoaming !== "object")
                    throw TypeError(".proto.GlobalSettings.autoDownloadRoaming: object expected");
                m.autoDownloadRoaming = $root.proto.AutoDownloadSettings.fromObject(d.autoDownloadRoaming);
            }
            if (d.showIndividualNotificationsPreview != null) {
                m.showIndividualNotificationsPreview = Boolean(d.showIndividualNotificationsPreview);
            }
            if (d.showGroupNotificationsPreview != null) {
                m.showGroupNotificationsPreview = Boolean(d.showGroupNotificationsPreview);
            }
            if (d.disappearingModeDuration != null) {
                m.disappearingModeDuration = d.disappearingModeDuration | 0;
            }
            if (d.disappearingModeTimestamp != null) {
                if ($util.Long)
                    (m.disappearingModeTimestamp = $util.Long.fromValue(d.disappearingModeTimestamp)).unsigned = false;
                else if (typeof d.disappearingModeTimestamp === "string")
                    m.disappearingModeTimestamp = parseInt(d.disappearingModeTimestamp, 10);
                else if (typeof d.disappearingModeTimestamp === "number")
                    m.disappearingModeTimestamp = d.disappearingModeTimestamp;
                else if (typeof d.disappearingModeTimestamp === "object")
                    m.disappearingModeTimestamp = new $util.LongBits(d.disappearingModeTimestamp.low >>> 0, d.disappearingModeTimestamp.high >>> 0).toNumber();
            }
            if (d.avatarUserSettings != null) {
                if (typeof d.avatarUserSettings !== "object")
                    throw TypeError(".proto.GlobalSettings.avatarUserSettings: object expected");
                m.avatarUserSettings = $root.proto.AvatarUserSettings.fromObject(d.avatarUserSettings);
            }
            if (d.fontSize != null) {
                m.fontSize = d.fontSize | 0;
            }
            if (d.securityNotifications != null) {
                m.securityNotifications = Boolean(d.securityNotifications);
            }
            if (d.autoUnarchiveChats != null) {
                m.autoUnarchiveChats = Boolean(d.autoUnarchiveChats);
            }
            if (d.videoQualityMode != null) {
                m.videoQualityMode = d.videoQualityMode | 0;
            }
            if (d.photoQualityMode != null) {
                m.photoQualityMode = d.photoQualityMode | 0;
            }
            if (d.individualNotificationSettings != null) {
                if (typeof d.individualNotificationSettings !== "object")
                    throw TypeError(".proto.GlobalSettings.individualNotificationSettings: object expected");
                m.individualNotificationSettings = $root.proto.NotificationSettings.fromObject(d.individualNotificationSettings);
            }
            if (d.groupNotificationSettings != null) {
                if (typeof d.groupNotificationSettings !== "object")
                    throw TypeError(".proto.GlobalSettings.groupNotificationSettings: object expected");
                m.groupNotificationSettings = $root.proto.NotificationSettings.fromObject(d.groupNotificationSettings);
            }
            if (d.chatLockSettings != null) {
                if (typeof d.chatLockSettings !== "object")
                    throw TypeError(".proto.GlobalSettings.chatLockSettings: object expected");
                m.chatLockSettings = $root.proto.ChatLockSettings.fromObject(d.chatLockSettings);
            }
            if (d.chatDbLidMigrationTimestamp != null) {
                if ($util.Long)
                    (m.chatDbLidMigrationTimestamp = $util.Long.fromValue(d.chatDbLidMigrationTimestamp)).unsigned = false;
                else if (typeof d.chatDbLidMigrationTimestamp === "string")
                    m.chatDbLidMigrationTimestamp = parseInt(d.chatDbLidMigrationTimestamp, 10);
                else if (typeof d.chatDbLidMigrationTimestamp === "number")
                    m.chatDbLidMigrationTimestamp = d.chatDbLidMigrationTimestamp;
                else if (typeof d.chatDbLidMigrationTimestamp === "object")
                    m.chatDbLidMigrationTimestamp = new $util.LongBits(d.chatDbLidMigrationTimestamp.low >>> 0, d.chatDbLidMigrationTimestamp.high >>> 0).toNumber();
            }
            return m;
        };

        GlobalSettings.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.lightThemeWallpaper != null && m.hasOwnProperty("lightThemeWallpaper")) {
                d.lightThemeWallpaper = $root.proto.WallpaperSettings.toObject(m.lightThemeWallpaper, o);
                if (o.oneofs)
                    d._lightThemeWallpaper = "lightThemeWallpaper";
            }
            if (m.mediaVisibility != null && m.hasOwnProperty("mediaVisibility")) {
                d.mediaVisibility = o.enums === String ? $root.proto.MediaVisibility[m.mediaVisibility] === undefined ? m.mediaVisibility : $root.proto.MediaVisibility[m.mediaVisibility] : m.mediaVisibility;
                if (o.oneofs)
                    d._mediaVisibility = "mediaVisibility";
            }
            if (m.darkThemeWallpaper != null && m.hasOwnProperty("darkThemeWallpaper")) {
                d.darkThemeWallpaper = $root.proto.WallpaperSettings.toObject(m.darkThemeWallpaper, o);
                if (o.oneofs)
                    d._darkThemeWallpaper = "darkThemeWallpaper";
            }
            if (m.autoDownloadWiFi != null && m.hasOwnProperty("autoDownloadWiFi")) {
                d.autoDownloadWiFi = $root.proto.AutoDownloadSettings.toObject(m.autoDownloadWiFi, o);
                if (o.oneofs)
                    d._autoDownloadWiFi = "autoDownloadWiFi";
            }
            if (m.autoDownloadCellular != null && m.hasOwnProperty("autoDownloadCellular")) {
                d.autoDownloadCellular = $root.proto.AutoDownloadSettings.toObject(m.autoDownloadCellular, o);
                if (o.oneofs)
                    d._autoDownloadCellular = "autoDownloadCellular";
            }
            if (m.autoDownloadRoaming != null && m.hasOwnProperty("autoDownloadRoaming")) {
                d.autoDownloadRoaming = $root.proto.AutoDownloadSettings.toObject(m.autoDownloadRoaming, o);
                if (o.oneofs)
                    d._autoDownloadRoaming = "autoDownloadRoaming";
            }
            if (m.showIndividualNotificationsPreview != null && m.hasOwnProperty("showIndividualNotificationsPreview")) {
                d.showIndividualNotificationsPreview = m.showIndividualNotificationsPreview;
                if (o.oneofs)
                    d._showIndividualNotificationsPreview = "showIndividualNotificationsPreview";
            }
            if (m.showGroupNotificationsPreview != null && m.hasOwnProperty("showGroupNotificationsPreview")) {
                d.showGroupNotificationsPreview = m.showGroupNotificationsPreview;
                if (o.oneofs)
                    d._showGroupNotificationsPreview = "showGroupNotificationsPreview";
            }
            if (m.disappearingModeDuration != null && m.hasOwnProperty("disappearingModeDuration")) {
                d.disappearingModeDuration = m.disappearingModeDuration;
                if (o.oneofs)
                    d._disappearingModeDuration = "disappearingModeDuration";
            }
            if (m.disappearingModeTimestamp != null && m.hasOwnProperty("disappearingModeTimestamp")) {
                if (typeof m.disappearingModeTimestamp === "number")
                    d.disappearingModeTimestamp = o.longs === String ? String(m.disappearingModeTimestamp) : m.disappearingModeTimestamp;
                else
                    d.disappearingModeTimestamp = o.longs === String ? longToString(m.disappearingModeTimestamp) : o.longs === Number ? longToNumber(m.disappearingModeTimestamp) : m.disappearingModeTimestamp;
                if (o.oneofs)
                    d._disappearingModeTimestamp = "disappearingModeTimestamp";
            }
            if (m.avatarUserSettings != null && m.hasOwnProperty("avatarUserSettings")) {
                d.avatarUserSettings = $root.proto.AvatarUserSettings.toObject(m.avatarUserSettings, o);
                if (o.oneofs)
                    d._avatarUserSettings = "avatarUserSettings";
            }
            if (m.fontSize != null && m.hasOwnProperty("fontSize")) {
                d.fontSize = m.fontSize;
                if (o.oneofs)
                    d._fontSize = "fontSize";
            }
            if (m.securityNotifications != null && m.hasOwnProperty("securityNotifications")) {
                d.securityNotifications = m.securityNotifications;
                if (o.oneofs)
                    d._securityNotifications = "securityNotifications";
            }
            if (m.autoUnarchiveChats != null && m.hasOwnProperty("autoUnarchiveChats")) {
                d.autoUnarchiveChats = m.autoUnarchiveChats;
                if (o.oneofs)
                    d._autoUnarchiveChats = "autoUnarchiveChats";
            }
            if (m.videoQualityMode != null && m.hasOwnProperty("videoQualityMode")) {
                d.videoQualityMode = m.videoQualityMode;
                if (o.oneofs)
                    d._videoQualityMode = "videoQualityMode";
            }
            if (m.photoQualityMode != null && m.hasOwnProperty("photoQualityMode")) {
                d.photoQualityMode = m.photoQualityMode;
                if (o.oneofs)
                    d._photoQualityMode = "photoQualityMode";
            }
            if (m.individualNotificationSettings != null && m.hasOwnProperty("individualNotificationSettings")) {
                d.individualNotificationSettings = $root.proto.NotificationSettings.toObject(m.individualNotificationSettings, o);
                if (o.oneofs)
                    d._individualNotificationSettings = "individualNotificationSettings";
            }
            if (m.groupNotificationSettings != null && m.hasOwnProperty("groupNotificationSettings")) {
                d.groupNotificationSettings = $root.proto.NotificationSettings.toObject(m.groupNotificationSettings, o);
                if (o.oneofs)
                    d._groupNotificationSettings = "groupNotificationSettings";
            }
            if (m.chatLockSettings != null && m.hasOwnProperty("chatLockSettings")) {
                d.chatLockSettings = $root.proto.ChatLockSettings.toObject(m.chatLockSettings, o);
                if (o.oneofs)
                    d._chatLockSettings = "chatLockSettings";
            }
            if (m.chatDbLidMigrationTimestamp != null && m.hasOwnProperty("chatDbLidMigrationTimestamp")) {
                if (typeof m.chatDbLidMigrationTimestamp === "number")
                    d.chatDbLidMigrationTimestamp = o.longs === String ? String(m.chatDbLidMigrationTimestamp) : m.chatDbLidMigrationTimestamp;
                else
                    d.chatDbLidMigrationTimestamp = o.longs === String ? longToString(m.chatDbLidMigrationTimestamp) : o.longs === Number ? longToNumber(m.chatDbLidMigrationTimestamp) : m.chatDbLidMigrationTimestamp;
                if (o.oneofs)
                    d._chatDbLidMigrationTimestamp = "chatDbLidMigrationTimestamp";
            }
            return d;
        };

        GlobalSettings.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        GlobalSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.GlobalSettings";
        };

        return GlobalSettings;
    })();

    proto.GroupHistoryBundleInfo = (function() {

        function GroupHistoryBundleInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        GroupHistoryBundleInfo.prototype.deprecatedMessageHistoryBundle = null;
        GroupHistoryBundleInfo.prototype.processState = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GroupHistoryBundleInfo.prototype, "_deprecatedMessageHistoryBundle", {
            get: $util.oneOfGetter($oneOfFields = ["deprecatedMessageHistoryBundle"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GroupHistoryBundleInfo.prototype, "_processState", {
            get: $util.oneOfGetter($oneOfFields = ["processState"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        GroupHistoryBundleInfo.create = function create(properties) {
            return new GroupHistoryBundleInfo(properties);
        };

        GroupHistoryBundleInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.deprecatedMessageHistoryBundle != null && Object.hasOwnProperty.call(m, "deprecatedMessageHistoryBundle"))
                $root.proto.Message.MessageHistoryBundle.encode(m.deprecatedMessageHistoryBundle, w.uint32(10).fork()).ldelim();
            if (m.processState != null && Object.hasOwnProperty.call(m, "processState"))
                w.uint32(16).int32(m.processState);
            return w;
        };

        GroupHistoryBundleInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.GroupHistoryBundleInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.deprecatedMessageHistoryBundle = $root.proto.Message.MessageHistoryBundle.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.processState = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        GroupHistoryBundleInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.GroupHistoryBundleInfo)
                return d;
            var m = new $root.proto.GroupHistoryBundleInfo();
            if (d.deprecatedMessageHistoryBundle != null) {
                if (typeof d.deprecatedMessageHistoryBundle !== "object")
                    throw TypeError(".proto.GroupHistoryBundleInfo.deprecatedMessageHistoryBundle: object expected");
                m.deprecatedMessageHistoryBundle = $root.proto.Message.MessageHistoryBundle.fromObject(d.deprecatedMessageHistoryBundle);
            }
            switch (d.processState) {
            default:
                if (typeof d.processState === "number") {
                    m.processState = d.processState;
                    break;
                }
                break;
            case "NOT_INJECTED":
            case 0:
                m.processState = 0;
                break;
            case "INJECTED":
            case 1:
                m.processState = 1;
                break;
            case "INJECTED_PARTIAL":
            case 2:
                m.processState = 2;
                break;
            case "INJECTION_FAILED":
            case 3:
                m.processState = 3;
                break;
            case "INJECTION_FAILED_NO_RETRY":
            case 4:
                m.processState = 4;
                break;
            }
            return m;
        };

        GroupHistoryBundleInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.deprecatedMessageHistoryBundle != null && m.hasOwnProperty("deprecatedMessageHistoryBundle")) {
                d.deprecatedMessageHistoryBundle = $root.proto.Message.MessageHistoryBundle.toObject(m.deprecatedMessageHistoryBundle, o);
                if (o.oneofs)
                    d._deprecatedMessageHistoryBundle = "deprecatedMessageHistoryBundle";
            }
            if (m.processState != null && m.hasOwnProperty("processState")) {
                d.processState = o.enums === String ? $root.proto.GroupHistoryBundleInfo.ProcessState[m.processState] === undefined ? m.processState : $root.proto.GroupHistoryBundleInfo.ProcessState[m.processState] : m.processState;
                if (o.oneofs)
                    d._processState = "processState";
            }
            return d;
        };

        GroupHistoryBundleInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        GroupHistoryBundleInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.GroupHistoryBundleInfo";
        };

        GroupHistoryBundleInfo.ProcessState = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "NOT_INJECTED"] = 0;
            values[valuesById[1] = "INJECTED"] = 1;
            values[valuesById[2] = "INJECTED_PARTIAL"] = 2;
            values[valuesById[3] = "INJECTION_FAILED"] = 3;
            values[valuesById[4] = "INJECTION_FAILED_NO_RETRY"] = 4;
            return values;
        })();

        return GroupHistoryBundleInfo;
    })();

    proto.GroupHistoryIndividualMessageInfo = (function() {

        function GroupHistoryIndividualMessageInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        GroupHistoryIndividualMessageInfo.prototype.bundleMessageKey = null;
        GroupHistoryIndividualMessageInfo.prototype.editedAfterReceivedAsHistory = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GroupHistoryIndividualMessageInfo.prototype, "_bundleMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["bundleMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GroupHistoryIndividualMessageInfo.prototype, "_editedAfterReceivedAsHistory", {
            get: $util.oneOfGetter($oneOfFields = ["editedAfterReceivedAsHistory"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        GroupHistoryIndividualMessageInfo.create = function create(properties) {
            return new GroupHistoryIndividualMessageInfo(properties);
        };

        GroupHistoryIndividualMessageInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.bundleMessageKey != null && Object.hasOwnProperty.call(m, "bundleMessageKey"))
                $root.proto.MessageKey.encode(m.bundleMessageKey, w.uint32(10).fork()).ldelim();
            if (m.editedAfterReceivedAsHistory != null && Object.hasOwnProperty.call(m, "editedAfterReceivedAsHistory"))
                w.uint32(16).bool(m.editedAfterReceivedAsHistory);
            return w;
        };

        GroupHistoryIndividualMessageInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.GroupHistoryIndividualMessageInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.bundleMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.editedAfterReceivedAsHistory = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        GroupHistoryIndividualMessageInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.GroupHistoryIndividualMessageInfo)
                return d;
            var m = new $root.proto.GroupHistoryIndividualMessageInfo();
            if (d.bundleMessageKey != null) {
                if (typeof d.bundleMessageKey !== "object")
                    throw TypeError(".proto.GroupHistoryIndividualMessageInfo.bundleMessageKey: object expected");
                m.bundleMessageKey = $root.proto.MessageKey.fromObject(d.bundleMessageKey);
            }
            if (d.editedAfterReceivedAsHistory != null) {
                m.editedAfterReceivedAsHistory = Boolean(d.editedAfterReceivedAsHistory);
            }
            return m;
        };

        GroupHistoryIndividualMessageInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.bundleMessageKey != null && m.hasOwnProperty("bundleMessageKey")) {
                d.bundleMessageKey = $root.proto.MessageKey.toObject(m.bundleMessageKey, o);
                if (o.oneofs)
                    d._bundleMessageKey = "bundleMessageKey";
            }
            if (m.editedAfterReceivedAsHistory != null && m.hasOwnProperty("editedAfterReceivedAsHistory")) {
                d.editedAfterReceivedAsHistory = m.editedAfterReceivedAsHistory;
                if (o.oneofs)
                    d._editedAfterReceivedAsHistory = "editedAfterReceivedAsHistory";
            }
            return d;
        };

        GroupHistoryIndividualMessageInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        GroupHistoryIndividualMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.GroupHistoryIndividualMessageInfo";
        };

        return GroupHistoryIndividualMessageInfo;
    })();

    proto.GroupMention = (function() {

        function GroupMention(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        GroupMention.prototype.groupJid = null;
        GroupMention.prototype.groupSubject = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GroupMention.prototype, "_groupJid", {
            get: $util.oneOfGetter($oneOfFields = ["groupJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GroupMention.prototype, "_groupSubject", {
            get: $util.oneOfGetter($oneOfFields = ["groupSubject"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        GroupMention.create = function create(properties) {
            return new GroupMention(properties);
        };

        GroupMention.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.groupJid != null && Object.hasOwnProperty.call(m, "groupJid"))
                w.uint32(10).string(m.groupJid);
            if (m.groupSubject != null && Object.hasOwnProperty.call(m, "groupSubject"))
                w.uint32(18).string(m.groupSubject);
            return w;
        };

        GroupMention.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.GroupMention();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.groupJid = r.string();
                        break;
                    }
                case 2: {
                        m.groupSubject = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        GroupMention.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.GroupMention)
                return d;
            var m = new $root.proto.GroupMention();
            if (d.groupJid != null) {
                m.groupJid = String(d.groupJid);
            }
            if (d.groupSubject != null) {
                m.groupSubject = String(d.groupSubject);
            }
            return m;
        };

        GroupMention.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.groupJid != null && m.hasOwnProperty("groupJid")) {
                d.groupJid = m.groupJid;
                if (o.oneofs)
                    d._groupJid = "groupJid";
            }
            if (m.groupSubject != null && m.hasOwnProperty("groupSubject")) {
                d.groupSubject = m.groupSubject;
                if (o.oneofs)
                    d._groupSubject = "groupSubject";
            }
            return d;
        };

        GroupMention.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        GroupMention.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.GroupMention";
        };

        return GroupMention;
    })();

    proto.GroupParticipant = (function() {

        function GroupParticipant(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        GroupParticipant.prototype.userJid = "";
        GroupParticipant.prototype.rank = null;
        GroupParticipant.prototype.memberLabel = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GroupParticipant.prototype, "_rank", {
            get: $util.oneOfGetter($oneOfFields = ["rank"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(GroupParticipant.prototype, "_memberLabel", {
            get: $util.oneOfGetter($oneOfFields = ["memberLabel"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        GroupParticipant.create = function create(properties) {
            return new GroupParticipant(properties);
        };

        GroupParticipant.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.userJid != null && Object.hasOwnProperty.call(m, "userJid"))
                w.uint32(10).string(m.userJid);
            if (m.rank != null && Object.hasOwnProperty.call(m, "rank"))
                w.uint32(16).int32(m.rank);
            if (m.memberLabel != null && Object.hasOwnProperty.call(m, "memberLabel"))
                $root.proto.MemberLabel.encode(m.memberLabel, w.uint32(26).fork()).ldelim();
            return w;
        };

        GroupParticipant.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.GroupParticipant();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.userJid = r.string();
                        break;
                    }
                case 2: {
                        m.rank = r.int32();
                        break;
                    }
                case 3: {
                        m.memberLabel = $root.proto.MemberLabel.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        GroupParticipant.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.GroupParticipant)
                return d;
            var m = new $root.proto.GroupParticipant();
            if (d.userJid != null) {
                m.userJid = String(d.userJid);
            }
            switch (d.rank) {
            default:
                if (typeof d.rank === "number") {
                    m.rank = d.rank;
                    break;
                }
                break;
            case "REGULAR":
            case 0:
                m.rank = 0;
                break;
            case "ADMIN":
            case 1:
                m.rank = 1;
                break;
            case "SUPERADMIN":
            case 2:
                m.rank = 2;
                break;
            }
            if (d.memberLabel != null) {
                if (typeof d.memberLabel !== "object")
                    throw TypeError(".proto.GroupParticipant.memberLabel: object expected");
                m.memberLabel = $root.proto.MemberLabel.fromObject(d.memberLabel);
            }
            return m;
        };

        GroupParticipant.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                d.userJid = "";
            }
            if (m.userJid != null && m.hasOwnProperty("userJid")) {
                d.userJid = m.userJid;
            }
            if (m.rank != null && m.hasOwnProperty("rank")) {
                d.rank = o.enums === String ? $root.proto.GroupParticipant.Rank[m.rank] === undefined ? m.rank : $root.proto.GroupParticipant.Rank[m.rank] : m.rank;
                if (o.oneofs)
                    d._rank = "rank";
            }
            if (m.memberLabel != null && m.hasOwnProperty("memberLabel")) {
                d.memberLabel = $root.proto.MemberLabel.toObject(m.memberLabel, o);
                if (o.oneofs)
                    d._memberLabel = "memberLabel";
            }
            return d;
        };

        GroupParticipant.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        GroupParticipant.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.GroupParticipant";
        };

        GroupParticipant.Rank = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "REGULAR"] = 0;
            values[valuesById[1] = "ADMIN"] = 1;
            values[valuesById[2] = "SUPERADMIN"] = 2;
            return values;
        })();

        return GroupParticipant;
    })();

    proto.HandshakeMessage = (function() {

        function HandshakeMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        HandshakeMessage.prototype.clientHello = null;
        HandshakeMessage.prototype.serverHello = null;
        HandshakeMessage.prototype.clientFinish = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HandshakeMessage.prototype, "_clientHello", {
            get: $util.oneOfGetter($oneOfFields = ["clientHello"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HandshakeMessage.prototype, "_serverHello", {
            get: $util.oneOfGetter($oneOfFields = ["serverHello"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HandshakeMessage.prototype, "_clientFinish", {
            get: $util.oneOfGetter($oneOfFields = ["clientFinish"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        HandshakeMessage.create = function create(properties) {
            return new HandshakeMessage(properties);
        };

        HandshakeMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.clientHello != null && Object.hasOwnProperty.call(m, "clientHello"))
                $root.proto.HandshakeMessage.ClientHello.encode(m.clientHello, w.uint32(18).fork()).ldelim();
            if (m.serverHello != null && Object.hasOwnProperty.call(m, "serverHello"))
                $root.proto.HandshakeMessage.ServerHello.encode(m.serverHello, w.uint32(26).fork()).ldelim();
            if (m.clientFinish != null && Object.hasOwnProperty.call(m, "clientFinish"))
                $root.proto.HandshakeMessage.ClientFinish.encode(m.clientFinish, w.uint32(34).fork()).ldelim();
            return w;
        };

        HandshakeMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HandshakeMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 2: {
                        m.clientHello = $root.proto.HandshakeMessage.ClientHello.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.serverHello = $root.proto.HandshakeMessage.ServerHello.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.clientFinish = $root.proto.HandshakeMessage.ClientFinish.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        HandshakeMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.HandshakeMessage)
                return d;
            var m = new $root.proto.HandshakeMessage();
            if (d.clientHello != null) {
                if (typeof d.clientHello !== "object")
                    throw TypeError(".proto.HandshakeMessage.clientHello: object expected");
                m.clientHello = $root.proto.HandshakeMessage.ClientHello.fromObject(d.clientHello);
            }
            if (d.serverHello != null) {
                if (typeof d.serverHello !== "object")
                    throw TypeError(".proto.HandshakeMessage.serverHello: object expected");
                m.serverHello = $root.proto.HandshakeMessage.ServerHello.fromObject(d.serverHello);
            }
            if (d.clientFinish != null) {
                if (typeof d.clientFinish !== "object")
                    throw TypeError(".proto.HandshakeMessage.clientFinish: object expected");
                m.clientFinish = $root.proto.HandshakeMessage.ClientFinish.fromObject(d.clientFinish);
            }
            return m;
        };

        HandshakeMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.clientHello != null && m.hasOwnProperty("clientHello")) {
                d.clientHello = $root.proto.HandshakeMessage.ClientHello.toObject(m.clientHello, o);
                if (o.oneofs)
                    d._clientHello = "clientHello";
            }
            if (m.serverHello != null && m.hasOwnProperty("serverHello")) {
                d.serverHello = $root.proto.HandshakeMessage.ServerHello.toObject(m.serverHello, o);
                if (o.oneofs)
                    d._serverHello = "serverHello";
            }
            if (m.clientFinish != null && m.hasOwnProperty("clientFinish")) {
                d.clientFinish = $root.proto.HandshakeMessage.ClientFinish.toObject(m.clientFinish, o);
                if (o.oneofs)
                    d._clientFinish = "clientFinish";
            }
            return d;
        };

        HandshakeMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        HandshakeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.HandshakeMessage";
        };

        HandshakeMessage.ClientFinish = (function() {

            function ClientFinish(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ClientFinish.prototype["static"] = null;
            ClientFinish.prototype.payload = null;
            ClientFinish.prototype.extendedCiphertext = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClientFinish.prototype, "_static", {
                get: $util.oneOfGetter($oneOfFields = ["static"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClientFinish.prototype, "_payload", {
                get: $util.oneOfGetter($oneOfFields = ["payload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClientFinish.prototype, "_extendedCiphertext", {
                get: $util.oneOfGetter($oneOfFields = ["extendedCiphertext"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ClientFinish.create = function create(properties) {
                return new ClientFinish(properties);
            };

            ClientFinish.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m["static"] != null && Object.hasOwnProperty.call(m, "static"))
                    w.uint32(10).bytes(m["static"]);
                if (m.payload != null && Object.hasOwnProperty.call(m, "payload"))
                    w.uint32(18).bytes(m.payload);
                if (m.extendedCiphertext != null && Object.hasOwnProperty.call(m, "extendedCiphertext"))
                    w.uint32(26).bytes(m.extendedCiphertext);
                return w;
            };

            ClientFinish.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HandshakeMessage.ClientFinish();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m["static"] = r.bytes();
                            break;
                        }
                    case 2: {
                            m.payload = r.bytes();
                            break;
                        }
                    case 3: {
                            m.extendedCiphertext = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ClientFinish.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.HandshakeMessage.ClientFinish)
                    return d;
                var m = new $root.proto.HandshakeMessage.ClientFinish();
                if (d["static"] != null) {
                    if (typeof d["static"] === "string")
                        $util.base64.decode(d["static"], m["static"] = $util.newBuffer($util.base64.length(d["static"])), 0);
                    else if (d["static"].length >= 0)
                        m["static"] = d["static"];
                }
                if (d.payload != null) {
                    if (typeof d.payload === "string")
                        $util.base64.decode(d.payload, m.payload = $util.newBuffer($util.base64.length(d.payload)), 0);
                    else if (d.payload.length >= 0)
                        m.payload = d.payload;
                }
                if (d.extendedCiphertext != null) {
                    if (typeof d.extendedCiphertext === "string")
                        $util.base64.decode(d.extendedCiphertext, m.extendedCiphertext = $util.newBuffer($util.base64.length(d.extendedCiphertext)), 0);
                    else if (d.extendedCiphertext.length >= 0)
                        m.extendedCiphertext = d.extendedCiphertext;
                }
                return m;
            };

            ClientFinish.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m["static"] != null && m.hasOwnProperty("static")) {
                    d["static"] = o.bytes === String ? $util.base64.encode(m["static"], 0, m["static"].length) : o.bytes === Array ? Array.prototype.slice.call(m["static"]) : m["static"];
                    if (o.oneofs)
                        d._static = "static";
                }
                if (m.payload != null && m.hasOwnProperty("payload")) {
                    d.payload = o.bytes === String ? $util.base64.encode(m.payload, 0, m.payload.length) : o.bytes === Array ? Array.prototype.slice.call(m.payload) : m.payload;
                    if (o.oneofs)
                        d._payload = "payload";
                }
                if (m.extendedCiphertext != null && m.hasOwnProperty("extendedCiphertext")) {
                    d.extendedCiphertext = o.bytes === String ? $util.base64.encode(m.extendedCiphertext, 0, m.extendedCiphertext.length) : o.bytes === Array ? Array.prototype.slice.call(m.extendedCiphertext) : m.extendedCiphertext;
                    if (o.oneofs)
                        d._extendedCiphertext = "extendedCiphertext";
                }
                return d;
            };

            ClientFinish.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ClientFinish.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.HandshakeMessage.ClientFinish";
            };

            return ClientFinish;
        })();

        HandshakeMessage.ClientHello = (function() {

            function ClientHello(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ClientHello.prototype.ephemeral = null;
            ClientHello.prototype["static"] = null;
            ClientHello.prototype.payload = null;
            ClientHello.prototype.useExtended = null;
            ClientHello.prototype.extendedCiphertext = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClientHello.prototype, "_ephemeral", {
                get: $util.oneOfGetter($oneOfFields = ["ephemeral"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClientHello.prototype, "_static", {
                get: $util.oneOfGetter($oneOfFields = ["static"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClientHello.prototype, "_payload", {
                get: $util.oneOfGetter($oneOfFields = ["payload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClientHello.prototype, "_useExtended", {
                get: $util.oneOfGetter($oneOfFields = ["useExtended"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClientHello.prototype, "_extendedCiphertext", {
                get: $util.oneOfGetter($oneOfFields = ["extendedCiphertext"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ClientHello.create = function create(properties) {
                return new ClientHello(properties);
            };

            ClientHello.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.ephemeral != null && Object.hasOwnProperty.call(m, "ephemeral"))
                    w.uint32(10).bytes(m.ephemeral);
                if (m["static"] != null && Object.hasOwnProperty.call(m, "static"))
                    w.uint32(18).bytes(m["static"]);
                if (m.payload != null && Object.hasOwnProperty.call(m, "payload"))
                    w.uint32(26).bytes(m.payload);
                if (m.useExtended != null && Object.hasOwnProperty.call(m, "useExtended"))
                    w.uint32(32).bool(m.useExtended);
                if (m.extendedCiphertext != null && Object.hasOwnProperty.call(m, "extendedCiphertext"))
                    w.uint32(42).bytes(m.extendedCiphertext);
                return w;
            };

            ClientHello.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HandshakeMessage.ClientHello();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.ephemeral = r.bytes();
                            break;
                        }
                    case 2: {
                            m["static"] = r.bytes();
                            break;
                        }
                    case 3: {
                            m.payload = r.bytes();
                            break;
                        }
                    case 4: {
                            m.useExtended = r.bool();
                            break;
                        }
                    case 5: {
                            m.extendedCiphertext = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ClientHello.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.HandshakeMessage.ClientHello)
                    return d;
                var m = new $root.proto.HandshakeMessage.ClientHello();
                if (d.ephemeral != null) {
                    if (typeof d.ephemeral === "string")
                        $util.base64.decode(d.ephemeral, m.ephemeral = $util.newBuffer($util.base64.length(d.ephemeral)), 0);
                    else if (d.ephemeral.length >= 0)
                        m.ephemeral = d.ephemeral;
                }
                if (d["static"] != null) {
                    if (typeof d["static"] === "string")
                        $util.base64.decode(d["static"], m["static"] = $util.newBuffer($util.base64.length(d["static"])), 0);
                    else if (d["static"].length >= 0)
                        m["static"] = d["static"];
                }
                if (d.payload != null) {
                    if (typeof d.payload === "string")
                        $util.base64.decode(d.payload, m.payload = $util.newBuffer($util.base64.length(d.payload)), 0);
                    else if (d.payload.length >= 0)
                        m.payload = d.payload;
                }
                if (d.useExtended != null) {
                    m.useExtended = Boolean(d.useExtended);
                }
                if (d.extendedCiphertext != null) {
                    if (typeof d.extendedCiphertext === "string")
                        $util.base64.decode(d.extendedCiphertext, m.extendedCiphertext = $util.newBuffer($util.base64.length(d.extendedCiphertext)), 0);
                    else if (d.extendedCiphertext.length >= 0)
                        m.extendedCiphertext = d.extendedCiphertext;
                }
                return m;
            };

            ClientHello.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.ephemeral != null && m.hasOwnProperty("ephemeral")) {
                    d.ephemeral = o.bytes === String ? $util.base64.encode(m.ephemeral, 0, m.ephemeral.length) : o.bytes === Array ? Array.prototype.slice.call(m.ephemeral) : m.ephemeral;
                    if (o.oneofs)
                        d._ephemeral = "ephemeral";
                }
                if (m["static"] != null && m.hasOwnProperty("static")) {
                    d["static"] = o.bytes === String ? $util.base64.encode(m["static"], 0, m["static"].length) : o.bytes === Array ? Array.prototype.slice.call(m["static"]) : m["static"];
                    if (o.oneofs)
                        d._static = "static";
                }
                if (m.payload != null && m.hasOwnProperty("payload")) {
                    d.payload = o.bytes === String ? $util.base64.encode(m.payload, 0, m.payload.length) : o.bytes === Array ? Array.prototype.slice.call(m.payload) : m.payload;
                    if (o.oneofs)
                        d._payload = "payload";
                }
                if (m.useExtended != null && m.hasOwnProperty("useExtended")) {
                    d.useExtended = m.useExtended;
                    if (o.oneofs)
                        d._useExtended = "useExtended";
                }
                if (m.extendedCiphertext != null && m.hasOwnProperty("extendedCiphertext")) {
                    d.extendedCiphertext = o.bytes === String ? $util.base64.encode(m.extendedCiphertext, 0, m.extendedCiphertext.length) : o.bytes === Array ? Array.prototype.slice.call(m.extendedCiphertext) : m.extendedCiphertext;
                    if (o.oneofs)
                        d._extendedCiphertext = "extendedCiphertext";
                }
                return d;
            };

            ClientHello.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ClientHello.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.HandshakeMessage.ClientHello";
            };

            return ClientHello;
        })();

        HandshakeMessage.ServerHello = (function() {

            function ServerHello(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ServerHello.prototype.ephemeral = null;
            ServerHello.prototype["static"] = null;
            ServerHello.prototype.payload = null;
            ServerHello.prototype.extendedStatic = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ServerHello.prototype, "_ephemeral", {
                get: $util.oneOfGetter($oneOfFields = ["ephemeral"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ServerHello.prototype, "_static", {
                get: $util.oneOfGetter($oneOfFields = ["static"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ServerHello.prototype, "_payload", {
                get: $util.oneOfGetter($oneOfFields = ["payload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ServerHello.prototype, "_extendedStatic", {
                get: $util.oneOfGetter($oneOfFields = ["extendedStatic"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ServerHello.create = function create(properties) {
                return new ServerHello(properties);
            };

            ServerHello.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.ephemeral != null && Object.hasOwnProperty.call(m, "ephemeral"))
                    w.uint32(10).bytes(m.ephemeral);
                if (m["static"] != null && Object.hasOwnProperty.call(m, "static"))
                    w.uint32(18).bytes(m["static"]);
                if (m.payload != null && Object.hasOwnProperty.call(m, "payload"))
                    w.uint32(26).bytes(m.payload);
                if (m.extendedStatic != null && Object.hasOwnProperty.call(m, "extendedStatic"))
                    w.uint32(34).bytes(m.extendedStatic);
                return w;
            };

            ServerHello.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HandshakeMessage.ServerHello();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.ephemeral = r.bytes();
                            break;
                        }
                    case 2: {
                            m["static"] = r.bytes();
                            break;
                        }
                    case 3: {
                            m.payload = r.bytes();
                            break;
                        }
                    case 4: {
                            m.extendedStatic = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ServerHello.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.HandshakeMessage.ServerHello)
                    return d;
                var m = new $root.proto.HandshakeMessage.ServerHello();
                if (d.ephemeral != null) {
                    if (typeof d.ephemeral === "string")
                        $util.base64.decode(d.ephemeral, m.ephemeral = $util.newBuffer($util.base64.length(d.ephemeral)), 0);
                    else if (d.ephemeral.length >= 0)
                        m.ephemeral = d.ephemeral;
                }
                if (d["static"] != null) {
                    if (typeof d["static"] === "string")
                        $util.base64.decode(d["static"], m["static"] = $util.newBuffer($util.base64.length(d["static"])), 0);
                    else if (d["static"].length >= 0)
                        m["static"] = d["static"];
                }
                if (d.payload != null) {
                    if (typeof d.payload === "string")
                        $util.base64.decode(d.payload, m.payload = $util.newBuffer($util.base64.length(d.payload)), 0);
                    else if (d.payload.length >= 0)
                        m.payload = d.payload;
                }
                if (d.extendedStatic != null) {
                    if (typeof d.extendedStatic === "string")
                        $util.base64.decode(d.extendedStatic, m.extendedStatic = $util.newBuffer($util.base64.length(d.extendedStatic)), 0);
                    else if (d.extendedStatic.length >= 0)
                        m.extendedStatic = d.extendedStatic;
                }
                return m;
            };

            ServerHello.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.ephemeral != null && m.hasOwnProperty("ephemeral")) {
                    d.ephemeral = o.bytes === String ? $util.base64.encode(m.ephemeral, 0, m.ephemeral.length) : o.bytes === Array ? Array.prototype.slice.call(m.ephemeral) : m.ephemeral;
                    if (o.oneofs)
                        d._ephemeral = "ephemeral";
                }
                if (m["static"] != null && m.hasOwnProperty("static")) {
                    d["static"] = o.bytes === String ? $util.base64.encode(m["static"], 0, m["static"].length) : o.bytes === Array ? Array.prototype.slice.call(m["static"]) : m["static"];
                    if (o.oneofs)
                        d._static = "static";
                }
                if (m.payload != null && m.hasOwnProperty("payload")) {
                    d.payload = o.bytes === String ? $util.base64.encode(m.payload, 0, m.payload.length) : o.bytes === Array ? Array.prototype.slice.call(m.payload) : m.payload;
                    if (o.oneofs)
                        d._payload = "payload";
                }
                if (m.extendedStatic != null && m.hasOwnProperty("extendedStatic")) {
                    d.extendedStatic = o.bytes === String ? $util.base64.encode(m.extendedStatic, 0, m.extendedStatic.length) : o.bytes === Array ? Array.prototype.slice.call(m.extendedStatic) : m.extendedStatic;
                    if (o.oneofs)
                        d._extendedStatic = "extendedStatic";
                }
                return d;
            };

            ServerHello.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ServerHello.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.HandshakeMessage.ServerHello";
            };

            return ServerHello;
        })();

        return HandshakeMessage;
    })();

    proto.HistorySync = (function() {

        function HistorySync(p) {
            this.conversations = [];
            this.statusV3Messages = [];
            this.pushnames = [];
            this.recentStickers = [];
            this.pastParticipants = [];
            this.callLogRecords = [];
            this.phoneNumberToLidMappings = [];
            this.accounts = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        HistorySync.prototype.syncType = 0;
        HistorySync.prototype.conversations = $util.emptyArray;
        HistorySync.prototype.statusV3Messages = $util.emptyArray;
        HistorySync.prototype.chunkOrder = null;
        HistorySync.prototype.progress = null;
        HistorySync.prototype.pushnames = $util.emptyArray;
        HistorySync.prototype.globalSettings = null;
        HistorySync.prototype.threadIdUserSecret = null;
        HistorySync.prototype.threadDsTimeframeOffset = null;
        HistorySync.prototype.recentStickers = $util.emptyArray;
        HistorySync.prototype.pastParticipants = $util.emptyArray;
        HistorySync.prototype.callLogRecords = $util.emptyArray;
        HistorySync.prototype.aiWaitListState = null;
        HistorySync.prototype.phoneNumberToLidMappings = $util.emptyArray;
        HistorySync.prototype.companionMetaNonce = null;
        HistorySync.prototype.shareableChatIdentifierEncryptionKey = null;
        HistorySync.prototype.accounts = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySync.prototype, "_chunkOrder", {
            get: $util.oneOfGetter($oneOfFields = ["chunkOrder"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySync.prototype, "_progress", {
            get: $util.oneOfGetter($oneOfFields = ["progress"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySync.prototype, "_globalSettings", {
            get: $util.oneOfGetter($oneOfFields = ["globalSettings"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySync.prototype, "_threadIdUserSecret", {
            get: $util.oneOfGetter($oneOfFields = ["threadIdUserSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySync.prototype, "_threadDsTimeframeOffset", {
            get: $util.oneOfGetter($oneOfFields = ["threadDsTimeframeOffset"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySync.prototype, "_aiWaitListState", {
            get: $util.oneOfGetter($oneOfFields = ["aiWaitListState"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySync.prototype, "_companionMetaNonce", {
            get: $util.oneOfGetter($oneOfFields = ["companionMetaNonce"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySync.prototype, "_shareableChatIdentifierEncryptionKey", {
            get: $util.oneOfGetter($oneOfFields = ["shareableChatIdentifierEncryptionKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        HistorySync.create = function create(properties) {
            return new HistorySync(properties);
        };

        HistorySync.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.syncType != null && Object.hasOwnProperty.call(m, "syncType"))
                w.uint32(8).int32(m.syncType);
            if (m.conversations != null && m.conversations.length) {
                for (var i = 0; i < m.conversations.length; ++i)
                    $root.proto.Conversation.encode(m.conversations[i], w.uint32(18).fork()).ldelim();
            }
            if (m.statusV3Messages != null && m.statusV3Messages.length) {
                for (var i = 0; i < m.statusV3Messages.length; ++i)
                    $root.proto.WebMessageInfo.encode(m.statusV3Messages[i], w.uint32(26).fork()).ldelim();
            }
            if (m.chunkOrder != null && Object.hasOwnProperty.call(m, "chunkOrder"))
                w.uint32(40).uint32(m.chunkOrder);
            if (m.progress != null && Object.hasOwnProperty.call(m, "progress"))
                w.uint32(48).uint32(m.progress);
            if (m.pushnames != null && m.pushnames.length) {
                for (var i = 0; i < m.pushnames.length; ++i)
                    $root.proto.Pushname.encode(m.pushnames[i], w.uint32(58).fork()).ldelim();
            }
            if (m.globalSettings != null && Object.hasOwnProperty.call(m, "globalSettings"))
                $root.proto.GlobalSettings.encode(m.globalSettings, w.uint32(66).fork()).ldelim();
            if (m.threadIdUserSecret != null && Object.hasOwnProperty.call(m, "threadIdUserSecret"))
                w.uint32(74).bytes(m.threadIdUserSecret);
            if (m.threadDsTimeframeOffset != null && Object.hasOwnProperty.call(m, "threadDsTimeframeOffset"))
                w.uint32(80).uint32(m.threadDsTimeframeOffset);
            if (m.recentStickers != null && m.recentStickers.length) {
                for (var i = 0; i < m.recentStickers.length; ++i)
                    $root.proto.StickerMetadata.encode(m.recentStickers[i], w.uint32(90).fork()).ldelim();
            }
            if (m.pastParticipants != null && m.pastParticipants.length) {
                for (var i = 0; i < m.pastParticipants.length; ++i)
                    $root.proto.PastParticipants.encode(m.pastParticipants[i], w.uint32(98).fork()).ldelim();
            }
            if (m.callLogRecords != null && m.callLogRecords.length) {
                for (var i = 0; i < m.callLogRecords.length; ++i)
                    $root.proto.CallLogRecord.encode(m.callLogRecords[i], w.uint32(106).fork()).ldelim();
            }
            if (m.aiWaitListState != null && Object.hasOwnProperty.call(m, "aiWaitListState"))
                w.uint32(112).int32(m.aiWaitListState);
            if (m.phoneNumberToLidMappings != null && m.phoneNumberToLidMappings.length) {
                for (var i = 0; i < m.phoneNumberToLidMappings.length; ++i)
                    $root.proto.PhoneNumberToLIDMapping.encode(m.phoneNumberToLidMappings[i], w.uint32(122).fork()).ldelim();
            }
            if (m.companionMetaNonce != null && Object.hasOwnProperty.call(m, "companionMetaNonce"))
                w.uint32(130).string(m.companionMetaNonce);
            if (m.shareableChatIdentifierEncryptionKey != null && Object.hasOwnProperty.call(m, "shareableChatIdentifierEncryptionKey"))
                w.uint32(138).bytes(m.shareableChatIdentifierEncryptionKey);
            if (m.accounts != null && m.accounts.length) {
                for (var i = 0; i < m.accounts.length; ++i)
                    $root.proto.Account.encode(m.accounts[i], w.uint32(146).fork()).ldelim();
            }
            return w;
        };

        HistorySync.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HistorySync();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.syncType = r.int32();
                        break;
                    }
                case 2: {
                        if (!(m.conversations && m.conversations.length))
                            m.conversations = [];
                        m.conversations.push($root.proto.Conversation.decode(r, r.uint32()));
                        break;
                    }
                case 3: {
                        if (!(m.statusV3Messages && m.statusV3Messages.length))
                            m.statusV3Messages = [];
                        m.statusV3Messages.push($root.proto.WebMessageInfo.decode(r, r.uint32()));
                        break;
                    }
                case 5: {
                        m.chunkOrder = r.uint32();
                        break;
                    }
                case 6: {
                        m.progress = r.uint32();
                        break;
                    }
                case 7: {
                        if (!(m.pushnames && m.pushnames.length))
                            m.pushnames = [];
                        m.pushnames.push($root.proto.Pushname.decode(r, r.uint32()));
                        break;
                    }
                case 8: {
                        m.globalSettings = $root.proto.GlobalSettings.decode(r, r.uint32());
                        break;
                    }
                case 9: {
                        m.threadIdUserSecret = r.bytes();
                        break;
                    }
                case 10: {
                        m.threadDsTimeframeOffset = r.uint32();
                        break;
                    }
                case 11: {
                        if (!(m.recentStickers && m.recentStickers.length))
                            m.recentStickers = [];
                        m.recentStickers.push($root.proto.StickerMetadata.decode(r, r.uint32()));
                        break;
                    }
                case 12: {
                        if (!(m.pastParticipants && m.pastParticipants.length))
                            m.pastParticipants = [];
                        m.pastParticipants.push($root.proto.PastParticipants.decode(r, r.uint32()));
                        break;
                    }
                case 13: {
                        if (!(m.callLogRecords && m.callLogRecords.length))
                            m.callLogRecords = [];
                        m.callLogRecords.push($root.proto.CallLogRecord.decode(r, r.uint32()));
                        break;
                    }
                case 14: {
                        m.aiWaitListState = r.int32();
                        break;
                    }
                case 15: {
                        if (!(m.phoneNumberToLidMappings && m.phoneNumberToLidMappings.length))
                            m.phoneNumberToLidMappings = [];
                        m.phoneNumberToLidMappings.push($root.proto.PhoneNumberToLIDMapping.decode(r, r.uint32()));
                        break;
                    }
                case 16: {
                        m.companionMetaNonce = r.string();
                        break;
                    }
                case 17: {
                        m.shareableChatIdentifierEncryptionKey = r.bytes();
                        break;
                    }
                case 18: {
                        if (!(m.accounts && m.accounts.length))
                            m.accounts = [];
                        m.accounts.push($root.proto.Account.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        HistorySync.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.HistorySync)
                return d;
            var m = new $root.proto.HistorySync();
            switch (d.syncType) {
            default:
                if (typeof d.syncType === "number") {
                    m.syncType = d.syncType;
                    break;
                }
                break;
            case "INITIAL_BOOTSTRAP":
            case 0:
                m.syncType = 0;
                break;
            case "INITIAL_STATUS_V3":
            case 1:
                m.syncType = 1;
                break;
            case "FULL":
            case 2:
                m.syncType = 2;
                break;
            case "RECENT":
            case 3:
                m.syncType = 3;
                break;
            case "PUSH_NAME":
            case 4:
                m.syncType = 4;
                break;
            case "NON_BLOCKING_DATA":
            case 5:
                m.syncType = 5;
                break;
            case "ON_DEMAND":
            case 6:
                m.syncType = 6;
                break;
            }
            if (d.conversations) {
                if (!Array.isArray(d.conversations))
                    throw TypeError(".proto.HistorySync.conversations: array expected");
                m.conversations = [];
                for (var i = 0; i < d.conversations.length; ++i) {
                    if (typeof d.conversations[i] !== "object")
                        throw TypeError(".proto.HistorySync.conversations: object expected");
                    m.conversations[i] = $root.proto.Conversation.fromObject(d.conversations[i]);
                }
            }
            if (d.statusV3Messages) {
                if (!Array.isArray(d.statusV3Messages))
                    throw TypeError(".proto.HistorySync.statusV3Messages: array expected");
                m.statusV3Messages = [];
                for (var i = 0; i < d.statusV3Messages.length; ++i) {
                    if (typeof d.statusV3Messages[i] !== "object")
                        throw TypeError(".proto.HistorySync.statusV3Messages: object expected");
                    m.statusV3Messages[i] = $root.proto.WebMessageInfo.fromObject(d.statusV3Messages[i]);
                }
            }
            if (d.chunkOrder != null) {
                m.chunkOrder = d.chunkOrder >>> 0;
            }
            if (d.progress != null) {
                m.progress = d.progress >>> 0;
            }
            if (d.pushnames) {
                if (!Array.isArray(d.pushnames))
                    throw TypeError(".proto.HistorySync.pushnames: array expected");
                m.pushnames = [];
                for (var i = 0; i < d.pushnames.length; ++i) {
                    if (typeof d.pushnames[i] !== "object")
                        throw TypeError(".proto.HistorySync.pushnames: object expected");
                    m.pushnames[i] = $root.proto.Pushname.fromObject(d.pushnames[i]);
                }
            }
            if (d.globalSettings != null) {
                if (typeof d.globalSettings !== "object")
                    throw TypeError(".proto.HistorySync.globalSettings: object expected");
                m.globalSettings = $root.proto.GlobalSettings.fromObject(d.globalSettings);
            }
            if (d.threadIdUserSecret != null) {
                if (typeof d.threadIdUserSecret === "string")
                    $util.base64.decode(d.threadIdUserSecret, m.threadIdUserSecret = $util.newBuffer($util.base64.length(d.threadIdUserSecret)), 0);
                else if (d.threadIdUserSecret.length >= 0)
                    m.threadIdUserSecret = d.threadIdUserSecret;
            }
            if (d.threadDsTimeframeOffset != null) {
                m.threadDsTimeframeOffset = d.threadDsTimeframeOffset >>> 0;
            }
            if (d.recentStickers) {
                if (!Array.isArray(d.recentStickers))
                    throw TypeError(".proto.HistorySync.recentStickers: array expected");
                m.recentStickers = [];
                for (var i = 0; i < d.recentStickers.length; ++i) {
                    if (typeof d.recentStickers[i] !== "object")
                        throw TypeError(".proto.HistorySync.recentStickers: object expected");
                    m.recentStickers[i] = $root.proto.StickerMetadata.fromObject(d.recentStickers[i]);
                }
            }
            if (d.pastParticipants) {
                if (!Array.isArray(d.pastParticipants))
                    throw TypeError(".proto.HistorySync.pastParticipants: array expected");
                m.pastParticipants = [];
                for (var i = 0; i < d.pastParticipants.length; ++i) {
                    if (typeof d.pastParticipants[i] !== "object")
                        throw TypeError(".proto.HistorySync.pastParticipants: object expected");
                    m.pastParticipants[i] = $root.proto.PastParticipants.fromObject(d.pastParticipants[i]);
                }
            }
            if (d.callLogRecords) {
                if (!Array.isArray(d.callLogRecords))
                    throw TypeError(".proto.HistorySync.callLogRecords: array expected");
                m.callLogRecords = [];
                for (var i = 0; i < d.callLogRecords.length; ++i) {
                    if (typeof d.callLogRecords[i] !== "object")
                        throw TypeError(".proto.HistorySync.callLogRecords: object expected");
                    m.callLogRecords[i] = $root.proto.CallLogRecord.fromObject(d.callLogRecords[i]);
                }
            }
            switch (d.aiWaitListState) {
            default:
                if (typeof d.aiWaitListState === "number") {
                    m.aiWaitListState = d.aiWaitListState;
                    break;
                }
                break;
            case "IN_WAITLIST":
            case 0:
                m.aiWaitListState = 0;
                break;
            case "AI_AVAILABLE":
            case 1:
                m.aiWaitListState = 1;
                break;
            }
            if (d.phoneNumberToLidMappings) {
                if (!Array.isArray(d.phoneNumberToLidMappings))
                    throw TypeError(".proto.HistorySync.phoneNumberToLidMappings: array expected");
                m.phoneNumberToLidMappings = [];
                for (var i = 0; i < d.phoneNumberToLidMappings.length; ++i) {
                    if (typeof d.phoneNumberToLidMappings[i] !== "object")
                        throw TypeError(".proto.HistorySync.phoneNumberToLidMappings: object expected");
                    m.phoneNumberToLidMappings[i] = $root.proto.PhoneNumberToLIDMapping.fromObject(d.phoneNumberToLidMappings[i]);
                }
            }
            if (d.companionMetaNonce != null) {
                m.companionMetaNonce = String(d.companionMetaNonce);
            }
            if (d.shareableChatIdentifierEncryptionKey != null) {
                if (typeof d.shareableChatIdentifierEncryptionKey === "string")
                    $util.base64.decode(d.shareableChatIdentifierEncryptionKey, m.shareableChatIdentifierEncryptionKey = $util.newBuffer($util.base64.length(d.shareableChatIdentifierEncryptionKey)), 0);
                else if (d.shareableChatIdentifierEncryptionKey.length >= 0)
                    m.shareableChatIdentifierEncryptionKey = d.shareableChatIdentifierEncryptionKey;
            }
            if (d.accounts) {
                if (!Array.isArray(d.accounts))
                    throw TypeError(".proto.HistorySync.accounts: array expected");
                m.accounts = [];
                for (var i = 0; i < d.accounts.length; ++i) {
                    if (typeof d.accounts[i] !== "object")
                        throw TypeError(".proto.HistorySync.accounts: object expected");
                    m.accounts[i] = $root.proto.Account.fromObject(d.accounts[i]);
                }
            }
            return m;
        };

        HistorySync.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.conversations = [];
                d.statusV3Messages = [];
                d.pushnames = [];
                d.recentStickers = [];
                d.pastParticipants = [];
                d.callLogRecords = [];
                d.phoneNumberToLidMappings = [];
                d.accounts = [];
            }
            if (o.defaults) {
                d.syncType = o.enums === String ? "INITIAL_BOOTSTRAP" : 0;
            }
            if (m.syncType != null && m.hasOwnProperty("syncType")) {
                d.syncType = o.enums === String ? $root.proto.HistorySync.HistorySyncType[m.syncType] === undefined ? m.syncType : $root.proto.HistorySync.HistorySyncType[m.syncType] : m.syncType;
            }
            if (m.conversations && m.conversations.length) {
                d.conversations = [];
                for (var j = 0; j < m.conversations.length; ++j) {
                    d.conversations[j] = $root.proto.Conversation.toObject(m.conversations[j], o);
                }
            }
            if (m.statusV3Messages && m.statusV3Messages.length) {
                d.statusV3Messages = [];
                for (var j = 0; j < m.statusV3Messages.length; ++j) {
                    d.statusV3Messages[j] = $root.proto.WebMessageInfo.toObject(m.statusV3Messages[j], o);
                }
            }
            if (m.chunkOrder != null && m.hasOwnProperty("chunkOrder")) {
                d.chunkOrder = m.chunkOrder;
                if (o.oneofs)
                    d._chunkOrder = "chunkOrder";
            }
            if (m.progress != null && m.hasOwnProperty("progress")) {
                d.progress = m.progress;
                if (o.oneofs)
                    d._progress = "progress";
            }
            if (m.pushnames && m.pushnames.length) {
                d.pushnames = [];
                for (var j = 0; j < m.pushnames.length; ++j) {
                    d.pushnames[j] = $root.proto.Pushname.toObject(m.pushnames[j], o);
                }
            }
            if (m.globalSettings != null && m.hasOwnProperty("globalSettings")) {
                d.globalSettings = $root.proto.GlobalSettings.toObject(m.globalSettings, o);
                if (o.oneofs)
                    d._globalSettings = "globalSettings";
            }
            if (m.threadIdUserSecret != null && m.hasOwnProperty("threadIdUserSecret")) {
                d.threadIdUserSecret = o.bytes === String ? $util.base64.encode(m.threadIdUserSecret, 0, m.threadIdUserSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.threadIdUserSecret) : m.threadIdUserSecret;
                if (o.oneofs)
                    d._threadIdUserSecret = "threadIdUserSecret";
            }
            if (m.threadDsTimeframeOffset != null && m.hasOwnProperty("threadDsTimeframeOffset")) {
                d.threadDsTimeframeOffset = m.threadDsTimeframeOffset;
                if (o.oneofs)
                    d._threadDsTimeframeOffset = "threadDsTimeframeOffset";
            }
            if (m.recentStickers && m.recentStickers.length) {
                d.recentStickers = [];
                for (var j = 0; j < m.recentStickers.length; ++j) {
                    d.recentStickers[j] = $root.proto.StickerMetadata.toObject(m.recentStickers[j], o);
                }
            }
            if (m.pastParticipants && m.pastParticipants.length) {
                d.pastParticipants = [];
                for (var j = 0; j < m.pastParticipants.length; ++j) {
                    d.pastParticipants[j] = $root.proto.PastParticipants.toObject(m.pastParticipants[j], o);
                }
            }
            if (m.callLogRecords && m.callLogRecords.length) {
                d.callLogRecords = [];
                for (var j = 0; j < m.callLogRecords.length; ++j) {
                    d.callLogRecords[j] = $root.proto.CallLogRecord.toObject(m.callLogRecords[j], o);
                }
            }
            if (m.aiWaitListState != null && m.hasOwnProperty("aiWaitListState")) {
                d.aiWaitListState = o.enums === String ? $root.proto.HistorySync.BotAIWaitListState[m.aiWaitListState] === undefined ? m.aiWaitListState : $root.proto.HistorySync.BotAIWaitListState[m.aiWaitListState] : m.aiWaitListState;
                if (o.oneofs)
                    d._aiWaitListState = "aiWaitListState";
            }
            if (m.phoneNumberToLidMappings && m.phoneNumberToLidMappings.length) {
                d.phoneNumberToLidMappings = [];
                for (var j = 0; j < m.phoneNumberToLidMappings.length; ++j) {
                    d.phoneNumberToLidMappings[j] = $root.proto.PhoneNumberToLIDMapping.toObject(m.phoneNumberToLidMappings[j], o);
                }
            }
            if (m.companionMetaNonce != null && m.hasOwnProperty("companionMetaNonce")) {
                d.companionMetaNonce = m.companionMetaNonce;
                if (o.oneofs)
                    d._companionMetaNonce = "companionMetaNonce";
            }
            if (m.shareableChatIdentifierEncryptionKey != null && m.hasOwnProperty("shareableChatIdentifierEncryptionKey")) {
                d.shareableChatIdentifierEncryptionKey = o.bytes === String ? $util.base64.encode(m.shareableChatIdentifierEncryptionKey, 0, m.shareableChatIdentifierEncryptionKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.shareableChatIdentifierEncryptionKey) : m.shareableChatIdentifierEncryptionKey;
                if (o.oneofs)
                    d._shareableChatIdentifierEncryptionKey = "shareableChatIdentifierEncryptionKey";
            }
            if (m.accounts && m.accounts.length) {
                d.accounts = [];
                for (var j = 0; j < m.accounts.length; ++j) {
                    d.accounts[j] = $root.proto.Account.toObject(m.accounts[j], o);
                }
            }
            return d;
        };

        HistorySync.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        HistorySync.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.HistorySync";
        };

        HistorySync.BotAIWaitListState = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "IN_WAITLIST"] = 0;
            values[valuesById[1] = "AI_AVAILABLE"] = 1;
            return values;
        })();

        HistorySync.HistorySyncType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "INITIAL_BOOTSTRAP"] = 0;
            values[valuesById[1] = "INITIAL_STATUS_V3"] = 1;
            values[valuesById[2] = "FULL"] = 2;
            values[valuesById[3] = "RECENT"] = 3;
            values[valuesById[4] = "PUSH_NAME"] = 4;
            values[valuesById[5] = "NON_BLOCKING_DATA"] = 5;
            values[valuesById[6] = "ON_DEMAND"] = 6;
            return values;
        })();

        return HistorySync;
    })();

    proto.HistorySyncMsg = (function() {

        function HistorySyncMsg(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        HistorySyncMsg.prototype.message = null;
        HistorySyncMsg.prototype.msgOrderId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySyncMsg.prototype, "_message", {
            get: $util.oneOfGetter($oneOfFields = ["message"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HistorySyncMsg.prototype, "_msgOrderId", {
            get: $util.oneOfGetter($oneOfFields = ["msgOrderId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        HistorySyncMsg.create = function create(properties) {
            return new HistorySyncMsg(properties);
        };

        HistorySyncMsg.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                $root.proto.WebMessageInfo.encode(m.message, w.uint32(10).fork()).ldelim();
            if (m.msgOrderId != null && Object.hasOwnProperty.call(m, "msgOrderId"))
                w.uint32(16).uint64(m.msgOrderId);
            return w;
        };

        HistorySyncMsg.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HistorySyncMsg();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.message = $root.proto.WebMessageInfo.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.msgOrderId = r.uint64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        HistorySyncMsg.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.HistorySyncMsg)
                return d;
            var m = new $root.proto.HistorySyncMsg();
            if (d.message != null) {
                if (typeof d.message !== "object")
                    throw TypeError(".proto.HistorySyncMsg.message: object expected");
                m.message = $root.proto.WebMessageInfo.fromObject(d.message);
            }
            if (d.msgOrderId != null) {
                if ($util.Long)
                    (m.msgOrderId = $util.Long.fromValue(d.msgOrderId)).unsigned = true;
                else if (typeof d.msgOrderId === "string")
                    m.msgOrderId = parseInt(d.msgOrderId, 10);
                else if (typeof d.msgOrderId === "number")
                    m.msgOrderId = d.msgOrderId;
                else if (typeof d.msgOrderId === "object")
                    m.msgOrderId = new $util.LongBits(d.msgOrderId.low >>> 0, d.msgOrderId.high >>> 0).toNumber(true);
            }
            return m;
        };

        HistorySyncMsg.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.message != null && m.hasOwnProperty("message")) {
                d.message = $root.proto.WebMessageInfo.toObject(m.message, o);
                if (o.oneofs)
                    d._message = "message";
            }
            if (m.msgOrderId != null && m.hasOwnProperty("msgOrderId")) {
                if (typeof m.msgOrderId === "number")
                    d.msgOrderId = o.longs === String ? String(m.msgOrderId) : m.msgOrderId;
                else
                    d.msgOrderId = o.longs === String ? longToString(m.msgOrderId, true) : o.longs === Number ? longToNumber(m.msgOrderId, true) : m.msgOrderId;
                if (o.oneofs)
                    d._msgOrderId = "msgOrderId";
            }
            return d;
        };

        HistorySyncMsg.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        HistorySyncMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.HistorySyncMsg";
        };

        return HistorySyncMsg;
    })();

    proto.HydratedTemplateButton = (function() {

        function HydratedTemplateButton(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        HydratedTemplateButton.prototype.index = null;
        HydratedTemplateButton.prototype.quickReplyButton = null;
        HydratedTemplateButton.prototype.urlButton = null;
        HydratedTemplateButton.prototype.callButton = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(HydratedTemplateButton.prototype, "_index", {
            get: $util.oneOfGetter($oneOfFields = ["index"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Object.defineProperty(HydratedTemplateButton.prototype, "hydratedButton", {
            get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        HydratedTemplateButton.create = function create(properties) {
            return new HydratedTemplateButton(properties);
        };

        HydratedTemplateButton.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.quickReplyButton != null && Object.hasOwnProperty.call(m, "quickReplyButton"))
                $root.proto.HydratedTemplateButton.HydratedQuickReplyButton.encode(m.quickReplyButton, w.uint32(10).fork()).ldelim();
            if (m.urlButton != null && Object.hasOwnProperty.call(m, "urlButton"))
                $root.proto.HydratedTemplateButton.HydratedURLButton.encode(m.urlButton, w.uint32(18).fork()).ldelim();
            if (m.callButton != null && Object.hasOwnProperty.call(m, "callButton"))
                $root.proto.HydratedTemplateButton.HydratedCallButton.encode(m.callButton, w.uint32(26).fork()).ldelim();
            if (m.index != null && Object.hasOwnProperty.call(m, "index"))
                w.uint32(32).uint32(m.index);
            return w;
        };

        HydratedTemplateButton.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HydratedTemplateButton();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 4: {
                        m.index = r.uint32();
                        break;
                    }
                case 1: {
                        m.quickReplyButton = $root.proto.HydratedTemplateButton.HydratedQuickReplyButton.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.urlButton = $root.proto.HydratedTemplateButton.HydratedURLButton.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.callButton = $root.proto.HydratedTemplateButton.HydratedCallButton.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        HydratedTemplateButton.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.HydratedTemplateButton)
                return d;
            var m = new $root.proto.HydratedTemplateButton();
            if (d.index != null) {
                m.index = d.index >>> 0;
            }
            if (d.quickReplyButton != null) {
                if (typeof d.quickReplyButton !== "object")
                    throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected");
                m.quickReplyButton = $root.proto.HydratedTemplateButton.HydratedQuickReplyButton.fromObject(d.quickReplyButton);
            }
            if (d.urlButton != null) {
                if (typeof d.urlButton !== "object")
                    throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected");
                m.urlButton = $root.proto.HydratedTemplateButton.HydratedURLButton.fromObject(d.urlButton);
            }
            if (d.callButton != null) {
                if (typeof d.callButton !== "object")
                    throw TypeError(".proto.HydratedTemplateButton.callButton: object expected");
                m.callButton = $root.proto.HydratedTemplateButton.HydratedCallButton.fromObject(d.callButton);
            }
            return m;
        };

        HydratedTemplateButton.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.quickReplyButton != null && m.hasOwnProperty("quickReplyButton")) {
                d.quickReplyButton = $root.proto.HydratedTemplateButton.HydratedQuickReplyButton.toObject(m.quickReplyButton, o);
                if (o.oneofs)
                    d.hydratedButton = "quickReplyButton";
            }
            if (m.urlButton != null && m.hasOwnProperty("urlButton")) {
                d.urlButton = $root.proto.HydratedTemplateButton.HydratedURLButton.toObject(m.urlButton, o);
                if (o.oneofs)
                    d.hydratedButton = "urlButton";
            }
            if (m.callButton != null && m.hasOwnProperty("callButton")) {
                d.callButton = $root.proto.HydratedTemplateButton.HydratedCallButton.toObject(m.callButton, o);
                if (o.oneofs)
                    d.hydratedButton = "callButton";
            }
            if (m.index != null && m.hasOwnProperty("index")) {
                d.index = m.index;
                if (o.oneofs)
                    d._index = "index";
            }
            return d;
        };

        HydratedTemplateButton.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        HydratedTemplateButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.HydratedTemplateButton";
        };

        HydratedTemplateButton.HydratedCallButton = (function() {

            function HydratedCallButton(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            HydratedCallButton.prototype.displayText = null;
            HydratedCallButton.prototype.phoneNumber = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HydratedCallButton.prototype, "_displayText", {
                get: $util.oneOfGetter($oneOfFields = ["displayText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HydratedCallButton.prototype, "_phoneNumber", {
                get: $util.oneOfGetter($oneOfFields = ["phoneNumber"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            HydratedCallButton.create = function create(properties) {
                return new HydratedCallButton(properties);
            };

            HydratedCallButton.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayText != null && Object.hasOwnProperty.call(m, "displayText"))
                    w.uint32(10).string(m.displayText);
                if (m.phoneNumber != null && Object.hasOwnProperty.call(m, "phoneNumber"))
                    w.uint32(18).string(m.phoneNumber);
                return w;
            };

            HydratedCallButton.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HydratedTemplateButton.HydratedCallButton();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayText = r.string();
                            break;
                        }
                    case 2: {
                            m.phoneNumber = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            HydratedCallButton.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.HydratedTemplateButton.HydratedCallButton)
                    return d;
                var m = new $root.proto.HydratedTemplateButton.HydratedCallButton();
                if (d.displayText != null) {
                    m.displayText = String(d.displayText);
                }
                if (d.phoneNumber != null) {
                    m.phoneNumber = String(d.phoneNumber);
                }
                return m;
            };

            HydratedCallButton.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.displayText != null && m.hasOwnProperty("displayText")) {
                    d.displayText = m.displayText;
                    if (o.oneofs)
                        d._displayText = "displayText";
                }
                if (m.phoneNumber != null && m.hasOwnProperty("phoneNumber")) {
                    d.phoneNumber = m.phoneNumber;
                    if (o.oneofs)
                        d._phoneNumber = "phoneNumber";
                }
                return d;
            };

            HydratedCallButton.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            HydratedCallButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.HydratedTemplateButton.HydratedCallButton";
            };

            return HydratedCallButton;
        })();

        HydratedTemplateButton.HydratedQuickReplyButton = (function() {

            function HydratedQuickReplyButton(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            HydratedQuickReplyButton.prototype.displayText = null;
            HydratedQuickReplyButton.prototype.id = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HydratedQuickReplyButton.prototype, "_displayText", {
                get: $util.oneOfGetter($oneOfFields = ["displayText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HydratedQuickReplyButton.prototype, "_id", {
                get: $util.oneOfGetter($oneOfFields = ["id"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            HydratedQuickReplyButton.create = function create(properties) {
                return new HydratedQuickReplyButton(properties);
            };

            HydratedQuickReplyButton.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayText != null && Object.hasOwnProperty.call(m, "displayText"))
                    w.uint32(10).string(m.displayText);
                if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                    w.uint32(18).string(m.id);
                return w;
            };

            HydratedQuickReplyButton.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HydratedTemplateButton.HydratedQuickReplyButton();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayText = r.string();
                            break;
                        }
                    case 2: {
                            m.id = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            HydratedQuickReplyButton.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.HydratedTemplateButton.HydratedQuickReplyButton)
                    return d;
                var m = new $root.proto.HydratedTemplateButton.HydratedQuickReplyButton();
                if (d.displayText != null) {
                    m.displayText = String(d.displayText);
                }
                if (d.id != null) {
                    m.id = String(d.id);
                }
                return m;
            };

            HydratedQuickReplyButton.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.displayText != null && m.hasOwnProperty("displayText")) {
                    d.displayText = m.displayText;
                    if (o.oneofs)
                        d._displayText = "displayText";
                }
                if (m.id != null && m.hasOwnProperty("id")) {
                    d.id = m.id;
                    if (o.oneofs)
                        d._id = "id";
                }
                return d;
            };

            HydratedQuickReplyButton.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            HydratedQuickReplyButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.HydratedTemplateButton.HydratedQuickReplyButton";
            };

            return HydratedQuickReplyButton;
        })();

        HydratedTemplateButton.HydratedURLButton = (function() {

            function HydratedURLButton(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            HydratedURLButton.prototype.displayText = null;
            HydratedURLButton.prototype.url = null;
            HydratedURLButton.prototype.consentedUsersUrl = null;
            HydratedURLButton.prototype.webviewPresentation = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HydratedURLButton.prototype, "_displayText", {
                get: $util.oneOfGetter($oneOfFields = ["displayText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HydratedURLButton.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HydratedURLButton.prototype, "_consentedUsersUrl", {
                get: $util.oneOfGetter($oneOfFields = ["consentedUsersUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HydratedURLButton.prototype, "_webviewPresentation", {
                get: $util.oneOfGetter($oneOfFields = ["webviewPresentation"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            HydratedURLButton.create = function create(properties) {
                return new HydratedURLButton(properties);
            };

            HydratedURLButton.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayText != null && Object.hasOwnProperty.call(m, "displayText"))
                    w.uint32(10).string(m.displayText);
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(18).string(m.url);
                if (m.consentedUsersUrl != null && Object.hasOwnProperty.call(m, "consentedUsersUrl"))
                    w.uint32(26).string(m.consentedUsersUrl);
                if (m.webviewPresentation != null && Object.hasOwnProperty.call(m, "webviewPresentation"))
                    w.uint32(32).int32(m.webviewPresentation);
                return w;
            };

            HydratedURLButton.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.HydratedTemplateButton.HydratedURLButton();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayText = r.string();
                            break;
                        }
                    case 2: {
                            m.url = r.string();
                            break;
                        }
                    case 3: {
                            m.consentedUsersUrl = r.string();
                            break;
                        }
                    case 4: {
                            m.webviewPresentation = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            HydratedURLButton.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.HydratedTemplateButton.HydratedURLButton)
                    return d;
                var m = new $root.proto.HydratedTemplateButton.HydratedURLButton();
                if (d.displayText != null) {
                    m.displayText = String(d.displayText);
                }
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.consentedUsersUrl != null) {
                    m.consentedUsersUrl = String(d.consentedUsersUrl);
                }
                switch (d.webviewPresentation) {
                default:
                    if (typeof d.webviewPresentation === "number") {
                        m.webviewPresentation = d.webviewPresentation;
                        break;
                    }
                    break;
                case "FULL":
                case 1:
                    m.webviewPresentation = 1;
                    break;
                case "TALL":
                case 2:
                    m.webviewPresentation = 2;
                    break;
                case "COMPACT":
                case 3:
                    m.webviewPresentation = 3;
                    break;
                }
                return m;
            };

            HydratedURLButton.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.displayText != null && m.hasOwnProperty("displayText")) {
                    d.displayText = m.displayText;
                    if (o.oneofs)
                        d._displayText = "displayText";
                }
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.consentedUsersUrl != null && m.hasOwnProperty("consentedUsersUrl")) {
                    d.consentedUsersUrl = m.consentedUsersUrl;
                    if (o.oneofs)
                        d._consentedUsersUrl = "consentedUsersUrl";
                }
                if (m.webviewPresentation != null && m.hasOwnProperty("webviewPresentation")) {
                    d.webviewPresentation = o.enums === String ? $root.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[m.webviewPresentation] === undefined ? m.webviewPresentation : $root.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[m.webviewPresentation] : m.webviewPresentation;
                    if (o.oneofs)
                        d._webviewPresentation = "webviewPresentation";
                }
                return d;
            };

            HydratedURLButton.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            HydratedURLButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.HydratedTemplateButton.HydratedURLButton";
            };

            HydratedURLButton.WebviewPresentationType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "FULL"] = 1;
                values[valuesById[2] = "TALL"] = 2;
                values[valuesById[3] = "COMPACT"] = 3;
                return values;
            })();

            return HydratedURLButton;
        })();

        return HydratedTemplateButton;
    })();

    proto.IdentityKeyPairStructure = (function() {

        function IdentityKeyPairStructure(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        IdentityKeyPairStructure.prototype.publicKey = null;
        IdentityKeyPairStructure.prototype.privateKey = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(IdentityKeyPairStructure.prototype, "_publicKey", {
            get: $util.oneOfGetter($oneOfFields = ["publicKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(IdentityKeyPairStructure.prototype, "_privateKey", {
            get: $util.oneOfGetter($oneOfFields = ["privateKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        IdentityKeyPairStructure.create = function create(properties) {
            return new IdentityKeyPairStructure(properties);
        };

        IdentityKeyPairStructure.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey"))
                w.uint32(10).bytes(m.publicKey);
            if (m.privateKey != null && Object.hasOwnProperty.call(m, "privateKey"))
                w.uint32(18).bytes(m.privateKey);
            return w;
        };

        IdentityKeyPairStructure.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.IdentityKeyPairStructure();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.publicKey = r.bytes();
                        break;
                    }
                case 2: {
                        m.privateKey = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        IdentityKeyPairStructure.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.IdentityKeyPairStructure)
                return d;
            var m = new $root.proto.IdentityKeyPairStructure();
            if (d.publicKey != null) {
                if (typeof d.publicKey === "string")
                    $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0);
                else if (d.publicKey.length >= 0)
                    m.publicKey = d.publicKey;
            }
            if (d.privateKey != null) {
                if (typeof d.privateKey === "string")
                    $util.base64.decode(d.privateKey, m.privateKey = $util.newBuffer($util.base64.length(d.privateKey)), 0);
                else if (d.privateKey.length >= 0)
                    m.privateKey = d.privateKey;
            }
            return m;
        };

        IdentityKeyPairStructure.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.publicKey != null && m.hasOwnProperty("publicKey")) {
                d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey;
                if (o.oneofs)
                    d._publicKey = "publicKey";
            }
            if (m.privateKey != null && m.hasOwnProperty("privateKey")) {
                d.privateKey = o.bytes === String ? $util.base64.encode(m.privateKey, 0, m.privateKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.privateKey) : m.privateKey;
                if (o.oneofs)
                    d._privateKey = "privateKey";
            }
            return d;
        };

        IdentityKeyPairStructure.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        IdentityKeyPairStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.IdentityKeyPairStructure";
        };

        return IdentityKeyPairStructure;
    })();

    proto.InThreadSurveyMetadata = (function() {

        function InThreadSurveyMetadata(p) {
            this.questions = [];
            this.privacyStatementParts = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        InThreadSurveyMetadata.prototype.tessaSessionId = null;
        InThreadSurveyMetadata.prototype.simonSessionId = null;
        InThreadSurveyMetadata.prototype.simonSurveyId = null;
        InThreadSurveyMetadata.prototype.tessaRootId = null;
        InThreadSurveyMetadata.prototype.requestId = null;
        InThreadSurveyMetadata.prototype.tessaEvent = null;
        InThreadSurveyMetadata.prototype.invitationHeaderText = null;
        InThreadSurveyMetadata.prototype.invitationBodyText = null;
        InThreadSurveyMetadata.prototype.invitationCtaText = null;
        InThreadSurveyMetadata.prototype.invitationCtaUrl = null;
        InThreadSurveyMetadata.prototype.surveyTitle = null;
        InThreadSurveyMetadata.prototype.questions = $util.emptyArray;
        InThreadSurveyMetadata.prototype.surveyContinueButtonText = null;
        InThreadSurveyMetadata.prototype.surveySubmitButtonText = null;
        InThreadSurveyMetadata.prototype.privacyStatementFull = null;
        InThreadSurveyMetadata.prototype.privacyStatementParts = $util.emptyArray;
        InThreadSurveyMetadata.prototype.feedbackToastText = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_tessaSessionId", {
            get: $util.oneOfGetter($oneOfFields = ["tessaSessionId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_simonSessionId", {
            get: $util.oneOfGetter($oneOfFields = ["simonSessionId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_simonSurveyId", {
            get: $util.oneOfGetter($oneOfFields = ["simonSurveyId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_tessaRootId", {
            get: $util.oneOfGetter($oneOfFields = ["tessaRootId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_requestId", {
            get: $util.oneOfGetter($oneOfFields = ["requestId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_tessaEvent", {
            get: $util.oneOfGetter($oneOfFields = ["tessaEvent"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_invitationHeaderText", {
            get: $util.oneOfGetter($oneOfFields = ["invitationHeaderText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_invitationBodyText", {
            get: $util.oneOfGetter($oneOfFields = ["invitationBodyText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_invitationCtaText", {
            get: $util.oneOfGetter($oneOfFields = ["invitationCtaText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_invitationCtaUrl", {
            get: $util.oneOfGetter($oneOfFields = ["invitationCtaUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_surveyTitle", {
            get: $util.oneOfGetter($oneOfFields = ["surveyTitle"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_surveyContinueButtonText", {
            get: $util.oneOfGetter($oneOfFields = ["surveyContinueButtonText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_surveySubmitButtonText", {
            get: $util.oneOfGetter($oneOfFields = ["surveySubmitButtonText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_privacyStatementFull", {
            get: $util.oneOfGetter($oneOfFields = ["privacyStatementFull"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InThreadSurveyMetadata.prototype, "_feedbackToastText", {
            get: $util.oneOfGetter($oneOfFields = ["feedbackToastText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        InThreadSurveyMetadata.create = function create(properties) {
            return new InThreadSurveyMetadata(properties);
        };

        InThreadSurveyMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.tessaSessionId != null && Object.hasOwnProperty.call(m, "tessaSessionId"))
                w.uint32(10).string(m.tessaSessionId);
            if (m.simonSessionId != null && Object.hasOwnProperty.call(m, "simonSessionId"))
                w.uint32(18).string(m.simonSessionId);
            if (m.simonSurveyId != null && Object.hasOwnProperty.call(m, "simonSurveyId"))
                w.uint32(26).string(m.simonSurveyId);
            if (m.tessaRootId != null && Object.hasOwnProperty.call(m, "tessaRootId"))
                w.uint32(34).string(m.tessaRootId);
            if (m.requestId != null && Object.hasOwnProperty.call(m, "requestId"))
                w.uint32(42).string(m.requestId);
            if (m.tessaEvent != null && Object.hasOwnProperty.call(m, "tessaEvent"))
                w.uint32(50).string(m.tessaEvent);
            if (m.invitationHeaderText != null && Object.hasOwnProperty.call(m, "invitationHeaderText"))
                w.uint32(58).string(m.invitationHeaderText);
            if (m.invitationBodyText != null && Object.hasOwnProperty.call(m, "invitationBodyText"))
                w.uint32(66).string(m.invitationBodyText);
            if (m.invitationCtaText != null && Object.hasOwnProperty.call(m, "invitationCtaText"))
                w.uint32(74).string(m.invitationCtaText);
            if (m.invitationCtaUrl != null && Object.hasOwnProperty.call(m, "invitationCtaUrl"))
                w.uint32(82).string(m.invitationCtaUrl);
            if (m.surveyTitle != null && Object.hasOwnProperty.call(m, "surveyTitle"))
                w.uint32(90).string(m.surveyTitle);
            if (m.questions != null && m.questions.length) {
                for (var i = 0; i < m.questions.length; ++i)
                    $root.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.encode(m.questions[i], w.uint32(98).fork()).ldelim();
            }
            if (m.surveyContinueButtonText != null && Object.hasOwnProperty.call(m, "surveyContinueButtonText"))
                w.uint32(106).string(m.surveyContinueButtonText);
            if (m.surveySubmitButtonText != null && Object.hasOwnProperty.call(m, "surveySubmitButtonText"))
                w.uint32(114).string(m.surveySubmitButtonText);
            if (m.privacyStatementFull != null && Object.hasOwnProperty.call(m, "privacyStatementFull"))
                w.uint32(122).string(m.privacyStatementFull);
            if (m.privacyStatementParts != null && m.privacyStatementParts.length) {
                for (var i = 0; i < m.privacyStatementParts.length; ++i)
                    $root.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.encode(m.privacyStatementParts[i], w.uint32(130).fork()).ldelim();
            }
            if (m.feedbackToastText != null && Object.hasOwnProperty.call(m, "feedbackToastText"))
                w.uint32(138).string(m.feedbackToastText);
            return w;
        };

        InThreadSurveyMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.InThreadSurveyMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.tessaSessionId = r.string();
                        break;
                    }
                case 2: {
                        m.simonSessionId = r.string();
                        break;
                    }
                case 3: {
                        m.simonSurveyId = r.string();
                        break;
                    }
                case 4: {
                        m.tessaRootId = r.string();
                        break;
                    }
                case 5: {
                        m.requestId = r.string();
                        break;
                    }
                case 6: {
                        m.tessaEvent = r.string();
                        break;
                    }
                case 7: {
                        m.invitationHeaderText = r.string();
                        break;
                    }
                case 8: {
                        m.invitationBodyText = r.string();
                        break;
                    }
                case 9: {
                        m.invitationCtaText = r.string();
                        break;
                    }
                case 10: {
                        m.invitationCtaUrl = r.string();
                        break;
                    }
                case 11: {
                        m.surveyTitle = r.string();
                        break;
                    }
                case 12: {
                        if (!(m.questions && m.questions.length))
                            m.questions = [];
                        m.questions.push($root.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.decode(r, r.uint32()));
                        break;
                    }
                case 13: {
                        m.surveyContinueButtonText = r.string();
                        break;
                    }
                case 14: {
                        m.surveySubmitButtonText = r.string();
                        break;
                    }
                case 15: {
                        m.privacyStatementFull = r.string();
                        break;
                    }
                case 16: {
                        if (!(m.privacyStatementParts && m.privacyStatementParts.length))
                            m.privacyStatementParts = [];
                        m.privacyStatementParts.push($root.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.decode(r, r.uint32()));
                        break;
                    }
                case 17: {
                        m.feedbackToastText = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        InThreadSurveyMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.InThreadSurveyMetadata)
                return d;
            var m = new $root.proto.InThreadSurveyMetadata();
            if (d.tessaSessionId != null) {
                m.tessaSessionId = String(d.tessaSessionId);
            }
            if (d.simonSessionId != null) {
                m.simonSessionId = String(d.simonSessionId);
            }
            if (d.simonSurveyId != null) {
                m.simonSurveyId = String(d.simonSurveyId);
            }
            if (d.tessaRootId != null) {
                m.tessaRootId = String(d.tessaRootId);
            }
            if (d.requestId != null) {
                m.requestId = String(d.requestId);
            }
            if (d.tessaEvent != null) {
                m.tessaEvent = String(d.tessaEvent);
            }
            if (d.invitationHeaderText != null) {
                m.invitationHeaderText = String(d.invitationHeaderText);
            }
            if (d.invitationBodyText != null) {
                m.invitationBodyText = String(d.invitationBodyText);
            }
            if (d.invitationCtaText != null) {
                m.invitationCtaText = String(d.invitationCtaText);
            }
            if (d.invitationCtaUrl != null) {
                m.invitationCtaUrl = String(d.invitationCtaUrl);
            }
            if (d.surveyTitle != null) {
                m.surveyTitle = String(d.surveyTitle);
            }
            if (d.questions) {
                if (!Array.isArray(d.questions))
                    throw TypeError(".proto.InThreadSurveyMetadata.questions: array expected");
                m.questions = [];
                for (var i = 0; i < d.questions.length; ++i) {
                    if (typeof d.questions[i] !== "object")
                        throw TypeError(".proto.InThreadSurveyMetadata.questions: object expected");
                    m.questions[i] = $root.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.fromObject(d.questions[i]);
                }
            }
            if (d.surveyContinueButtonText != null) {
                m.surveyContinueButtonText = String(d.surveyContinueButtonText);
            }
            if (d.surveySubmitButtonText != null) {
                m.surveySubmitButtonText = String(d.surveySubmitButtonText);
            }
            if (d.privacyStatementFull != null) {
                m.privacyStatementFull = String(d.privacyStatementFull);
            }
            if (d.privacyStatementParts) {
                if (!Array.isArray(d.privacyStatementParts))
                    throw TypeError(".proto.InThreadSurveyMetadata.privacyStatementParts: array expected");
                m.privacyStatementParts = [];
                for (var i = 0; i < d.privacyStatementParts.length; ++i) {
                    if (typeof d.privacyStatementParts[i] !== "object")
                        throw TypeError(".proto.InThreadSurveyMetadata.privacyStatementParts: object expected");
                    m.privacyStatementParts[i] = $root.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.fromObject(d.privacyStatementParts[i]);
                }
            }
            if (d.feedbackToastText != null) {
                m.feedbackToastText = String(d.feedbackToastText);
            }
            return m;
        };

        InThreadSurveyMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.questions = [];
                d.privacyStatementParts = [];
            }
            if (m.tessaSessionId != null && m.hasOwnProperty("tessaSessionId")) {
                d.tessaSessionId = m.tessaSessionId;
                if (o.oneofs)
                    d._tessaSessionId = "tessaSessionId";
            }
            if (m.simonSessionId != null && m.hasOwnProperty("simonSessionId")) {
                d.simonSessionId = m.simonSessionId;
                if (o.oneofs)
                    d._simonSessionId = "simonSessionId";
            }
            if (m.simonSurveyId != null && m.hasOwnProperty("simonSurveyId")) {
                d.simonSurveyId = m.simonSurveyId;
                if (o.oneofs)
                    d._simonSurveyId = "simonSurveyId";
            }
            if (m.tessaRootId != null && m.hasOwnProperty("tessaRootId")) {
                d.tessaRootId = m.tessaRootId;
                if (o.oneofs)
                    d._tessaRootId = "tessaRootId";
            }
            if (m.requestId != null && m.hasOwnProperty("requestId")) {
                d.requestId = m.requestId;
                if (o.oneofs)
                    d._requestId = "requestId";
            }
            if (m.tessaEvent != null && m.hasOwnProperty("tessaEvent")) {
                d.tessaEvent = m.tessaEvent;
                if (o.oneofs)
                    d._tessaEvent = "tessaEvent";
            }
            if (m.invitationHeaderText != null && m.hasOwnProperty("invitationHeaderText")) {
                d.invitationHeaderText = m.invitationHeaderText;
                if (o.oneofs)
                    d._invitationHeaderText = "invitationHeaderText";
            }
            if (m.invitationBodyText != null && m.hasOwnProperty("invitationBodyText")) {
                d.invitationBodyText = m.invitationBodyText;
                if (o.oneofs)
                    d._invitationBodyText = "invitationBodyText";
            }
            if (m.invitationCtaText != null && m.hasOwnProperty("invitationCtaText")) {
                d.invitationCtaText = m.invitationCtaText;
                if (o.oneofs)
                    d._invitationCtaText = "invitationCtaText";
            }
            if (m.invitationCtaUrl != null && m.hasOwnProperty("invitationCtaUrl")) {
                d.invitationCtaUrl = m.invitationCtaUrl;
                if (o.oneofs)
                    d._invitationCtaUrl = "invitationCtaUrl";
            }
            if (m.surveyTitle != null && m.hasOwnProperty("surveyTitle")) {
                d.surveyTitle = m.surveyTitle;
                if (o.oneofs)
                    d._surveyTitle = "surveyTitle";
            }
            if (m.questions && m.questions.length) {
                d.questions = [];
                for (var j = 0; j < m.questions.length; ++j) {
                    d.questions[j] = $root.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.toObject(m.questions[j], o);
                }
            }
            if (m.surveyContinueButtonText != null && m.hasOwnProperty("surveyContinueButtonText")) {
                d.surveyContinueButtonText = m.surveyContinueButtonText;
                if (o.oneofs)
                    d._surveyContinueButtonText = "surveyContinueButtonText";
            }
            if (m.surveySubmitButtonText != null && m.hasOwnProperty("surveySubmitButtonText")) {
                d.surveySubmitButtonText = m.surveySubmitButtonText;
                if (o.oneofs)
                    d._surveySubmitButtonText = "surveySubmitButtonText";
            }
            if (m.privacyStatementFull != null && m.hasOwnProperty("privacyStatementFull")) {
                d.privacyStatementFull = m.privacyStatementFull;
                if (o.oneofs)
                    d._privacyStatementFull = "privacyStatementFull";
            }
            if (m.privacyStatementParts && m.privacyStatementParts.length) {
                d.privacyStatementParts = [];
                for (var j = 0; j < m.privacyStatementParts.length; ++j) {
                    d.privacyStatementParts[j] = $root.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.toObject(m.privacyStatementParts[j], o);
                }
            }
            if (m.feedbackToastText != null && m.hasOwnProperty("feedbackToastText")) {
                d.feedbackToastText = m.feedbackToastText;
                if (o.oneofs)
                    d._feedbackToastText = "feedbackToastText";
            }
            return d;
        };

        InThreadSurveyMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        InThreadSurveyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.InThreadSurveyMetadata";
        };

        InThreadSurveyMetadata.InThreadSurveyOption = (function() {

            function InThreadSurveyOption(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InThreadSurveyOption.prototype.stringValue = null;
            InThreadSurveyOption.prototype.numericValue = null;
            InThreadSurveyOption.prototype.textTranslated = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InThreadSurveyOption.prototype, "_stringValue", {
                get: $util.oneOfGetter($oneOfFields = ["stringValue"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InThreadSurveyOption.prototype, "_numericValue", {
                get: $util.oneOfGetter($oneOfFields = ["numericValue"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InThreadSurveyOption.prototype, "_textTranslated", {
                get: $util.oneOfGetter($oneOfFields = ["textTranslated"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            InThreadSurveyOption.create = function create(properties) {
                return new InThreadSurveyOption(properties);
            };

            InThreadSurveyOption.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.stringValue != null && Object.hasOwnProperty.call(m, "stringValue"))
                    w.uint32(10).string(m.stringValue);
                if (m.numericValue != null && Object.hasOwnProperty.call(m, "numericValue"))
                    w.uint32(16).uint32(m.numericValue);
                if (m.textTranslated != null && Object.hasOwnProperty.call(m, "textTranslated"))
                    w.uint32(26).string(m.textTranslated);
                return w;
            };

            InThreadSurveyOption.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.InThreadSurveyMetadata.InThreadSurveyOption();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.stringValue = r.string();
                            break;
                        }
                    case 2: {
                            m.numericValue = r.uint32();
                            break;
                        }
                    case 3: {
                            m.textTranslated = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InThreadSurveyOption.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.InThreadSurveyMetadata.InThreadSurveyOption)
                    return d;
                var m = new $root.proto.InThreadSurveyMetadata.InThreadSurveyOption();
                if (d.stringValue != null) {
                    m.stringValue = String(d.stringValue);
                }
                if (d.numericValue != null) {
                    m.numericValue = d.numericValue >>> 0;
                }
                if (d.textTranslated != null) {
                    m.textTranslated = String(d.textTranslated);
                }
                return m;
            };

            InThreadSurveyOption.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.stringValue != null && m.hasOwnProperty("stringValue")) {
                    d.stringValue = m.stringValue;
                    if (o.oneofs)
                        d._stringValue = "stringValue";
                }
                if (m.numericValue != null && m.hasOwnProperty("numericValue")) {
                    d.numericValue = m.numericValue;
                    if (o.oneofs)
                        d._numericValue = "numericValue";
                }
                if (m.textTranslated != null && m.hasOwnProperty("textTranslated")) {
                    d.textTranslated = m.textTranslated;
                    if (o.oneofs)
                        d._textTranslated = "textTranslated";
                }
                return d;
            };

            InThreadSurveyOption.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InThreadSurveyOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.InThreadSurveyMetadata.InThreadSurveyOption";
            };

            return InThreadSurveyOption;
        })();

        InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart = (function() {

            function InThreadSurveyPrivacyStatementPart(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InThreadSurveyPrivacyStatementPart.prototype.text = null;
            InThreadSurveyPrivacyStatementPart.prototype.url = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InThreadSurveyPrivacyStatementPart.prototype, "_text", {
                get: $util.oneOfGetter($oneOfFields = ["text"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InThreadSurveyPrivacyStatementPart.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            InThreadSurveyPrivacyStatementPart.create = function create(properties) {
                return new InThreadSurveyPrivacyStatementPart(properties);
            };

            InThreadSurveyPrivacyStatementPart.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                    w.uint32(10).string(m.text);
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(18).string(m.url);
                return w;
            };

            InThreadSurveyPrivacyStatementPart.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.text = r.string();
                            break;
                        }
                    case 2: {
                            m.url = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InThreadSurveyPrivacyStatementPart.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart)
                    return d;
                var m = new $root.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart();
                if (d.text != null) {
                    m.text = String(d.text);
                }
                if (d.url != null) {
                    m.url = String(d.url);
                }
                return m;
            };

            InThreadSurveyPrivacyStatementPart.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.text != null && m.hasOwnProperty("text")) {
                    d.text = m.text;
                    if (o.oneofs)
                        d._text = "text";
                }
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                return d;
            };

            InThreadSurveyPrivacyStatementPart.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InThreadSurveyPrivacyStatementPart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart";
            };

            return InThreadSurveyPrivacyStatementPart;
        })();

        InThreadSurveyMetadata.InThreadSurveyQuestion = (function() {

            function InThreadSurveyQuestion(p) {
                this.questionOptions = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InThreadSurveyQuestion.prototype.questionText = null;
            InThreadSurveyQuestion.prototype.questionId = null;
            InThreadSurveyQuestion.prototype.questionOptions = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InThreadSurveyQuestion.prototype, "_questionText", {
                get: $util.oneOfGetter($oneOfFields = ["questionText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InThreadSurveyQuestion.prototype, "_questionId", {
                get: $util.oneOfGetter($oneOfFields = ["questionId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            InThreadSurveyQuestion.create = function create(properties) {
                return new InThreadSurveyQuestion(properties);
            };

            InThreadSurveyQuestion.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.questionText != null && Object.hasOwnProperty.call(m, "questionText"))
                    w.uint32(10).string(m.questionText);
                if (m.questionId != null && Object.hasOwnProperty.call(m, "questionId"))
                    w.uint32(18).string(m.questionId);
                if (m.questionOptions != null && m.questionOptions.length) {
                    for (var i = 0; i < m.questionOptions.length; ++i)
                        $root.proto.InThreadSurveyMetadata.InThreadSurveyOption.encode(m.questionOptions[i], w.uint32(26).fork()).ldelim();
                }
                return w;
            };

            InThreadSurveyQuestion.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.InThreadSurveyMetadata.InThreadSurveyQuestion();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.questionText = r.string();
                            break;
                        }
                    case 2: {
                            m.questionId = r.string();
                            break;
                        }
                    case 3: {
                            if (!(m.questionOptions && m.questionOptions.length))
                                m.questionOptions = [];
                            m.questionOptions.push($root.proto.InThreadSurveyMetadata.InThreadSurveyOption.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InThreadSurveyQuestion.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.InThreadSurveyMetadata.InThreadSurveyQuestion)
                    return d;
                var m = new $root.proto.InThreadSurveyMetadata.InThreadSurveyQuestion();
                if (d.questionText != null) {
                    m.questionText = String(d.questionText);
                }
                if (d.questionId != null) {
                    m.questionId = String(d.questionId);
                }
                if (d.questionOptions) {
                    if (!Array.isArray(d.questionOptions))
                        throw TypeError(".proto.InThreadSurveyMetadata.InThreadSurveyQuestion.questionOptions: array expected");
                    m.questionOptions = [];
                    for (var i = 0; i < d.questionOptions.length; ++i) {
                        if (typeof d.questionOptions[i] !== "object")
                            throw TypeError(".proto.InThreadSurveyMetadata.InThreadSurveyQuestion.questionOptions: object expected");
                        m.questionOptions[i] = $root.proto.InThreadSurveyMetadata.InThreadSurveyOption.fromObject(d.questionOptions[i]);
                    }
                }
                return m;
            };

            InThreadSurveyQuestion.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.questionOptions = [];
                }
                if (m.questionText != null && m.hasOwnProperty("questionText")) {
                    d.questionText = m.questionText;
                    if (o.oneofs)
                        d._questionText = "questionText";
                }
                if (m.questionId != null && m.hasOwnProperty("questionId")) {
                    d.questionId = m.questionId;
                    if (o.oneofs)
                        d._questionId = "questionId";
                }
                if (m.questionOptions && m.questionOptions.length) {
                    d.questionOptions = [];
                    for (var j = 0; j < m.questionOptions.length; ++j) {
                        d.questionOptions[j] = $root.proto.InThreadSurveyMetadata.InThreadSurveyOption.toObject(m.questionOptions[j], o);
                    }
                }
                return d;
            };

            InThreadSurveyQuestion.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InThreadSurveyQuestion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.InThreadSurveyMetadata.InThreadSurveyQuestion";
            };

            return InThreadSurveyQuestion;
        })();

        return InThreadSurveyMetadata;
    })();

    proto.InteractiveAnnotation = (function() {

        function InteractiveAnnotation(p) {
            this.polygonVertices = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        InteractiveAnnotation.prototype.polygonVertices = $util.emptyArray;
        InteractiveAnnotation.prototype.shouldSkipConfirmation = null;
        InteractiveAnnotation.prototype.embeddedContent = null;
        InteractiveAnnotation.prototype.statusLinkType = null;
        InteractiveAnnotation.prototype.location = null;
        InteractiveAnnotation.prototype.newsletter = null;
        InteractiveAnnotation.prototype.embeddedAction = null;
        InteractiveAnnotation.prototype.tapAction = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InteractiveAnnotation.prototype, "_shouldSkipConfirmation", {
            get: $util.oneOfGetter($oneOfFields = ["shouldSkipConfirmation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InteractiveAnnotation.prototype, "_embeddedContent", {
            get: $util.oneOfGetter($oneOfFields = ["embeddedContent"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InteractiveAnnotation.prototype, "_statusLinkType", {
            get: $util.oneOfGetter($oneOfFields = ["statusLinkType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Object.defineProperty(InteractiveAnnotation.prototype, "action", {
            get: $util.oneOfGetter($oneOfFields = ["location", "newsletter", "embeddedAction", "tapAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        InteractiveAnnotation.create = function create(properties) {
            return new InteractiveAnnotation(properties);
        };

        InteractiveAnnotation.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.polygonVertices != null && m.polygonVertices.length) {
                for (var i = 0; i < m.polygonVertices.length; ++i)
                    $root.proto.Point.encode(m.polygonVertices[i], w.uint32(10).fork()).ldelim();
            }
            if (m.location != null && Object.hasOwnProperty.call(m, "location"))
                $root.proto.Location.encode(m.location, w.uint32(18).fork()).ldelim();
            if (m.newsletter != null && Object.hasOwnProperty.call(m, "newsletter"))
                $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.encode(m.newsletter, w.uint32(26).fork()).ldelim();
            if (m.shouldSkipConfirmation != null && Object.hasOwnProperty.call(m, "shouldSkipConfirmation"))
                w.uint32(32).bool(m.shouldSkipConfirmation);
            if (m.embeddedContent != null && Object.hasOwnProperty.call(m, "embeddedContent"))
                $root.proto.EmbeddedContent.encode(m.embeddedContent, w.uint32(42).fork()).ldelim();
            if (m.embeddedAction != null && Object.hasOwnProperty.call(m, "embeddedAction"))
                w.uint32(48).bool(m.embeddedAction);
            if (m.tapAction != null && Object.hasOwnProperty.call(m, "tapAction"))
                $root.proto.TapLinkAction.encode(m.tapAction, w.uint32(58).fork()).ldelim();
            if (m.statusLinkType != null && Object.hasOwnProperty.call(m, "statusLinkType"))
                w.uint32(64).int32(m.statusLinkType);
            return w;
        };

        InteractiveAnnotation.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.InteractiveAnnotation();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.polygonVertices && m.polygonVertices.length))
                            m.polygonVertices = [];
                        m.polygonVertices.push($root.proto.Point.decode(r, r.uint32()));
                        break;
                    }
                case 4: {
                        m.shouldSkipConfirmation = r.bool();
                        break;
                    }
                case 5: {
                        m.embeddedContent = $root.proto.EmbeddedContent.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.statusLinkType = r.int32();
                        break;
                    }
                case 2: {
                        m.location = $root.proto.Location.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.newsletter = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(r, r.uint32());
                        break;
                    }
                case 6: {
                        m.embeddedAction = r.bool();
                        break;
                    }
                case 7: {
                        m.tapAction = $root.proto.TapLinkAction.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        InteractiveAnnotation.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.InteractiveAnnotation)
                return d;
            var m = new $root.proto.InteractiveAnnotation();
            if (d.polygonVertices) {
                if (!Array.isArray(d.polygonVertices))
                    throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected");
                m.polygonVertices = [];
                for (var i = 0; i < d.polygonVertices.length; ++i) {
                    if (typeof d.polygonVertices[i] !== "object")
                        throw TypeError(".proto.InteractiveAnnotation.polygonVertices: object expected");
                    m.polygonVertices[i] = $root.proto.Point.fromObject(d.polygonVertices[i]);
                }
            }
            if (d.shouldSkipConfirmation != null) {
                m.shouldSkipConfirmation = Boolean(d.shouldSkipConfirmation);
            }
            if (d.embeddedContent != null) {
                if (typeof d.embeddedContent !== "object")
                    throw TypeError(".proto.InteractiveAnnotation.embeddedContent: object expected");
                m.embeddedContent = $root.proto.EmbeddedContent.fromObject(d.embeddedContent);
            }
            switch (d.statusLinkType) {
            default:
                if (typeof d.statusLinkType === "number") {
                    m.statusLinkType = d.statusLinkType;
                    break;
                }
                break;
            case "RASTERIZED_LINK_PREVIEW":
            case 1:
                m.statusLinkType = 1;
                break;
            case "RASTERIZED_LINK_TRUNCATED":
            case 2:
                m.statusLinkType = 2;
                break;
            case "RASTERIZED_LINK_FULL_URL":
            case 3:
                m.statusLinkType = 3;
                break;
            }
            if (d.location != null) {
                if (typeof d.location !== "object")
                    throw TypeError(".proto.InteractiveAnnotation.location: object expected");
                m.location = $root.proto.Location.fromObject(d.location);
            }
            if (d.newsletter != null) {
                if (typeof d.newsletter !== "object")
                    throw TypeError(".proto.InteractiveAnnotation.newsletter: object expected");
                m.newsletter = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.fromObject(d.newsletter);
            }
            if (d.embeddedAction != null) {
                m.embeddedAction = Boolean(d.embeddedAction);
            }
            if (d.tapAction != null) {
                if (typeof d.tapAction !== "object")
                    throw TypeError(".proto.InteractiveAnnotation.tapAction: object expected");
                m.tapAction = $root.proto.TapLinkAction.fromObject(d.tapAction);
            }
            return m;
        };

        InteractiveAnnotation.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.polygonVertices = [];
            }
            if (m.polygonVertices && m.polygonVertices.length) {
                d.polygonVertices = [];
                for (var j = 0; j < m.polygonVertices.length; ++j) {
                    d.polygonVertices[j] = $root.proto.Point.toObject(m.polygonVertices[j], o);
                }
            }
            if (m.location != null && m.hasOwnProperty("location")) {
                d.location = $root.proto.Location.toObject(m.location, o);
                if (o.oneofs)
                    d.action = "location";
            }
            if (m.newsletter != null && m.hasOwnProperty("newsletter")) {
                d.newsletter = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.toObject(m.newsletter, o);
                if (o.oneofs)
                    d.action = "newsletter";
            }
            if (m.shouldSkipConfirmation != null && m.hasOwnProperty("shouldSkipConfirmation")) {
                d.shouldSkipConfirmation = m.shouldSkipConfirmation;
                if (o.oneofs)
                    d._shouldSkipConfirmation = "shouldSkipConfirmation";
            }
            if (m.embeddedContent != null && m.hasOwnProperty("embeddedContent")) {
                d.embeddedContent = $root.proto.EmbeddedContent.toObject(m.embeddedContent, o);
                if (o.oneofs)
                    d._embeddedContent = "embeddedContent";
            }
            if (m.embeddedAction != null && m.hasOwnProperty("embeddedAction")) {
                d.embeddedAction = m.embeddedAction;
                if (o.oneofs)
                    d.action = "embeddedAction";
            }
            if (m.tapAction != null && m.hasOwnProperty("tapAction")) {
                d.tapAction = $root.proto.TapLinkAction.toObject(m.tapAction, o);
                if (o.oneofs)
                    d.action = "tapAction";
            }
            if (m.statusLinkType != null && m.hasOwnProperty("statusLinkType")) {
                d.statusLinkType = o.enums === String ? $root.proto.InteractiveAnnotation.StatusLinkType[m.statusLinkType] === undefined ? m.statusLinkType : $root.proto.InteractiveAnnotation.StatusLinkType[m.statusLinkType] : m.statusLinkType;
                if (o.oneofs)
                    d._statusLinkType = "statusLinkType";
            }
            return d;
        };

        InteractiveAnnotation.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        InteractiveAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.InteractiveAnnotation";
        };

        InteractiveAnnotation.StatusLinkType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[1] = "RASTERIZED_LINK_PREVIEW"] = 1;
            values[valuesById[2] = "RASTERIZED_LINK_TRUNCATED"] = 2;
            values[valuesById[3] = "RASTERIZED_LINK_FULL_URL"] = 3;
            return values;
        })();

        return InteractiveAnnotation;
    })();

    proto.InteractiveMessageAdditionalMetadata = (function() {

        function InteractiveMessageAdditionalMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        InteractiveMessageAdditionalMetadata.prototype.isGalaxyFlowCompleted = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(InteractiveMessageAdditionalMetadata.prototype, "_isGalaxyFlowCompleted", {
            get: $util.oneOfGetter($oneOfFields = ["isGalaxyFlowCompleted"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        InteractiveMessageAdditionalMetadata.create = function create(properties) {
            return new InteractiveMessageAdditionalMetadata(properties);
        };

        InteractiveMessageAdditionalMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.isGalaxyFlowCompleted != null && Object.hasOwnProperty.call(m, "isGalaxyFlowCompleted"))
                w.uint32(8).bool(m.isGalaxyFlowCompleted);
            return w;
        };

        InteractiveMessageAdditionalMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.InteractiveMessageAdditionalMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.isGalaxyFlowCompleted = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        InteractiveMessageAdditionalMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.InteractiveMessageAdditionalMetadata)
                return d;
            var m = new $root.proto.InteractiveMessageAdditionalMetadata();
            if (d.isGalaxyFlowCompleted != null) {
                m.isGalaxyFlowCompleted = Boolean(d.isGalaxyFlowCompleted);
            }
            return m;
        };

        InteractiveMessageAdditionalMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.isGalaxyFlowCompleted != null && m.hasOwnProperty("isGalaxyFlowCompleted")) {
                d.isGalaxyFlowCompleted = m.isGalaxyFlowCompleted;
                if (o.oneofs)
                    d._isGalaxyFlowCompleted = "isGalaxyFlowCompleted";
            }
            return d;
        };

        InteractiveMessageAdditionalMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        InteractiveMessageAdditionalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.InteractiveMessageAdditionalMetadata";
        };

        return InteractiveMessageAdditionalMetadata;
    })();

    proto.KeepInChat = (function() {

        function KeepInChat(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        KeepInChat.prototype.keepType = null;
        KeepInChat.prototype.serverTimestamp = null;
        KeepInChat.prototype.key = null;
        KeepInChat.prototype.deviceJid = null;
        KeepInChat.prototype.clientTimestampMs = null;
        KeepInChat.prototype.serverTimestampMs = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeepInChat.prototype, "_keepType", {
            get: $util.oneOfGetter($oneOfFields = ["keepType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeepInChat.prototype, "_serverTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["serverTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeepInChat.prototype, "_key", {
            get: $util.oneOfGetter($oneOfFields = ["key"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeepInChat.prototype, "_deviceJid", {
            get: $util.oneOfGetter($oneOfFields = ["deviceJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeepInChat.prototype, "_clientTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["clientTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeepInChat.prototype, "_serverTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        KeepInChat.create = function create(properties) {
            return new KeepInChat(properties);
        };

        KeepInChat.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.keepType != null && Object.hasOwnProperty.call(m, "keepType"))
                w.uint32(8).int32(m.keepType);
            if (m.serverTimestamp != null && Object.hasOwnProperty.call(m, "serverTimestamp"))
                w.uint32(16).int64(m.serverTimestamp);
            if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                $root.proto.MessageKey.encode(m.key, w.uint32(26).fork()).ldelim();
            if (m.deviceJid != null && Object.hasOwnProperty.call(m, "deviceJid"))
                w.uint32(34).string(m.deviceJid);
            if (m.clientTimestampMs != null && Object.hasOwnProperty.call(m, "clientTimestampMs"))
                w.uint32(40).int64(m.clientTimestampMs);
            if (m.serverTimestampMs != null && Object.hasOwnProperty.call(m, "serverTimestampMs"))
                w.uint32(48).int64(m.serverTimestampMs);
            return w;
        };

        KeepInChat.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeepInChat();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.keepType = r.int32();
                        break;
                    }
                case 2: {
                        m.serverTimestamp = r.int64();
                        break;
                    }
                case 3: {
                        m.key = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.deviceJid = r.string();
                        break;
                    }
                case 5: {
                        m.clientTimestampMs = r.int64();
                        break;
                    }
                case 6: {
                        m.serverTimestampMs = r.int64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        KeepInChat.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.KeepInChat)
                return d;
            var m = new $root.proto.KeepInChat();
            switch (d.keepType) {
            default:
                if (typeof d.keepType === "number") {
                    m.keepType = d.keepType;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.keepType = 0;
                break;
            case "KEEP_FOR_ALL":
            case 1:
                m.keepType = 1;
                break;
            case "UNDO_KEEP_FOR_ALL":
            case 2:
                m.keepType = 2;
                break;
            }
            if (d.serverTimestamp != null) {
                if ($util.Long)
                    (m.serverTimestamp = $util.Long.fromValue(d.serverTimestamp)).unsigned = false;
                else if (typeof d.serverTimestamp === "string")
                    m.serverTimestamp = parseInt(d.serverTimestamp, 10);
                else if (typeof d.serverTimestamp === "number")
                    m.serverTimestamp = d.serverTimestamp;
                else if (typeof d.serverTimestamp === "object")
                    m.serverTimestamp = new $util.LongBits(d.serverTimestamp.low >>> 0, d.serverTimestamp.high >>> 0).toNumber();
            }
            if (d.key != null) {
                if (typeof d.key !== "object")
                    throw TypeError(".proto.KeepInChat.key: object expected");
                m.key = $root.proto.MessageKey.fromObject(d.key);
            }
            if (d.deviceJid != null) {
                m.deviceJid = String(d.deviceJid);
            }
            if (d.clientTimestampMs != null) {
                if ($util.Long)
                    (m.clientTimestampMs = $util.Long.fromValue(d.clientTimestampMs)).unsigned = false;
                else if (typeof d.clientTimestampMs === "string")
                    m.clientTimestampMs = parseInt(d.clientTimestampMs, 10);
                else if (typeof d.clientTimestampMs === "number")
                    m.clientTimestampMs = d.clientTimestampMs;
                else if (typeof d.clientTimestampMs === "object")
                    m.clientTimestampMs = new $util.LongBits(d.clientTimestampMs.low >>> 0, d.clientTimestampMs.high >>> 0).toNumber();
            }
            if (d.serverTimestampMs != null) {
                if ($util.Long)
                    (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false;
                else if (typeof d.serverTimestampMs === "string")
                    m.serverTimestampMs = parseInt(d.serverTimestampMs, 10);
                else if (typeof d.serverTimestampMs === "number")
                    m.serverTimestampMs = d.serverTimestampMs;
                else if (typeof d.serverTimestampMs === "object")
                    m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber();
            }
            return m;
        };

        KeepInChat.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.keepType != null && m.hasOwnProperty("keepType")) {
                d.keepType = o.enums === String ? $root.proto.KeepType[m.keepType] === undefined ? m.keepType : $root.proto.KeepType[m.keepType] : m.keepType;
                if (o.oneofs)
                    d._keepType = "keepType";
            }
            if (m.serverTimestamp != null && m.hasOwnProperty("serverTimestamp")) {
                if (typeof m.serverTimestamp === "number")
                    d.serverTimestamp = o.longs === String ? String(m.serverTimestamp) : m.serverTimestamp;
                else
                    d.serverTimestamp = o.longs === String ? longToString(m.serverTimestamp) : o.longs === Number ? longToNumber(m.serverTimestamp) : m.serverTimestamp;
                if (o.oneofs)
                    d._serverTimestamp = "serverTimestamp";
            }
            if (m.key != null && m.hasOwnProperty("key")) {
                d.key = $root.proto.MessageKey.toObject(m.key, o);
                if (o.oneofs)
                    d._key = "key";
            }
            if (m.deviceJid != null && m.hasOwnProperty("deviceJid")) {
                d.deviceJid = m.deviceJid;
                if (o.oneofs)
                    d._deviceJid = "deviceJid";
            }
            if (m.clientTimestampMs != null && m.hasOwnProperty("clientTimestampMs")) {
                if (typeof m.clientTimestampMs === "number")
                    d.clientTimestampMs = o.longs === String ? String(m.clientTimestampMs) : m.clientTimestampMs;
                else
                    d.clientTimestampMs = o.longs === String ? longToString(m.clientTimestampMs) : o.longs === Number ? longToNumber(m.clientTimestampMs) : m.clientTimestampMs;
                if (o.oneofs)
                    d._clientTimestampMs = "clientTimestampMs";
            }
            if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) {
                if (typeof m.serverTimestampMs === "number")
                    d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs;
                else
                    d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs;
                if (o.oneofs)
                    d._serverTimestampMs = "serverTimestampMs";
            }
            return d;
        };

        KeepInChat.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        KeepInChat.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.KeepInChat";
        };

        return KeepInChat;
    })();

    proto.KeepType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UNKNOWN"] = 0;
        values[valuesById[1] = "KEEP_FOR_ALL"] = 1;
        values[valuesById[2] = "UNDO_KEEP_FOR_ALL"] = 2;
        return values;
    })();

    proto.KeyExchangeMessage = (function() {

        function KeyExchangeMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        KeyExchangeMessage.prototype.id = null;
        KeyExchangeMessage.prototype.baseKey = null;
        KeyExchangeMessage.prototype.ratchetKey = null;
        KeyExchangeMessage.prototype.identityKey = null;
        KeyExchangeMessage.prototype.baseKeySignature = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeyExchangeMessage.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeyExchangeMessage.prototype, "_baseKey", {
            get: $util.oneOfGetter($oneOfFields = ["baseKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeyExchangeMessage.prototype, "_ratchetKey", {
            get: $util.oneOfGetter($oneOfFields = ["ratchetKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeyExchangeMessage.prototype, "_identityKey", {
            get: $util.oneOfGetter($oneOfFields = ["identityKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeyExchangeMessage.prototype, "_baseKeySignature", {
            get: $util.oneOfGetter($oneOfFields = ["baseKeySignature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        KeyExchangeMessage.create = function create(properties) {
            return new KeyExchangeMessage(properties);
        };

        KeyExchangeMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(8).uint32(m.id);
            if (m.baseKey != null && Object.hasOwnProperty.call(m, "baseKey"))
                w.uint32(18).bytes(m.baseKey);
            if (m.ratchetKey != null && Object.hasOwnProperty.call(m, "ratchetKey"))
                w.uint32(26).bytes(m.ratchetKey);
            if (m.identityKey != null && Object.hasOwnProperty.call(m, "identityKey"))
                w.uint32(34).bytes(m.identityKey);
            if (m.baseKeySignature != null && Object.hasOwnProperty.call(m, "baseKeySignature"))
                w.uint32(42).bytes(m.baseKeySignature);
            return w;
        };

        KeyExchangeMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyExchangeMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.uint32();
                        break;
                    }
                case 2: {
                        m.baseKey = r.bytes();
                        break;
                    }
                case 3: {
                        m.ratchetKey = r.bytes();
                        break;
                    }
                case 4: {
                        m.identityKey = r.bytes();
                        break;
                    }
                case 5: {
                        m.baseKeySignature = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        KeyExchangeMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.KeyExchangeMessage)
                return d;
            var m = new $root.proto.KeyExchangeMessage();
            if (d.id != null) {
                m.id = d.id >>> 0;
            }
            if (d.baseKey != null) {
                if (typeof d.baseKey === "string")
                    $util.base64.decode(d.baseKey, m.baseKey = $util.newBuffer($util.base64.length(d.baseKey)), 0);
                else if (d.baseKey.length >= 0)
                    m.baseKey = d.baseKey;
            }
            if (d.ratchetKey != null) {
                if (typeof d.ratchetKey === "string")
                    $util.base64.decode(d.ratchetKey, m.ratchetKey = $util.newBuffer($util.base64.length(d.ratchetKey)), 0);
                else if (d.ratchetKey.length >= 0)
                    m.ratchetKey = d.ratchetKey;
            }
            if (d.identityKey != null) {
                if (typeof d.identityKey === "string")
                    $util.base64.decode(d.identityKey, m.identityKey = $util.newBuffer($util.base64.length(d.identityKey)), 0);
                else if (d.identityKey.length >= 0)
                    m.identityKey = d.identityKey;
            }
            if (d.baseKeySignature != null) {
                if (typeof d.baseKeySignature === "string")
                    $util.base64.decode(d.baseKeySignature, m.baseKeySignature = $util.newBuffer($util.base64.length(d.baseKeySignature)), 0);
                else if (d.baseKeySignature.length >= 0)
                    m.baseKeySignature = d.baseKeySignature;
            }
            return m;
        };

        KeyExchangeMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            if (m.baseKey != null && m.hasOwnProperty("baseKey")) {
                d.baseKey = o.bytes === String ? $util.base64.encode(m.baseKey, 0, m.baseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKey) : m.baseKey;
                if (o.oneofs)
                    d._baseKey = "baseKey";
            }
            if (m.ratchetKey != null && m.hasOwnProperty("ratchetKey")) {
                d.ratchetKey = o.bytes === String ? $util.base64.encode(m.ratchetKey, 0, m.ratchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.ratchetKey) : m.ratchetKey;
                if (o.oneofs)
                    d._ratchetKey = "ratchetKey";
            }
            if (m.identityKey != null && m.hasOwnProperty("identityKey")) {
                d.identityKey = o.bytes === String ? $util.base64.encode(m.identityKey, 0, m.identityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.identityKey) : m.identityKey;
                if (o.oneofs)
                    d._identityKey = "identityKey";
            }
            if (m.baseKeySignature != null && m.hasOwnProperty("baseKeySignature")) {
                d.baseKeySignature = o.bytes === String ? $util.base64.encode(m.baseKeySignature, 0, m.baseKeySignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKeySignature) : m.baseKeySignature;
                if (o.oneofs)
                    d._baseKeySignature = "baseKeySignature";
            }
            return d;
        };

        KeyExchangeMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        KeyExchangeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.KeyExchangeMessage";
        };

        return KeyExchangeMessage;
    })();

    proto.KeyId = (function() {

        function KeyId(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        KeyId.prototype.id = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(KeyId.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        KeyId.create = function create(properties) {
            return new KeyId(properties);
        };

        KeyId.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(10).bytes(m.id);
            return w;
        };

        KeyId.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyId();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        KeyId.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.KeyId)
                return d;
            var m = new $root.proto.KeyId();
            if (d.id != null) {
                if (typeof d.id === "string")
                    $util.base64.decode(d.id, m.id = $util.newBuffer($util.base64.length(d.id)), 0);
                else if (d.id.length >= 0)
                    m.id = d.id;
            }
            return m;
        };

        KeyId.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = o.bytes === String ? $util.base64.encode(m.id, 0, m.id.length) : o.bytes === Array ? Array.prototype.slice.call(m.id) : m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            return d;
        };

        KeyId.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        KeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.KeyId";
        };

        return KeyId;
    })();

    proto.LIDMigrationMapping = (function() {

        function LIDMigrationMapping(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        LIDMigrationMapping.prototype.pn = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
        LIDMigrationMapping.prototype.assignedLid = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
        LIDMigrationMapping.prototype.latestLid = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LIDMigrationMapping.prototype, "_latestLid", {
            get: $util.oneOfGetter($oneOfFields = ["latestLid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        LIDMigrationMapping.create = function create(properties) {
            return new LIDMigrationMapping(properties);
        };

        LIDMigrationMapping.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.pn != null && Object.hasOwnProperty.call(m, "pn"))
                w.uint32(8).uint64(m.pn);
            if (m.assignedLid != null && Object.hasOwnProperty.call(m, "assignedLid"))
                w.uint32(16).uint64(m.assignedLid);
            if (m.latestLid != null && Object.hasOwnProperty.call(m, "latestLid"))
                w.uint32(24).uint64(m.latestLid);
            return w;
        };

        LIDMigrationMapping.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.LIDMigrationMapping();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.pn = r.uint64();
                        break;
                    }
                case 2: {
                        m.assignedLid = r.uint64();
                        break;
                    }
                case 3: {
                        m.latestLid = r.uint64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        LIDMigrationMapping.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.LIDMigrationMapping)
                return d;
            var m = new $root.proto.LIDMigrationMapping();
            if (d.pn != null) {
                if ($util.Long)
                    (m.pn = $util.Long.fromValue(d.pn)).unsigned = true;
                else if (typeof d.pn === "string")
                    m.pn = parseInt(d.pn, 10);
                else if (typeof d.pn === "number")
                    m.pn = d.pn;
                else if (typeof d.pn === "object")
                    m.pn = new $util.LongBits(d.pn.low >>> 0, d.pn.high >>> 0).toNumber(true);
            }
            if (d.assignedLid != null) {
                if ($util.Long)
                    (m.assignedLid = $util.Long.fromValue(d.assignedLid)).unsigned = true;
                else if (typeof d.assignedLid === "string")
                    m.assignedLid = parseInt(d.assignedLid, 10);
                else if (typeof d.assignedLid === "number")
                    m.assignedLid = d.assignedLid;
                else if (typeof d.assignedLid === "object")
                    m.assignedLid = new $util.LongBits(d.assignedLid.low >>> 0, d.assignedLid.high >>> 0).toNumber(true);
            }
            if (d.latestLid != null) {
                if ($util.Long)
                    (m.latestLid = $util.Long.fromValue(d.latestLid)).unsigned = true;
                else if (typeof d.latestLid === "string")
                    m.latestLid = parseInt(d.latestLid, 10);
                else if (typeof d.latestLid === "number")
                    m.latestLid = d.latestLid;
                else if (typeof d.latestLid === "object")
                    m.latestLid = new $util.LongBits(d.latestLid.low >>> 0, d.latestLid.high >>> 0).toNumber(true);
            }
            return m;
        };

        LIDMigrationMapping.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.pn = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.pn = o.longs === String ? "0" : 0;
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.assignedLid = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.assignedLid = o.longs === String ? "0" : 0;
            }
            if (m.pn != null && m.hasOwnProperty("pn")) {
                if (typeof m.pn === "number")
                    d.pn = o.longs === String ? String(m.pn) : m.pn;
                else
                    d.pn = o.longs === String ? longToString(m.pn, true) : o.longs === Number ? longToNumber(m.pn, true) : m.pn;
            }
            if (m.assignedLid != null && m.hasOwnProperty("assignedLid")) {
                if (typeof m.assignedLid === "number")
                    d.assignedLid = o.longs === String ? String(m.assignedLid) : m.assignedLid;
                else
                    d.assignedLid = o.longs === String ? longToString(m.assignedLid, true) : o.longs === Number ? longToNumber(m.assignedLid, true) : m.assignedLid;
            }
            if (m.latestLid != null && m.hasOwnProperty("latestLid")) {
                if (typeof m.latestLid === "number")
                    d.latestLid = o.longs === String ? String(m.latestLid) : m.latestLid;
                else
                    d.latestLid = o.longs === String ? longToString(m.latestLid, true) : o.longs === Number ? longToNumber(m.latestLid, true) : m.latestLid;
                if (o.oneofs)
                    d._latestLid = "latestLid";
            }
            return d;
        };

        LIDMigrationMapping.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        LIDMigrationMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.LIDMigrationMapping";
        };

        return LIDMigrationMapping;
    })();

    proto.LIDMigrationMappingSyncMessage = (function() {

        function LIDMigrationMappingSyncMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        LIDMigrationMappingSyncMessage.prototype.encodedMappingPayload = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LIDMigrationMappingSyncMessage.prototype, "_encodedMappingPayload", {
            get: $util.oneOfGetter($oneOfFields = ["encodedMappingPayload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        LIDMigrationMappingSyncMessage.create = function create(properties) {
            return new LIDMigrationMappingSyncMessage(properties);
        };

        LIDMigrationMappingSyncMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.encodedMappingPayload != null && Object.hasOwnProperty.call(m, "encodedMappingPayload"))
                w.uint32(10).bytes(m.encodedMappingPayload);
            return w;
        };

        LIDMigrationMappingSyncMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.LIDMigrationMappingSyncMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.encodedMappingPayload = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        LIDMigrationMappingSyncMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.LIDMigrationMappingSyncMessage)
                return d;
            var m = new $root.proto.LIDMigrationMappingSyncMessage();
            if (d.encodedMappingPayload != null) {
                if (typeof d.encodedMappingPayload === "string")
                    $util.base64.decode(d.encodedMappingPayload, m.encodedMappingPayload = $util.newBuffer($util.base64.length(d.encodedMappingPayload)), 0);
                else if (d.encodedMappingPayload.length >= 0)
                    m.encodedMappingPayload = d.encodedMappingPayload;
            }
            return m;
        };

        LIDMigrationMappingSyncMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.encodedMappingPayload != null && m.hasOwnProperty("encodedMappingPayload")) {
                d.encodedMappingPayload = o.bytes === String ? $util.base64.encode(m.encodedMappingPayload, 0, m.encodedMappingPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encodedMappingPayload) : m.encodedMappingPayload;
                if (o.oneofs)
                    d._encodedMappingPayload = "encodedMappingPayload";
            }
            return d;
        };

        LIDMigrationMappingSyncMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        LIDMigrationMappingSyncMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.LIDMigrationMappingSyncMessage";
        };

        return LIDMigrationMappingSyncMessage;
    })();

    proto.LIDMigrationMappingSyncPayload = (function() {

        function LIDMigrationMappingSyncPayload(p) {
            this.pnToLidMappings = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        LIDMigrationMappingSyncPayload.prototype.pnToLidMappings = $util.emptyArray;
        LIDMigrationMappingSyncPayload.prototype.chatDbMigrationTimestamp = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LIDMigrationMappingSyncPayload.prototype, "_chatDbMigrationTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["chatDbMigrationTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        LIDMigrationMappingSyncPayload.create = function create(properties) {
            return new LIDMigrationMappingSyncPayload(properties);
        };

        LIDMigrationMappingSyncPayload.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.pnToLidMappings != null && m.pnToLidMappings.length) {
                for (var i = 0; i < m.pnToLidMappings.length; ++i)
                    $root.proto.LIDMigrationMapping.encode(m.pnToLidMappings[i], w.uint32(10).fork()).ldelim();
            }
            if (m.chatDbMigrationTimestamp != null && Object.hasOwnProperty.call(m, "chatDbMigrationTimestamp"))
                w.uint32(16).uint64(m.chatDbMigrationTimestamp);
            return w;
        };

        LIDMigrationMappingSyncPayload.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.LIDMigrationMappingSyncPayload();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.pnToLidMappings && m.pnToLidMappings.length))
                            m.pnToLidMappings = [];
                        m.pnToLidMappings.push($root.proto.LIDMigrationMapping.decode(r, r.uint32()));
                        break;
                    }
                case 2: {
                        m.chatDbMigrationTimestamp = r.uint64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        LIDMigrationMappingSyncPayload.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.LIDMigrationMappingSyncPayload)
                return d;
            var m = new $root.proto.LIDMigrationMappingSyncPayload();
            if (d.pnToLidMappings) {
                if (!Array.isArray(d.pnToLidMappings))
                    throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: array expected");
                m.pnToLidMappings = [];
                for (var i = 0; i < d.pnToLidMappings.length; ++i) {
                    if (typeof d.pnToLidMappings[i] !== "object")
                        throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: object expected");
                    m.pnToLidMappings[i] = $root.proto.LIDMigrationMapping.fromObject(d.pnToLidMappings[i]);
                }
            }
            if (d.chatDbMigrationTimestamp != null) {
                if ($util.Long)
                    (m.chatDbMigrationTimestamp = $util.Long.fromValue(d.chatDbMigrationTimestamp)).unsigned = true;
                else if (typeof d.chatDbMigrationTimestamp === "string")
                    m.chatDbMigrationTimestamp = parseInt(d.chatDbMigrationTimestamp, 10);
                else if (typeof d.chatDbMigrationTimestamp === "number")
                    m.chatDbMigrationTimestamp = d.chatDbMigrationTimestamp;
                else if (typeof d.chatDbMigrationTimestamp === "object")
                    m.chatDbMigrationTimestamp = new $util.LongBits(d.chatDbMigrationTimestamp.low >>> 0, d.chatDbMigrationTimestamp.high >>> 0).toNumber(true);
            }
            return m;
        };

        LIDMigrationMappingSyncPayload.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.pnToLidMappings = [];
            }
            if (m.pnToLidMappings && m.pnToLidMappings.length) {
                d.pnToLidMappings = [];
                for (var j = 0; j < m.pnToLidMappings.length; ++j) {
                    d.pnToLidMappings[j] = $root.proto.LIDMigrationMapping.toObject(m.pnToLidMappings[j], o);
                }
            }
            if (m.chatDbMigrationTimestamp != null && m.hasOwnProperty("chatDbMigrationTimestamp")) {
                if (typeof m.chatDbMigrationTimestamp === "number")
                    d.chatDbMigrationTimestamp = o.longs === String ? String(m.chatDbMigrationTimestamp) : m.chatDbMigrationTimestamp;
                else
                    d.chatDbMigrationTimestamp = o.longs === String ? longToString(m.chatDbMigrationTimestamp, true) : o.longs === Number ? longToNumber(m.chatDbMigrationTimestamp, true) : m.chatDbMigrationTimestamp;
                if (o.oneofs)
                    d._chatDbMigrationTimestamp = "chatDbMigrationTimestamp";
            }
            return d;
        };

        LIDMigrationMappingSyncPayload.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        LIDMigrationMappingSyncPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.LIDMigrationMappingSyncPayload";
        };

        return LIDMigrationMappingSyncPayload;
    })();

    proto.LegacyMessage = (function() {

        function LegacyMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        LegacyMessage.prototype.eventResponseMessage = null;
        LegacyMessage.prototype.pollVote = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LegacyMessage.prototype, "_eventResponseMessage", {
            get: $util.oneOfGetter($oneOfFields = ["eventResponseMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LegacyMessage.prototype, "_pollVote", {
            get: $util.oneOfGetter($oneOfFields = ["pollVote"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        LegacyMessage.create = function create(properties) {
            return new LegacyMessage(properties);
        };

        LegacyMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.eventResponseMessage != null && Object.hasOwnProperty.call(m, "eventResponseMessage"))
                $root.proto.Message.EventResponseMessage.encode(m.eventResponseMessage, w.uint32(10).fork()).ldelim();
            if (m.pollVote != null && Object.hasOwnProperty.call(m, "pollVote"))
                $root.proto.Message.PollVoteMessage.encode(m.pollVote, w.uint32(18).fork()).ldelim();
            return w;
        };

        LegacyMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.LegacyMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.eventResponseMessage = $root.proto.Message.EventResponseMessage.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.pollVote = $root.proto.Message.PollVoteMessage.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        LegacyMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.LegacyMessage)
                return d;
            var m = new $root.proto.LegacyMessage();
            if (d.eventResponseMessage != null) {
                if (typeof d.eventResponseMessage !== "object")
                    throw TypeError(".proto.LegacyMessage.eventResponseMessage: object expected");
                m.eventResponseMessage = $root.proto.Message.EventResponseMessage.fromObject(d.eventResponseMessage);
            }
            if (d.pollVote != null) {
                if (typeof d.pollVote !== "object")
                    throw TypeError(".proto.LegacyMessage.pollVote: object expected");
                m.pollVote = $root.proto.Message.PollVoteMessage.fromObject(d.pollVote);
            }
            return m;
        };

        LegacyMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.eventResponseMessage != null && m.hasOwnProperty("eventResponseMessage")) {
                d.eventResponseMessage = $root.proto.Message.EventResponseMessage.toObject(m.eventResponseMessage, o);
                if (o.oneofs)
                    d._eventResponseMessage = "eventResponseMessage";
            }
            if (m.pollVote != null && m.hasOwnProperty("pollVote")) {
                d.pollVote = $root.proto.Message.PollVoteMessage.toObject(m.pollVote, o);
                if (o.oneofs)
                    d._pollVote = "pollVote";
            }
            return d;
        };

        LegacyMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        LegacyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.LegacyMessage";
        };

        return LegacyMessage;
    })();

    proto.LimitSharing = (function() {

        function LimitSharing(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        LimitSharing.prototype.sharingLimited = null;
        LimitSharing.prototype.trigger = null;
        LimitSharing.prototype.limitSharingSettingTimestamp = null;
        LimitSharing.prototype.initiatedByMe = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LimitSharing.prototype, "_sharingLimited", {
            get: $util.oneOfGetter($oneOfFields = ["sharingLimited"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LimitSharing.prototype, "_trigger", {
            get: $util.oneOfGetter($oneOfFields = ["trigger"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LimitSharing.prototype, "_limitSharingSettingTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["limitSharingSettingTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LimitSharing.prototype, "_initiatedByMe", {
            get: $util.oneOfGetter($oneOfFields = ["initiatedByMe"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        LimitSharing.create = function create(properties) {
            return new LimitSharing(properties);
        };

        LimitSharing.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.sharingLimited != null && Object.hasOwnProperty.call(m, "sharingLimited"))
                w.uint32(8).bool(m.sharingLimited);
            if (m.trigger != null && Object.hasOwnProperty.call(m, "trigger"))
                w.uint32(16).int32(m.trigger);
            if (m.limitSharingSettingTimestamp != null && Object.hasOwnProperty.call(m, "limitSharingSettingTimestamp"))
                w.uint32(24).int64(m.limitSharingSettingTimestamp);
            if (m.initiatedByMe != null && Object.hasOwnProperty.call(m, "initiatedByMe"))
                w.uint32(32).bool(m.initiatedByMe);
            return w;
        };

        LimitSharing.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.LimitSharing();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.sharingLimited = r.bool();
                        break;
                    }
                case 2: {
                        m.trigger = r.int32();
                        break;
                    }
                case 3: {
                        m.limitSharingSettingTimestamp = r.int64();
                        break;
                    }
                case 4: {
                        m.initiatedByMe = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        LimitSharing.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.LimitSharing)
                return d;
            var m = new $root.proto.LimitSharing();
            if (d.sharingLimited != null) {
                m.sharingLimited = Boolean(d.sharingLimited);
            }
            switch (d.trigger) {
            default:
                if (typeof d.trigger === "number") {
                    m.trigger = d.trigger;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.trigger = 0;
                break;
            case "CHAT_SETTING":
            case 1:
                m.trigger = 1;
                break;
            case "BIZ_SUPPORTS_FB_HOSTING":
            case 2:
                m.trigger = 2;
                break;
            case "UNKNOWN_GROUP":
            case 3:
                m.trigger = 3;
                break;
            }
            if (d.limitSharingSettingTimestamp != null) {
                if ($util.Long)
                    (m.limitSharingSettingTimestamp = $util.Long.fromValue(d.limitSharingSettingTimestamp)).unsigned = false;
                else if (typeof d.limitSharingSettingTimestamp === "string")
                    m.limitSharingSettingTimestamp = parseInt(d.limitSharingSettingTimestamp, 10);
                else if (typeof d.limitSharingSettingTimestamp === "number")
                    m.limitSharingSettingTimestamp = d.limitSharingSettingTimestamp;
                else if (typeof d.limitSharingSettingTimestamp === "object")
                    m.limitSharingSettingTimestamp = new $util.LongBits(d.limitSharingSettingTimestamp.low >>> 0, d.limitSharingSettingTimestamp.high >>> 0).toNumber();
            }
            if (d.initiatedByMe != null) {
                m.initiatedByMe = Boolean(d.initiatedByMe);
            }
            return m;
        };

        LimitSharing.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.sharingLimited != null && m.hasOwnProperty("sharingLimited")) {
                d.sharingLimited = m.sharingLimited;
                if (o.oneofs)
                    d._sharingLimited = "sharingLimited";
            }
            if (m.trigger != null && m.hasOwnProperty("trigger")) {
                d.trigger = o.enums === String ? $root.proto.LimitSharing.TriggerType[m.trigger] === undefined ? m.trigger : $root.proto.LimitSharing.TriggerType[m.trigger] : m.trigger;
                if (o.oneofs)
                    d._trigger = "trigger";
            }
            if (m.limitSharingSettingTimestamp != null && m.hasOwnProperty("limitSharingSettingTimestamp")) {
                if (typeof m.limitSharingSettingTimestamp === "number")
                    d.limitSharingSettingTimestamp = o.longs === String ? String(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp;
                else
                    d.limitSharingSettingTimestamp = o.longs === String ? longToString(m.limitSharingSettingTimestamp) : o.longs === Number ? longToNumber(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp;
                if (o.oneofs)
                    d._limitSharingSettingTimestamp = "limitSharingSettingTimestamp";
            }
            if (m.initiatedByMe != null && m.hasOwnProperty("initiatedByMe")) {
                d.initiatedByMe = m.initiatedByMe;
                if (o.oneofs)
                    d._initiatedByMe = "initiatedByMe";
            }
            return d;
        };

        LimitSharing.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        LimitSharing.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.LimitSharing";
        };

        LimitSharing.TriggerType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "CHAT_SETTING"] = 1;
            values[valuesById[2] = "BIZ_SUPPORTS_FB_HOSTING"] = 2;
            values[valuesById[3] = "UNKNOWN_GROUP"] = 3;
            return values;
        })();

        return LimitSharing;
    })();

    proto.LocalizedName = (function() {

        function LocalizedName(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        LocalizedName.prototype.lg = null;
        LocalizedName.prototype.lc = null;
        LocalizedName.prototype.verifiedName = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LocalizedName.prototype, "_lg", {
            get: $util.oneOfGetter($oneOfFields = ["lg"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LocalizedName.prototype, "_lc", {
            get: $util.oneOfGetter($oneOfFields = ["lc"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(LocalizedName.prototype, "_verifiedName", {
            get: $util.oneOfGetter($oneOfFields = ["verifiedName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        LocalizedName.create = function create(properties) {
            return new LocalizedName(properties);
        };

        LocalizedName.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.lg != null && Object.hasOwnProperty.call(m, "lg"))
                w.uint32(10).string(m.lg);
            if (m.lc != null && Object.hasOwnProperty.call(m, "lc"))
                w.uint32(18).string(m.lc);
            if (m.verifiedName != null && Object.hasOwnProperty.call(m, "verifiedName"))
                w.uint32(26).string(m.verifiedName);
            return w;
        };

        LocalizedName.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.LocalizedName();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.lg = r.string();
                        break;
                    }
                case 2: {
                        m.lc = r.string();
                        break;
                    }
                case 3: {
                        m.verifiedName = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        LocalizedName.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.LocalizedName)
                return d;
            var m = new $root.proto.LocalizedName();
            if (d.lg != null) {
                m.lg = String(d.lg);
            }
            if (d.lc != null) {
                m.lc = String(d.lc);
            }
            if (d.verifiedName != null) {
                m.verifiedName = String(d.verifiedName);
            }
            return m;
        };

        LocalizedName.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.lg != null && m.hasOwnProperty("lg")) {
                d.lg = m.lg;
                if (o.oneofs)
                    d._lg = "lg";
            }
            if (m.lc != null && m.hasOwnProperty("lc")) {
                d.lc = m.lc;
                if (o.oneofs)
                    d._lc = "lc";
            }
            if (m.verifiedName != null && m.hasOwnProperty("verifiedName")) {
                d.verifiedName = m.verifiedName;
                if (o.oneofs)
                    d._verifiedName = "verifiedName";
            }
            return d;
        };

        LocalizedName.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        LocalizedName.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.LocalizedName";
        };

        return LocalizedName;
    })();

    proto.Location = (function() {

        function Location(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Location.prototype.degreesLatitude = null;
        Location.prototype.degreesLongitude = null;
        Location.prototype.name = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Location.prototype, "_degreesLatitude", {
            get: $util.oneOfGetter($oneOfFields = ["degreesLatitude"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Location.prototype, "_degreesLongitude", {
            get: $util.oneOfGetter($oneOfFields = ["degreesLongitude"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Location.prototype, "_name", {
            get: $util.oneOfGetter($oneOfFields = ["name"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Location.create = function create(properties) {
            return new Location(properties);
        };

        Location.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.degreesLatitude != null && Object.hasOwnProperty.call(m, "degreesLatitude"))
                w.uint32(9).double(m.degreesLatitude);
            if (m.degreesLongitude != null && Object.hasOwnProperty.call(m, "degreesLongitude"))
                w.uint32(17).double(m.degreesLongitude);
            if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                w.uint32(26).string(m.name);
            return w;
        };

        Location.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Location();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.degreesLatitude = r.double();
                        break;
                    }
                case 2: {
                        m.degreesLongitude = r.double();
                        break;
                    }
                case 3: {
                        m.name = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Location.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Location)
                return d;
            var m = new $root.proto.Location();
            if (d.degreesLatitude != null) {
                m.degreesLatitude = Number(d.degreesLatitude);
            }
            if (d.degreesLongitude != null) {
                m.degreesLongitude = Number(d.degreesLongitude);
            }
            if (d.name != null) {
                m.name = String(d.name);
            }
            return m;
        };

        Location.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.degreesLatitude != null && m.hasOwnProperty("degreesLatitude")) {
                d.degreesLatitude = o.json && !isFinite(m.degreesLatitude) ? String(m.degreesLatitude) : m.degreesLatitude;
                if (o.oneofs)
                    d._degreesLatitude = "degreesLatitude";
            }
            if (m.degreesLongitude != null && m.hasOwnProperty("degreesLongitude")) {
                d.degreesLongitude = o.json && !isFinite(m.degreesLongitude) ? String(m.degreesLongitude) : m.degreesLongitude;
                if (o.oneofs)
                    d._degreesLongitude = "degreesLongitude";
            }
            if (m.name != null && m.hasOwnProperty("name")) {
                d.name = m.name;
                if (o.oneofs)
                    d._name = "name";
            }
            return d;
        };

        Location.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Location";
        };

        return Location;
    })();

    proto.MediaData = (function() {

        function MediaData(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MediaData.prototype.localPath = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MediaData.prototype, "_localPath", {
            get: $util.oneOfGetter($oneOfFields = ["localPath"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MediaData.create = function create(properties) {
            return new MediaData(properties);
        };

        MediaData.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.localPath != null && Object.hasOwnProperty.call(m, "localPath"))
                w.uint32(10).string(m.localPath);
            return w;
        };

        MediaData.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MediaData();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.localPath = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MediaData.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MediaData)
                return d;
            var m = new $root.proto.MediaData();
            if (d.localPath != null) {
                m.localPath = String(d.localPath);
            }
            return m;
        };

        MediaData.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.localPath != null && m.hasOwnProperty("localPath")) {
                d.localPath = m.localPath;
                if (o.oneofs)
                    d._localPath = "localPath";
            }
            return d;
        };

        MediaData.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MediaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MediaData";
        };

        return MediaData;
    })();

    proto.MediaNotifyMessage = (function() {

        function MediaNotifyMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MediaNotifyMessage.prototype.expressPathUrl = null;
        MediaNotifyMessage.prototype.fileEncSha256 = null;
        MediaNotifyMessage.prototype.fileLength = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MediaNotifyMessage.prototype, "_expressPathUrl", {
            get: $util.oneOfGetter($oneOfFields = ["expressPathUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MediaNotifyMessage.prototype, "_fileEncSha256", {
            get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MediaNotifyMessage.prototype, "_fileLength", {
            get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MediaNotifyMessage.create = function create(properties) {
            return new MediaNotifyMessage(properties);
        };

        MediaNotifyMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.expressPathUrl != null && Object.hasOwnProperty.call(m, "expressPathUrl"))
                w.uint32(10).string(m.expressPathUrl);
            if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                w.uint32(18).bytes(m.fileEncSha256);
            if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                w.uint32(24).uint64(m.fileLength);
            return w;
        };

        MediaNotifyMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MediaNotifyMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.expressPathUrl = r.string();
                        break;
                    }
                case 2: {
                        m.fileEncSha256 = r.bytes();
                        break;
                    }
                case 3: {
                        m.fileLength = r.uint64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MediaNotifyMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MediaNotifyMessage)
                return d;
            var m = new $root.proto.MediaNotifyMessage();
            if (d.expressPathUrl != null) {
                m.expressPathUrl = String(d.expressPathUrl);
            }
            if (d.fileEncSha256 != null) {
                if (typeof d.fileEncSha256 === "string")
                    $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                else if (d.fileEncSha256.length >= 0)
                    m.fileEncSha256 = d.fileEncSha256;
            }
            if (d.fileLength != null) {
                if ($util.Long)
                    (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                else if (typeof d.fileLength === "string")
                    m.fileLength = parseInt(d.fileLength, 10);
                else if (typeof d.fileLength === "number")
                    m.fileLength = d.fileLength;
                else if (typeof d.fileLength === "object")
                    m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
            }
            return m;
        };

        MediaNotifyMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.expressPathUrl != null && m.hasOwnProperty("expressPathUrl")) {
                d.expressPathUrl = m.expressPathUrl;
                if (o.oneofs)
                    d._expressPathUrl = "expressPathUrl";
            }
            if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                if (o.oneofs)
                    d._fileEncSha256 = "fileEncSha256";
            }
            if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                if (typeof m.fileLength === "number")
                    d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                else
                    d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                if (o.oneofs)
                    d._fileLength = "fileLength";
            }
            return d;
        };

        MediaNotifyMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MediaNotifyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MediaNotifyMessage";
        };

        return MediaNotifyMessage;
    })();

    proto.MediaRetryNotification = (function() {

        function MediaRetryNotification(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MediaRetryNotification.prototype.stanzaId = null;
        MediaRetryNotification.prototype.directPath = null;
        MediaRetryNotification.prototype.result = null;
        MediaRetryNotification.prototype.messageSecret = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MediaRetryNotification.prototype, "_stanzaId", {
            get: $util.oneOfGetter($oneOfFields = ["stanzaId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MediaRetryNotification.prototype, "_directPath", {
            get: $util.oneOfGetter($oneOfFields = ["directPath"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MediaRetryNotification.prototype, "_result", {
            get: $util.oneOfGetter($oneOfFields = ["result"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MediaRetryNotification.prototype, "_messageSecret", {
            get: $util.oneOfGetter($oneOfFields = ["messageSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MediaRetryNotification.create = function create(properties) {
            return new MediaRetryNotification(properties);
        };

        MediaRetryNotification.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.stanzaId != null && Object.hasOwnProperty.call(m, "stanzaId"))
                w.uint32(10).string(m.stanzaId);
            if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                w.uint32(18).string(m.directPath);
            if (m.result != null && Object.hasOwnProperty.call(m, "result"))
                w.uint32(24).int32(m.result);
            if (m.messageSecret != null && Object.hasOwnProperty.call(m, "messageSecret"))
                w.uint32(34).bytes(m.messageSecret);
            return w;
        };

        MediaRetryNotification.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MediaRetryNotification();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.stanzaId = r.string();
                        break;
                    }
                case 2: {
                        m.directPath = r.string();
                        break;
                    }
                case 3: {
                        m.result = r.int32();
                        break;
                    }
                case 4: {
                        m.messageSecret = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MediaRetryNotification.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MediaRetryNotification)
                return d;
            var m = new $root.proto.MediaRetryNotification();
            if (d.stanzaId != null) {
                m.stanzaId = String(d.stanzaId);
            }
            if (d.directPath != null) {
                m.directPath = String(d.directPath);
            }
            switch (d.result) {
            default:
                if (typeof d.result === "number") {
                    m.result = d.result;
                    break;
                }
                break;
            case "GENERAL_ERROR":
            case 0:
                m.result = 0;
                break;
            case "SUCCESS":
            case 1:
                m.result = 1;
                break;
            case "NOT_FOUND":
            case 2:
                m.result = 2;
                break;
            case "DECRYPTION_ERROR":
            case 3:
                m.result = 3;
                break;
            }
            if (d.messageSecret != null) {
                if (typeof d.messageSecret === "string")
                    $util.base64.decode(d.messageSecret, m.messageSecret = $util.newBuffer($util.base64.length(d.messageSecret)), 0);
                else if (d.messageSecret.length >= 0)
                    m.messageSecret = d.messageSecret;
            }
            return m;
        };

        MediaRetryNotification.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) {
                d.stanzaId = m.stanzaId;
                if (o.oneofs)
                    d._stanzaId = "stanzaId";
            }
            if (m.directPath != null && m.hasOwnProperty("directPath")) {
                d.directPath = m.directPath;
                if (o.oneofs)
                    d._directPath = "directPath";
            }
            if (m.result != null && m.hasOwnProperty("result")) {
                d.result = o.enums === String ? $root.proto.MediaRetryNotification.ResultType[m.result] === undefined ? m.result : $root.proto.MediaRetryNotification.ResultType[m.result] : m.result;
                if (o.oneofs)
                    d._result = "result";
            }
            if (m.messageSecret != null && m.hasOwnProperty("messageSecret")) {
                d.messageSecret = o.bytes === String ? $util.base64.encode(m.messageSecret, 0, m.messageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.messageSecret) : m.messageSecret;
                if (o.oneofs)
                    d._messageSecret = "messageSecret";
            }
            return d;
        };

        MediaRetryNotification.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MediaRetryNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MediaRetryNotification";
        };

        MediaRetryNotification.ResultType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "GENERAL_ERROR"] = 0;
            values[valuesById[1] = "SUCCESS"] = 1;
            values[valuesById[2] = "NOT_FOUND"] = 2;
            values[valuesById[3] = "DECRYPTION_ERROR"] = 3;
            return values;
        })();

        return MediaRetryNotification;
    })();

    proto.MediaVisibility = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "DEFAULT"] = 0;
        values[valuesById[1] = "OFF"] = 1;
        values[valuesById[2] = "ON"] = 2;
        return values;
    })();

    proto.MemberLabel = (function() {

        function MemberLabel(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MemberLabel.prototype.label = null;
        MemberLabel.prototype.labelTimestamp = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MemberLabel.prototype, "_label", {
            get: $util.oneOfGetter($oneOfFields = ["label"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MemberLabel.prototype, "_labelTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["labelTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MemberLabel.create = function create(properties) {
            return new MemberLabel(properties);
        };

        MemberLabel.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.label != null && Object.hasOwnProperty.call(m, "label"))
                w.uint32(10).string(m.label);
            if (m.labelTimestamp != null && Object.hasOwnProperty.call(m, "labelTimestamp"))
                w.uint32(16).int64(m.labelTimestamp);
            return w;
        };

        MemberLabel.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MemberLabel();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.label = r.string();
                        break;
                    }
                case 2: {
                        m.labelTimestamp = r.int64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MemberLabel.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MemberLabel)
                return d;
            var m = new $root.proto.MemberLabel();
            if (d.label != null) {
                m.label = String(d.label);
            }
            if (d.labelTimestamp != null) {
                if ($util.Long)
                    (m.labelTimestamp = $util.Long.fromValue(d.labelTimestamp)).unsigned = false;
                else if (typeof d.labelTimestamp === "string")
                    m.labelTimestamp = parseInt(d.labelTimestamp, 10);
                else if (typeof d.labelTimestamp === "number")
                    m.labelTimestamp = d.labelTimestamp;
                else if (typeof d.labelTimestamp === "object")
                    m.labelTimestamp = new $util.LongBits(d.labelTimestamp.low >>> 0, d.labelTimestamp.high >>> 0).toNumber();
            }
            return m;
        };

        MemberLabel.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.label != null && m.hasOwnProperty("label")) {
                d.label = m.label;
                if (o.oneofs)
                    d._label = "label";
            }
            if (m.labelTimestamp != null && m.hasOwnProperty("labelTimestamp")) {
                if (typeof m.labelTimestamp === "number")
                    d.labelTimestamp = o.longs === String ? String(m.labelTimestamp) : m.labelTimestamp;
                else
                    d.labelTimestamp = o.longs === String ? longToString(m.labelTimestamp) : o.longs === Number ? longToNumber(m.labelTimestamp) : m.labelTimestamp;
                if (o.oneofs)
                    d._labelTimestamp = "labelTimestamp";
            }
            return d;
        };

        MemberLabel.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MemberLabel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MemberLabel";
        };

        return MemberLabel;
    })();

    proto.Message = (function() {

        function Message(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Message.prototype.conversation = null;
        Message.prototype.senderKeyDistributionMessage = null;
        Message.prototype.imageMessage = null;
        Message.prototype.contactMessage = null;
        Message.prototype.locationMessage = null;
        Message.prototype.extendedTextMessage = null;
        Message.prototype.documentMessage = null;
        Message.prototype.audioMessage = null;
        Message.prototype.videoMessage = null;
        Message.prototype.call = null;
        Message.prototype.chat = null;
        Message.prototype.protocolMessage = null;
        Message.prototype.contactsArrayMessage = null;
        Message.prototype.highlyStructuredMessage = null;
        Message.prototype.fastRatchetKeySenderKeyDistributionMessage = null;
        Message.prototype.sendPaymentMessage = null;
        Message.prototype.liveLocationMessage = null;
        Message.prototype.requestPaymentMessage = null;
        Message.prototype.declinePaymentRequestMessage = null;
        Message.prototype.cancelPaymentRequestMessage = null;
        Message.prototype.templateMessage = null;
        Message.prototype.stickerMessage = null;
        Message.prototype.groupInviteMessage = null;
        Message.prototype.templateButtonReplyMessage = null;
        Message.prototype.productMessage = null;
        Message.prototype.deviceSentMessage = null;
        Message.prototype.messageContextInfo = null;
        Message.prototype.listMessage = null;
        Message.prototype.viewOnceMessage = null;
        Message.prototype.orderMessage = null;
        Message.prototype.listResponseMessage = null;
        Message.prototype.ephemeralMessage = null;
        Message.prototype.invoiceMessage = null;
        Message.prototype.buttonsMessage = null;
        Message.prototype.buttonsResponseMessage = null;
        Message.prototype.paymentInviteMessage = null;
        Message.prototype.interactiveMessage = null;
        Message.prototype.reactionMessage = null;
        Message.prototype.stickerSyncRmrMessage = null;
        Message.prototype.interactiveResponseMessage = null;
        Message.prototype.pollCreationMessage = null;
        Message.prototype.pollUpdateMessage = null;
        Message.prototype.keepInChatMessage = null;
        Message.prototype.documentWithCaptionMessage = null;
        Message.prototype.requestPhoneNumberMessage = null;
        Message.prototype.viewOnceMessageV2 = null;
        Message.prototype.encReactionMessage = null;
        Message.prototype.editedMessage = null;
        Message.prototype.viewOnceMessageV2Extension = null;
        Message.prototype.pollCreationMessageV2 = null;
        Message.prototype.scheduledCallCreationMessage = null;
        Message.prototype.groupMentionedMessage = null;
        Message.prototype.pinInChatMessage = null;
        Message.prototype.pollCreationMessageV3 = null;
        Message.prototype.scheduledCallEditMessage = null;
        Message.prototype.ptvMessage = null;
        Message.prototype.botInvokeMessage = null;
        Message.prototype.callLogMesssage = null;
        Message.prototype.messageHistoryBundle = null;
        Message.prototype.encCommentMessage = null;
        Message.prototype.bcallMessage = null;
        Message.prototype.lottieStickerMessage = null;
        Message.prototype.eventMessage = null;
        Message.prototype.encEventResponseMessage = null;
        Message.prototype.commentMessage = null;
        Message.prototype.newsletterAdminInviteMessage = null;
        Message.prototype.placeholderMessage = null;
        Message.prototype.secretEncryptedMessage = null;
        Message.prototype.albumMessage = null;
        Message.prototype.eventCoverImage = null;
        Message.prototype.stickerPackMessage = null;
        Message.prototype.statusMentionMessage = null;
        Message.prototype.pollResultSnapshotMessage = null;
        Message.prototype.pollCreationOptionImageMessage = null;
        Message.prototype.associatedChildMessage = null;
        Message.prototype.groupStatusMentionMessage = null;
        Message.prototype.pollCreationMessageV4 = null;
        Message.prototype.statusAddYours = null;
        Message.prototype.groupStatusMessage = null;
        Message.prototype.richResponseMessage = null;
        Message.prototype.statusNotificationMessage = null;
        Message.prototype.limitSharingMessage = null;
        Message.prototype.botTaskMessage = null;
        Message.prototype.questionMessage = null;
        Message.prototype.messageHistoryNotice = null;
        Message.prototype.groupStatusMessageV2 = null;
        Message.prototype.botForwardedMessage = null;
        Message.prototype.statusQuestionAnswerMessage = null;
        Message.prototype.questionReplyMessage = null;
        Message.prototype.questionResponseMessage = null;
        Message.prototype.statusQuotedMessage = null;
        Message.prototype.statusStickerInteractionMessage = null;
        Message.prototype.pollCreationMessageV5 = null;
        Message.prototype.newsletterFollowerInviteMessageV2 = null;
        Message.prototype.pollResultSnapshotMessageV3 = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_conversation", {
            get: $util.oneOfGetter($oneOfFields = ["conversation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_senderKeyDistributionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["senderKeyDistributionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_imageMessage", {
            get: $util.oneOfGetter($oneOfFields = ["imageMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_contactMessage", {
            get: $util.oneOfGetter($oneOfFields = ["contactMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_locationMessage", {
            get: $util.oneOfGetter($oneOfFields = ["locationMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_extendedTextMessage", {
            get: $util.oneOfGetter($oneOfFields = ["extendedTextMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_documentMessage", {
            get: $util.oneOfGetter($oneOfFields = ["documentMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_audioMessage", {
            get: $util.oneOfGetter($oneOfFields = ["audioMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_videoMessage", {
            get: $util.oneOfGetter($oneOfFields = ["videoMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_call", {
            get: $util.oneOfGetter($oneOfFields = ["call"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_chat", {
            get: $util.oneOfGetter($oneOfFields = ["chat"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_protocolMessage", {
            get: $util.oneOfGetter($oneOfFields = ["protocolMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_contactsArrayMessage", {
            get: $util.oneOfGetter($oneOfFields = ["contactsArrayMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_highlyStructuredMessage", {
            get: $util.oneOfGetter($oneOfFields = ["highlyStructuredMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_fastRatchetKeySenderKeyDistributionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["fastRatchetKeySenderKeyDistributionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_sendPaymentMessage", {
            get: $util.oneOfGetter($oneOfFields = ["sendPaymentMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_liveLocationMessage", {
            get: $util.oneOfGetter($oneOfFields = ["liveLocationMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_requestPaymentMessage", {
            get: $util.oneOfGetter($oneOfFields = ["requestPaymentMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_declinePaymentRequestMessage", {
            get: $util.oneOfGetter($oneOfFields = ["declinePaymentRequestMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_cancelPaymentRequestMessage", {
            get: $util.oneOfGetter($oneOfFields = ["cancelPaymentRequestMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_templateMessage", {
            get: $util.oneOfGetter($oneOfFields = ["templateMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_stickerMessage", {
            get: $util.oneOfGetter($oneOfFields = ["stickerMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_groupInviteMessage", {
            get: $util.oneOfGetter($oneOfFields = ["groupInviteMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_templateButtonReplyMessage", {
            get: $util.oneOfGetter($oneOfFields = ["templateButtonReplyMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_productMessage", {
            get: $util.oneOfGetter($oneOfFields = ["productMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_deviceSentMessage", {
            get: $util.oneOfGetter($oneOfFields = ["deviceSentMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_messageContextInfo", {
            get: $util.oneOfGetter($oneOfFields = ["messageContextInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_listMessage", {
            get: $util.oneOfGetter($oneOfFields = ["listMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_viewOnceMessage", {
            get: $util.oneOfGetter($oneOfFields = ["viewOnceMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_orderMessage", {
            get: $util.oneOfGetter($oneOfFields = ["orderMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_listResponseMessage", {
            get: $util.oneOfGetter($oneOfFields = ["listResponseMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_ephemeralMessage", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_invoiceMessage", {
            get: $util.oneOfGetter($oneOfFields = ["invoiceMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_buttonsMessage", {
            get: $util.oneOfGetter($oneOfFields = ["buttonsMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_buttonsResponseMessage", {
            get: $util.oneOfGetter($oneOfFields = ["buttonsResponseMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_paymentInviteMessage", {
            get: $util.oneOfGetter($oneOfFields = ["paymentInviteMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_interactiveMessage", {
            get: $util.oneOfGetter($oneOfFields = ["interactiveMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_reactionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["reactionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_stickerSyncRmrMessage", {
            get: $util.oneOfGetter($oneOfFields = ["stickerSyncRmrMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_interactiveResponseMessage", {
            get: $util.oneOfGetter($oneOfFields = ["interactiveResponseMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollCreationMessage", {
            get: $util.oneOfGetter($oneOfFields = ["pollCreationMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollUpdateMessage", {
            get: $util.oneOfGetter($oneOfFields = ["pollUpdateMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_keepInChatMessage", {
            get: $util.oneOfGetter($oneOfFields = ["keepInChatMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_documentWithCaptionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["documentWithCaptionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_requestPhoneNumberMessage", {
            get: $util.oneOfGetter($oneOfFields = ["requestPhoneNumberMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_viewOnceMessageV2", {
            get: $util.oneOfGetter($oneOfFields = ["viewOnceMessageV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_encReactionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["encReactionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_editedMessage", {
            get: $util.oneOfGetter($oneOfFields = ["editedMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_viewOnceMessageV2Extension", {
            get: $util.oneOfGetter($oneOfFields = ["viewOnceMessageV2Extension"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollCreationMessageV2", {
            get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_scheduledCallCreationMessage", {
            get: $util.oneOfGetter($oneOfFields = ["scheduledCallCreationMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_groupMentionedMessage", {
            get: $util.oneOfGetter($oneOfFields = ["groupMentionedMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pinInChatMessage", {
            get: $util.oneOfGetter($oneOfFields = ["pinInChatMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollCreationMessageV3", {
            get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageV3"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_scheduledCallEditMessage", {
            get: $util.oneOfGetter($oneOfFields = ["scheduledCallEditMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_ptvMessage", {
            get: $util.oneOfGetter($oneOfFields = ["ptvMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_botInvokeMessage", {
            get: $util.oneOfGetter($oneOfFields = ["botInvokeMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_callLogMesssage", {
            get: $util.oneOfGetter($oneOfFields = ["callLogMesssage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_messageHistoryBundle", {
            get: $util.oneOfGetter($oneOfFields = ["messageHistoryBundle"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_encCommentMessage", {
            get: $util.oneOfGetter($oneOfFields = ["encCommentMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_bcallMessage", {
            get: $util.oneOfGetter($oneOfFields = ["bcallMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_lottieStickerMessage", {
            get: $util.oneOfGetter($oneOfFields = ["lottieStickerMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_eventMessage", {
            get: $util.oneOfGetter($oneOfFields = ["eventMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_encEventResponseMessage", {
            get: $util.oneOfGetter($oneOfFields = ["encEventResponseMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_commentMessage", {
            get: $util.oneOfGetter($oneOfFields = ["commentMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_newsletterAdminInviteMessage", {
            get: $util.oneOfGetter($oneOfFields = ["newsletterAdminInviteMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_placeholderMessage", {
            get: $util.oneOfGetter($oneOfFields = ["placeholderMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_secretEncryptedMessage", {
            get: $util.oneOfGetter($oneOfFields = ["secretEncryptedMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_albumMessage", {
            get: $util.oneOfGetter($oneOfFields = ["albumMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_eventCoverImage", {
            get: $util.oneOfGetter($oneOfFields = ["eventCoverImage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_stickerPackMessage", {
            get: $util.oneOfGetter($oneOfFields = ["stickerPackMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_statusMentionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["statusMentionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollResultSnapshotMessage", {
            get: $util.oneOfGetter($oneOfFields = ["pollResultSnapshotMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollCreationOptionImageMessage", {
            get: $util.oneOfGetter($oneOfFields = ["pollCreationOptionImageMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_associatedChildMessage", {
            get: $util.oneOfGetter($oneOfFields = ["associatedChildMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_groupStatusMentionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["groupStatusMentionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollCreationMessageV4", {
            get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageV4"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_statusAddYours", {
            get: $util.oneOfGetter($oneOfFields = ["statusAddYours"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_groupStatusMessage", {
            get: $util.oneOfGetter($oneOfFields = ["groupStatusMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_richResponseMessage", {
            get: $util.oneOfGetter($oneOfFields = ["richResponseMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_statusNotificationMessage", {
            get: $util.oneOfGetter($oneOfFields = ["statusNotificationMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_limitSharingMessage", {
            get: $util.oneOfGetter($oneOfFields = ["limitSharingMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_botTaskMessage", {
            get: $util.oneOfGetter($oneOfFields = ["botTaskMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_questionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["questionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_messageHistoryNotice", {
            get: $util.oneOfGetter($oneOfFields = ["messageHistoryNotice"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_groupStatusMessageV2", {
            get: $util.oneOfGetter($oneOfFields = ["groupStatusMessageV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_botForwardedMessage", {
            get: $util.oneOfGetter($oneOfFields = ["botForwardedMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_statusQuestionAnswerMessage", {
            get: $util.oneOfGetter($oneOfFields = ["statusQuestionAnswerMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_questionReplyMessage", {
            get: $util.oneOfGetter($oneOfFields = ["questionReplyMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_questionResponseMessage", {
            get: $util.oneOfGetter($oneOfFields = ["questionResponseMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_statusQuotedMessage", {
            get: $util.oneOfGetter($oneOfFields = ["statusQuotedMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_statusStickerInteractionMessage", {
            get: $util.oneOfGetter($oneOfFields = ["statusStickerInteractionMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollCreationMessageV5", {
            get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageV5"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_newsletterFollowerInviteMessageV2", {
            get: $util.oneOfGetter($oneOfFields = ["newsletterFollowerInviteMessageV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Message.prototype, "_pollResultSnapshotMessageV3", {
            get: $util.oneOfGetter($oneOfFields = ["pollResultSnapshotMessageV3"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Message.create = function create(properties) {
            return new Message(properties);
        };

        Message.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.conversation != null && Object.hasOwnProperty.call(m, "conversation"))
                w.uint32(10).string(m.conversation);
            if (m.senderKeyDistributionMessage != null && Object.hasOwnProperty.call(m, "senderKeyDistributionMessage"))
                $root.proto.Message.SenderKeyDistributionMessage.encode(m.senderKeyDistributionMessage, w.uint32(18).fork()).ldelim();
            if (m.imageMessage != null && Object.hasOwnProperty.call(m, "imageMessage"))
                $root.proto.Message.ImageMessage.encode(m.imageMessage, w.uint32(26).fork()).ldelim();
            if (m.contactMessage != null && Object.hasOwnProperty.call(m, "contactMessage"))
                $root.proto.Message.ContactMessage.encode(m.contactMessage, w.uint32(34).fork()).ldelim();
            if (m.locationMessage != null && Object.hasOwnProperty.call(m, "locationMessage"))
                $root.proto.Message.LocationMessage.encode(m.locationMessage, w.uint32(42).fork()).ldelim();
            if (m.extendedTextMessage != null && Object.hasOwnProperty.call(m, "extendedTextMessage"))
                $root.proto.Message.ExtendedTextMessage.encode(m.extendedTextMessage, w.uint32(50).fork()).ldelim();
            if (m.documentMessage != null && Object.hasOwnProperty.call(m, "documentMessage"))
                $root.proto.Message.DocumentMessage.encode(m.documentMessage, w.uint32(58).fork()).ldelim();
            if (m.audioMessage != null && Object.hasOwnProperty.call(m, "audioMessage"))
                $root.proto.Message.AudioMessage.encode(m.audioMessage, w.uint32(66).fork()).ldelim();
            if (m.videoMessage != null && Object.hasOwnProperty.call(m, "videoMessage"))
                $root.proto.Message.VideoMessage.encode(m.videoMessage, w.uint32(74).fork()).ldelim();
            if (m.call != null && Object.hasOwnProperty.call(m, "call"))
                $root.proto.Message.Call.encode(m.call, w.uint32(82).fork()).ldelim();
            if (m.chat != null && Object.hasOwnProperty.call(m, "chat"))
                $root.proto.Message.Chat.encode(m.chat, w.uint32(90).fork()).ldelim();
            if (m.protocolMessage != null && Object.hasOwnProperty.call(m, "protocolMessage"))
                $root.proto.Message.ProtocolMessage.encode(m.protocolMessage, w.uint32(98).fork()).ldelim();
            if (m.contactsArrayMessage != null && Object.hasOwnProperty.call(m, "contactsArrayMessage"))
                $root.proto.Message.ContactsArrayMessage.encode(m.contactsArrayMessage, w.uint32(106).fork()).ldelim();
            if (m.highlyStructuredMessage != null && Object.hasOwnProperty.call(m, "highlyStructuredMessage"))
                $root.proto.Message.HighlyStructuredMessage.encode(m.highlyStructuredMessage, w.uint32(114).fork()).ldelim();
            if (m.fastRatchetKeySenderKeyDistributionMessage != null && Object.hasOwnProperty.call(m, "fastRatchetKeySenderKeyDistributionMessage"))
                $root.proto.Message.SenderKeyDistributionMessage.encode(m.fastRatchetKeySenderKeyDistributionMessage, w.uint32(122).fork()).ldelim();
            if (m.sendPaymentMessage != null && Object.hasOwnProperty.call(m, "sendPaymentMessage"))
                $root.proto.Message.SendPaymentMessage.encode(m.sendPaymentMessage, w.uint32(130).fork()).ldelim();
            if (m.liveLocationMessage != null && Object.hasOwnProperty.call(m, "liveLocationMessage"))
                $root.proto.Message.LiveLocationMessage.encode(m.liveLocationMessage, w.uint32(146).fork()).ldelim();
            if (m.requestPaymentMessage != null && Object.hasOwnProperty.call(m, "requestPaymentMessage"))
                $root.proto.Message.RequestPaymentMessage.encode(m.requestPaymentMessage, w.uint32(178).fork()).ldelim();
            if (m.declinePaymentRequestMessage != null && Object.hasOwnProperty.call(m, "declinePaymentRequestMessage"))
                $root.proto.Message.DeclinePaymentRequestMessage.encode(m.declinePaymentRequestMessage, w.uint32(186).fork()).ldelim();
            if (m.cancelPaymentRequestMessage != null && Object.hasOwnProperty.call(m, "cancelPaymentRequestMessage"))
                $root.proto.Message.CancelPaymentRequestMessage.encode(m.cancelPaymentRequestMessage, w.uint32(194).fork()).ldelim();
            if (m.templateMessage != null && Object.hasOwnProperty.call(m, "templateMessage"))
                $root.proto.Message.TemplateMessage.encode(m.templateMessage, w.uint32(202).fork()).ldelim();
            if (m.stickerMessage != null && Object.hasOwnProperty.call(m, "stickerMessage"))
                $root.proto.Message.StickerMessage.encode(m.stickerMessage, w.uint32(210).fork()).ldelim();
            if (m.groupInviteMessage != null && Object.hasOwnProperty.call(m, "groupInviteMessage"))
                $root.proto.Message.GroupInviteMessage.encode(m.groupInviteMessage, w.uint32(226).fork()).ldelim();
            if (m.templateButtonReplyMessage != null && Object.hasOwnProperty.call(m, "templateButtonReplyMessage"))
                $root.proto.Message.TemplateButtonReplyMessage.encode(m.templateButtonReplyMessage, w.uint32(234).fork()).ldelim();
            if (m.productMessage != null && Object.hasOwnProperty.call(m, "productMessage"))
                $root.proto.Message.ProductMessage.encode(m.productMessage, w.uint32(242).fork()).ldelim();
            if (m.deviceSentMessage != null && Object.hasOwnProperty.call(m, "deviceSentMessage"))
                $root.proto.Message.DeviceSentMessage.encode(m.deviceSentMessage, w.uint32(250).fork()).ldelim();
            if (m.messageContextInfo != null && Object.hasOwnProperty.call(m, "messageContextInfo"))
                $root.proto.MessageContextInfo.encode(m.messageContextInfo, w.uint32(282).fork()).ldelim();
            if (m.listMessage != null && Object.hasOwnProperty.call(m, "listMessage"))
                $root.proto.Message.ListMessage.encode(m.listMessage, w.uint32(290).fork()).ldelim();
            if (m.viewOnceMessage != null && Object.hasOwnProperty.call(m, "viewOnceMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.viewOnceMessage, w.uint32(298).fork()).ldelim();
            if (m.orderMessage != null && Object.hasOwnProperty.call(m, "orderMessage"))
                $root.proto.Message.OrderMessage.encode(m.orderMessage, w.uint32(306).fork()).ldelim();
            if (m.listResponseMessage != null && Object.hasOwnProperty.call(m, "listResponseMessage"))
                $root.proto.Message.ListResponseMessage.encode(m.listResponseMessage, w.uint32(314).fork()).ldelim();
            if (m.ephemeralMessage != null && Object.hasOwnProperty.call(m, "ephemeralMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.ephemeralMessage, w.uint32(322).fork()).ldelim();
            if (m.invoiceMessage != null && Object.hasOwnProperty.call(m, "invoiceMessage"))
                $root.proto.Message.InvoiceMessage.encode(m.invoiceMessage, w.uint32(330).fork()).ldelim();
            if (m.buttonsMessage != null && Object.hasOwnProperty.call(m, "buttonsMessage"))
                $root.proto.Message.ButtonsMessage.encode(m.buttonsMessage, w.uint32(338).fork()).ldelim();
            if (m.buttonsResponseMessage != null && Object.hasOwnProperty.call(m, "buttonsResponseMessage"))
                $root.proto.Message.ButtonsResponseMessage.encode(m.buttonsResponseMessage, w.uint32(346).fork()).ldelim();
            if (m.paymentInviteMessage != null && Object.hasOwnProperty.call(m, "paymentInviteMessage"))
                $root.proto.Message.PaymentInviteMessage.encode(m.paymentInviteMessage, w.uint32(354).fork()).ldelim();
            if (m.interactiveMessage != null && Object.hasOwnProperty.call(m, "interactiveMessage"))
                $root.proto.Message.InteractiveMessage.encode(m.interactiveMessage, w.uint32(362).fork()).ldelim();
            if (m.reactionMessage != null && Object.hasOwnProperty.call(m, "reactionMessage"))
                $root.proto.Message.ReactionMessage.encode(m.reactionMessage, w.uint32(370).fork()).ldelim();
            if (m.stickerSyncRmrMessage != null && Object.hasOwnProperty.call(m, "stickerSyncRmrMessage"))
                $root.proto.Message.StickerSyncRMRMessage.encode(m.stickerSyncRmrMessage, w.uint32(378).fork()).ldelim();
            if (m.interactiveResponseMessage != null && Object.hasOwnProperty.call(m, "interactiveResponseMessage"))
                $root.proto.Message.InteractiveResponseMessage.encode(m.interactiveResponseMessage, w.uint32(386).fork()).ldelim();
            if (m.pollCreationMessage != null && Object.hasOwnProperty.call(m, "pollCreationMessage"))
                $root.proto.Message.PollCreationMessage.encode(m.pollCreationMessage, w.uint32(394).fork()).ldelim();
            if (m.pollUpdateMessage != null && Object.hasOwnProperty.call(m, "pollUpdateMessage"))
                $root.proto.Message.PollUpdateMessage.encode(m.pollUpdateMessage, w.uint32(402).fork()).ldelim();
            if (m.keepInChatMessage != null && Object.hasOwnProperty.call(m, "keepInChatMessage"))
                $root.proto.Message.KeepInChatMessage.encode(m.keepInChatMessage, w.uint32(410).fork()).ldelim();
            if (m.documentWithCaptionMessage != null && Object.hasOwnProperty.call(m, "documentWithCaptionMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.documentWithCaptionMessage, w.uint32(426).fork()).ldelim();
            if (m.requestPhoneNumberMessage != null && Object.hasOwnProperty.call(m, "requestPhoneNumberMessage"))
                $root.proto.Message.RequestPhoneNumberMessage.encode(m.requestPhoneNumberMessage, w.uint32(434).fork()).ldelim();
            if (m.viewOnceMessageV2 != null && Object.hasOwnProperty.call(m, "viewOnceMessageV2"))
                $root.proto.Message.FutureProofMessage.encode(m.viewOnceMessageV2, w.uint32(442).fork()).ldelim();
            if (m.encReactionMessage != null && Object.hasOwnProperty.call(m, "encReactionMessage"))
                $root.proto.Message.EncReactionMessage.encode(m.encReactionMessage, w.uint32(450).fork()).ldelim();
            if (m.editedMessage != null && Object.hasOwnProperty.call(m, "editedMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.editedMessage, w.uint32(466).fork()).ldelim();
            if (m.viewOnceMessageV2Extension != null && Object.hasOwnProperty.call(m, "viewOnceMessageV2Extension"))
                $root.proto.Message.FutureProofMessage.encode(m.viewOnceMessageV2Extension, w.uint32(474).fork()).ldelim();
            if (m.pollCreationMessageV2 != null && Object.hasOwnProperty.call(m, "pollCreationMessageV2"))
                $root.proto.Message.PollCreationMessage.encode(m.pollCreationMessageV2, w.uint32(482).fork()).ldelim();
            if (m.scheduledCallCreationMessage != null && Object.hasOwnProperty.call(m, "scheduledCallCreationMessage"))
                $root.proto.Message.ScheduledCallCreationMessage.encode(m.scheduledCallCreationMessage, w.uint32(490).fork()).ldelim();
            if (m.groupMentionedMessage != null && Object.hasOwnProperty.call(m, "groupMentionedMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.groupMentionedMessage, w.uint32(498).fork()).ldelim();
            if (m.pinInChatMessage != null && Object.hasOwnProperty.call(m, "pinInChatMessage"))
                $root.proto.Message.PinInChatMessage.encode(m.pinInChatMessage, w.uint32(506).fork()).ldelim();
            if (m.pollCreationMessageV3 != null && Object.hasOwnProperty.call(m, "pollCreationMessageV3"))
                $root.proto.Message.PollCreationMessage.encode(m.pollCreationMessageV3, w.uint32(514).fork()).ldelim();
            if (m.scheduledCallEditMessage != null && Object.hasOwnProperty.call(m, "scheduledCallEditMessage"))
                $root.proto.Message.ScheduledCallEditMessage.encode(m.scheduledCallEditMessage, w.uint32(522).fork()).ldelim();
            if (m.ptvMessage != null && Object.hasOwnProperty.call(m, "ptvMessage"))
                $root.proto.Message.VideoMessage.encode(m.ptvMessage, w.uint32(530).fork()).ldelim();
            if (m.botInvokeMessage != null && Object.hasOwnProperty.call(m, "botInvokeMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.botInvokeMessage, w.uint32(538).fork()).ldelim();
            if (m.callLogMesssage != null && Object.hasOwnProperty.call(m, "callLogMesssage"))
                $root.proto.Message.CallLogMessage.encode(m.callLogMesssage, w.uint32(554).fork()).ldelim();
            if (m.messageHistoryBundle != null && Object.hasOwnProperty.call(m, "messageHistoryBundle"))
                $root.proto.Message.MessageHistoryBundle.encode(m.messageHistoryBundle, w.uint32(562).fork()).ldelim();
            if (m.encCommentMessage != null && Object.hasOwnProperty.call(m, "encCommentMessage"))
                $root.proto.Message.EncCommentMessage.encode(m.encCommentMessage, w.uint32(570).fork()).ldelim();
            if (m.bcallMessage != null && Object.hasOwnProperty.call(m, "bcallMessage"))
                $root.proto.Message.BCallMessage.encode(m.bcallMessage, w.uint32(578).fork()).ldelim();
            if (m.lottieStickerMessage != null && Object.hasOwnProperty.call(m, "lottieStickerMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.lottieStickerMessage, w.uint32(594).fork()).ldelim();
            if (m.eventMessage != null && Object.hasOwnProperty.call(m, "eventMessage"))
                $root.proto.Message.EventMessage.encode(m.eventMessage, w.uint32(602).fork()).ldelim();
            if (m.encEventResponseMessage != null && Object.hasOwnProperty.call(m, "encEventResponseMessage"))
                $root.proto.Message.EncEventResponseMessage.encode(m.encEventResponseMessage, w.uint32(610).fork()).ldelim();
            if (m.commentMessage != null && Object.hasOwnProperty.call(m, "commentMessage"))
                $root.proto.Message.CommentMessage.encode(m.commentMessage, w.uint32(618).fork()).ldelim();
            if (m.newsletterAdminInviteMessage != null && Object.hasOwnProperty.call(m, "newsletterAdminInviteMessage"))
                $root.proto.Message.NewsletterAdminInviteMessage.encode(m.newsletterAdminInviteMessage, w.uint32(626).fork()).ldelim();
            if (m.placeholderMessage != null && Object.hasOwnProperty.call(m, "placeholderMessage"))
                $root.proto.Message.PlaceholderMessage.encode(m.placeholderMessage, w.uint32(642).fork()).ldelim();
            if (m.secretEncryptedMessage != null && Object.hasOwnProperty.call(m, "secretEncryptedMessage"))
                $root.proto.Message.SecretEncryptedMessage.encode(m.secretEncryptedMessage, w.uint32(658).fork()).ldelim();
            if (m.albumMessage != null && Object.hasOwnProperty.call(m, "albumMessage"))
                $root.proto.Message.AlbumMessage.encode(m.albumMessage, w.uint32(666).fork()).ldelim();
            if (m.eventCoverImage != null && Object.hasOwnProperty.call(m, "eventCoverImage"))
                $root.proto.Message.FutureProofMessage.encode(m.eventCoverImage, w.uint32(682).fork()).ldelim();
            if (m.stickerPackMessage != null && Object.hasOwnProperty.call(m, "stickerPackMessage"))
                $root.proto.Message.StickerPackMessage.encode(m.stickerPackMessage, w.uint32(690).fork()).ldelim();
            if (m.statusMentionMessage != null && Object.hasOwnProperty.call(m, "statusMentionMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.statusMentionMessage, w.uint32(698).fork()).ldelim();
            if (m.pollResultSnapshotMessage != null && Object.hasOwnProperty.call(m, "pollResultSnapshotMessage"))
                $root.proto.Message.PollResultSnapshotMessage.encode(m.pollResultSnapshotMessage, w.uint32(706).fork()).ldelim();
            if (m.pollCreationOptionImageMessage != null && Object.hasOwnProperty.call(m, "pollCreationOptionImageMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.pollCreationOptionImageMessage, w.uint32(722).fork()).ldelim();
            if (m.associatedChildMessage != null && Object.hasOwnProperty.call(m, "associatedChildMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.associatedChildMessage, w.uint32(730).fork()).ldelim();
            if (m.groupStatusMentionMessage != null && Object.hasOwnProperty.call(m, "groupStatusMentionMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.groupStatusMentionMessage, w.uint32(738).fork()).ldelim();
            if (m.pollCreationMessageV4 != null && Object.hasOwnProperty.call(m, "pollCreationMessageV4"))
                $root.proto.Message.FutureProofMessage.encode(m.pollCreationMessageV4, w.uint32(746).fork()).ldelim();
            if (m.statusAddYours != null && Object.hasOwnProperty.call(m, "statusAddYours"))
                $root.proto.Message.FutureProofMessage.encode(m.statusAddYours, w.uint32(762).fork()).ldelim();
            if (m.groupStatusMessage != null && Object.hasOwnProperty.call(m, "groupStatusMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.groupStatusMessage, w.uint32(770).fork()).ldelim();
            if (m.richResponseMessage != null && Object.hasOwnProperty.call(m, "richResponseMessage"))
                $root.proto.AIRichResponseMessage.encode(m.richResponseMessage, w.uint32(778).fork()).ldelim();
            if (m.statusNotificationMessage != null && Object.hasOwnProperty.call(m, "statusNotificationMessage"))
                $root.proto.Message.StatusNotificationMessage.encode(m.statusNotificationMessage, w.uint32(786).fork()).ldelim();
            if (m.limitSharingMessage != null && Object.hasOwnProperty.call(m, "limitSharingMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.limitSharingMessage, w.uint32(794).fork()).ldelim();
            if (m.botTaskMessage != null && Object.hasOwnProperty.call(m, "botTaskMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.botTaskMessage, w.uint32(802).fork()).ldelim();
            if (m.questionMessage != null && Object.hasOwnProperty.call(m, "questionMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.questionMessage, w.uint32(810).fork()).ldelim();
            if (m.messageHistoryNotice != null && Object.hasOwnProperty.call(m, "messageHistoryNotice"))
                $root.proto.Message.MessageHistoryNotice.encode(m.messageHistoryNotice, w.uint32(818).fork()).ldelim();
            if (m.groupStatusMessageV2 != null && Object.hasOwnProperty.call(m, "groupStatusMessageV2"))
                $root.proto.Message.FutureProofMessage.encode(m.groupStatusMessageV2, w.uint32(826).fork()).ldelim();
            if (m.botForwardedMessage != null && Object.hasOwnProperty.call(m, "botForwardedMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.botForwardedMessage, w.uint32(834).fork()).ldelim();
            if (m.statusQuestionAnswerMessage != null && Object.hasOwnProperty.call(m, "statusQuestionAnswerMessage"))
                $root.proto.Message.StatusQuestionAnswerMessage.encode(m.statusQuestionAnswerMessage, w.uint32(842).fork()).ldelim();
            if (m.questionReplyMessage != null && Object.hasOwnProperty.call(m, "questionReplyMessage"))
                $root.proto.Message.FutureProofMessage.encode(m.questionReplyMessage, w.uint32(850).fork()).ldelim();
            if (m.questionResponseMessage != null && Object.hasOwnProperty.call(m, "questionResponseMessage"))
                $root.proto.Message.QuestionResponseMessage.encode(m.questionResponseMessage, w.uint32(858).fork()).ldelim();
            if (m.statusQuotedMessage != null && Object.hasOwnProperty.call(m, "statusQuotedMessage"))
                $root.proto.Message.StatusQuotedMessage.encode(m.statusQuotedMessage, w.uint32(874).fork()).ldelim();
            if (m.statusStickerInteractionMessage != null && Object.hasOwnProperty.call(m, "statusStickerInteractionMessage"))
                $root.proto.Message.StatusStickerInteractionMessage.encode(m.statusStickerInteractionMessage, w.uint32(882).fork()).ldelim();
            if (m.pollCreationMessageV5 != null && Object.hasOwnProperty.call(m, "pollCreationMessageV5"))
                $root.proto.Message.PollCreationMessage.encode(m.pollCreationMessageV5, w.uint32(890).fork()).ldelim();
            if (m.newsletterFollowerInviteMessageV2 != null && Object.hasOwnProperty.call(m, "newsletterFollowerInviteMessageV2"))
                $root.proto.Message.NewsletterFollowerInviteMessage.encode(m.newsletterFollowerInviteMessageV2, w.uint32(906).fork()).ldelim();
            if (m.pollResultSnapshotMessageV3 != null && Object.hasOwnProperty.call(m, "pollResultSnapshotMessageV3"))
                $root.proto.Message.PollResultSnapshotMessage.encode(m.pollResultSnapshotMessageV3, w.uint32(914).fork()).ldelim();
            return w;
        };

        Message.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.conversation = r.string();
                        break;
                    }
                case 2: {
                        m.senderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.imageMessage = $root.proto.Message.ImageMessage.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.contactMessage = $root.proto.Message.ContactMessage.decode(r, r.uint32());
                        break;
                    }
                case 5: {
                        m.locationMessage = $root.proto.Message.LocationMessage.decode(r, r.uint32());
                        break;
                    }
                case 6: {
                        m.extendedTextMessage = $root.proto.Message.ExtendedTextMessage.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.documentMessage = $root.proto.Message.DocumentMessage.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.audioMessage = $root.proto.Message.AudioMessage.decode(r, r.uint32());
                        break;
                    }
                case 9: {
                        m.videoMessage = $root.proto.Message.VideoMessage.decode(r, r.uint32());
                        break;
                    }
                case 10: {
                        m.call = $root.proto.Message.Call.decode(r, r.uint32());
                        break;
                    }
                case 11: {
                        m.chat = $root.proto.Message.Chat.decode(r, r.uint32());
                        break;
                    }
                case 12: {
                        m.protocolMessage = $root.proto.Message.ProtocolMessage.decode(r, r.uint32());
                        break;
                    }
                case 13: {
                        m.contactsArrayMessage = $root.proto.Message.ContactsArrayMessage.decode(r, r.uint32());
                        break;
                    }
                case 14: {
                        m.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                        break;
                    }
                case 15: {
                        m.fastRatchetKeySenderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.decode(r, r.uint32());
                        break;
                    }
                case 16: {
                        m.sendPaymentMessage = $root.proto.Message.SendPaymentMessage.decode(r, r.uint32());
                        break;
                    }
                case 18: {
                        m.liveLocationMessage = $root.proto.Message.LiveLocationMessage.decode(r, r.uint32());
                        break;
                    }
                case 22: {
                        m.requestPaymentMessage = $root.proto.Message.RequestPaymentMessage.decode(r, r.uint32());
                        break;
                    }
                case 23: {
                        m.declinePaymentRequestMessage = $root.proto.Message.DeclinePaymentRequestMessage.decode(r, r.uint32());
                        break;
                    }
                case 24: {
                        m.cancelPaymentRequestMessage = $root.proto.Message.CancelPaymentRequestMessage.decode(r, r.uint32());
                        break;
                    }
                case 25: {
                        m.templateMessage = $root.proto.Message.TemplateMessage.decode(r, r.uint32());
                        break;
                    }
                case 26: {
                        m.stickerMessage = $root.proto.Message.StickerMessage.decode(r, r.uint32());
                        break;
                    }
                case 28: {
                        m.groupInviteMessage = $root.proto.Message.GroupInviteMessage.decode(r, r.uint32());
                        break;
                    }
                case 29: {
                        m.templateButtonReplyMessage = $root.proto.Message.TemplateButtonReplyMessage.decode(r, r.uint32());
                        break;
                    }
                case 30: {
                        m.productMessage = $root.proto.Message.ProductMessage.decode(r, r.uint32());
                        break;
                    }
                case 31: {
                        m.deviceSentMessage = $root.proto.Message.DeviceSentMessage.decode(r, r.uint32());
                        break;
                    }
                case 35: {
                        m.messageContextInfo = $root.proto.MessageContextInfo.decode(r, r.uint32());
                        break;
                    }
                case 36: {
                        m.listMessage = $root.proto.Message.ListMessage.decode(r, r.uint32());
                        break;
                    }
                case 37: {
                        m.viewOnceMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 38: {
                        m.orderMessage = $root.proto.Message.OrderMessage.decode(r, r.uint32());
                        break;
                    }
                case 39: {
                        m.listResponseMessage = $root.proto.Message.ListResponseMessage.decode(r, r.uint32());
                        break;
                    }
                case 40: {
                        m.ephemeralMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 41: {
                        m.invoiceMessage = $root.proto.Message.InvoiceMessage.decode(r, r.uint32());
                        break;
                    }
                case 42: {
                        m.buttonsMessage = $root.proto.Message.ButtonsMessage.decode(r, r.uint32());
                        break;
                    }
                case 43: {
                        m.buttonsResponseMessage = $root.proto.Message.ButtonsResponseMessage.decode(r, r.uint32());
                        break;
                    }
                case 44: {
                        m.paymentInviteMessage = $root.proto.Message.PaymentInviteMessage.decode(r, r.uint32());
                        break;
                    }
                case 45: {
                        m.interactiveMessage = $root.proto.Message.InteractiveMessage.decode(r, r.uint32());
                        break;
                    }
                case 46: {
                        m.reactionMessage = $root.proto.Message.ReactionMessage.decode(r, r.uint32());
                        break;
                    }
                case 47: {
                        m.stickerSyncRmrMessage = $root.proto.Message.StickerSyncRMRMessage.decode(r, r.uint32());
                        break;
                    }
                case 48: {
                        m.interactiveResponseMessage = $root.proto.Message.InteractiveResponseMessage.decode(r, r.uint32());
                        break;
                    }
                case 49: {
                        m.pollCreationMessage = $root.proto.Message.PollCreationMessage.decode(r, r.uint32());
                        break;
                    }
                case 50: {
                        m.pollUpdateMessage = $root.proto.Message.PollUpdateMessage.decode(r, r.uint32());
                        break;
                    }
                case 51: {
                        m.keepInChatMessage = $root.proto.Message.KeepInChatMessage.decode(r, r.uint32());
                        break;
                    }
                case 53: {
                        m.documentWithCaptionMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 54: {
                        m.requestPhoneNumberMessage = $root.proto.Message.RequestPhoneNumberMessage.decode(r, r.uint32());
                        break;
                    }
                case 55: {
                        m.viewOnceMessageV2 = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 56: {
                        m.encReactionMessage = $root.proto.Message.EncReactionMessage.decode(r, r.uint32());
                        break;
                    }
                case 58: {
                        m.editedMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 59: {
                        m.viewOnceMessageV2Extension = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 60: {
                        m.pollCreationMessageV2 = $root.proto.Message.PollCreationMessage.decode(r, r.uint32());
                        break;
                    }
                case 61: {
                        m.scheduledCallCreationMessage = $root.proto.Message.ScheduledCallCreationMessage.decode(r, r.uint32());
                        break;
                    }
                case 62: {
                        m.groupMentionedMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 63: {
                        m.pinInChatMessage = $root.proto.Message.PinInChatMessage.decode(r, r.uint32());
                        break;
                    }
                case 64: {
                        m.pollCreationMessageV3 = $root.proto.Message.PollCreationMessage.decode(r, r.uint32());
                        break;
                    }
                case 65: {
                        m.scheduledCallEditMessage = $root.proto.Message.ScheduledCallEditMessage.decode(r, r.uint32());
                        break;
                    }
                case 66: {
                        m.ptvMessage = $root.proto.Message.VideoMessage.decode(r, r.uint32());
                        break;
                    }
                case 67: {
                        m.botInvokeMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 69: {
                        m.callLogMesssage = $root.proto.Message.CallLogMessage.decode(r, r.uint32());
                        break;
                    }
                case 70: {
                        m.messageHistoryBundle = $root.proto.Message.MessageHistoryBundle.decode(r, r.uint32());
                        break;
                    }
                case 71: {
                        m.encCommentMessage = $root.proto.Message.EncCommentMessage.decode(r, r.uint32());
                        break;
                    }
                case 72: {
                        m.bcallMessage = $root.proto.Message.BCallMessage.decode(r, r.uint32());
                        break;
                    }
                case 74: {
                        m.lottieStickerMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 75: {
                        m.eventMessage = $root.proto.Message.EventMessage.decode(r, r.uint32());
                        break;
                    }
                case 76: {
                        m.encEventResponseMessage = $root.proto.Message.EncEventResponseMessage.decode(r, r.uint32());
                        break;
                    }
                case 77: {
                        m.commentMessage = $root.proto.Message.CommentMessage.decode(r, r.uint32());
                        break;
                    }
                case 78: {
                        m.newsletterAdminInviteMessage = $root.proto.Message.NewsletterAdminInviteMessage.decode(r, r.uint32());
                        break;
                    }
                case 80: {
                        m.placeholderMessage = $root.proto.Message.PlaceholderMessage.decode(r, r.uint32());
                        break;
                    }
                case 82: {
                        m.secretEncryptedMessage = $root.proto.Message.SecretEncryptedMessage.decode(r, r.uint32());
                        break;
                    }
                case 83: {
                        m.albumMessage = $root.proto.Message.AlbumMessage.decode(r, r.uint32());
                        break;
                    }
                case 85: {
                        m.eventCoverImage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 86: {
                        m.stickerPackMessage = $root.proto.Message.StickerPackMessage.decode(r, r.uint32());
                        break;
                    }
                case 87: {
                        m.statusMentionMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 88: {
                        m.pollResultSnapshotMessage = $root.proto.Message.PollResultSnapshotMessage.decode(r, r.uint32());
                        break;
                    }
                case 90: {
                        m.pollCreationOptionImageMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 91: {
                        m.associatedChildMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 92: {
                        m.groupStatusMentionMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 93: {
                        m.pollCreationMessageV4 = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 95: {
                        m.statusAddYours = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 96: {
                        m.groupStatusMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 97: {
                        m.richResponseMessage = $root.proto.AIRichResponseMessage.decode(r, r.uint32());
                        break;
                    }
                case 98: {
                        m.statusNotificationMessage = $root.proto.Message.StatusNotificationMessage.decode(r, r.uint32());
                        break;
                    }
                case 99: {
                        m.limitSharingMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 100: {
                        m.botTaskMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 101: {
                        m.questionMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 102: {
                        m.messageHistoryNotice = $root.proto.Message.MessageHistoryNotice.decode(r, r.uint32());
                        break;
                    }
                case 103: {
                        m.groupStatusMessageV2 = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 104: {
                        m.botForwardedMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 105: {
                        m.statusQuestionAnswerMessage = $root.proto.Message.StatusQuestionAnswerMessage.decode(r, r.uint32());
                        break;
                    }
                case 106: {
                        m.questionReplyMessage = $root.proto.Message.FutureProofMessage.decode(r, r.uint32());
                        break;
                    }
                case 107: {
                        m.questionResponseMessage = $root.proto.Message.QuestionResponseMessage.decode(r, r.uint32());
                        break;
                    }
                case 109: {
                        m.statusQuotedMessage = $root.proto.Message.StatusQuotedMessage.decode(r, r.uint32());
                        break;
                    }
                case 110: {
                        m.statusStickerInteractionMessage = $root.proto.Message.StatusStickerInteractionMessage.decode(r, r.uint32());
                        break;
                    }
                case 111: {
                        m.pollCreationMessageV5 = $root.proto.Message.PollCreationMessage.decode(r, r.uint32());
                        break;
                    }
                case 113: {
                        m.newsletterFollowerInviteMessageV2 = $root.proto.Message.NewsletterFollowerInviteMessage.decode(r, r.uint32());
                        break;
                    }
                case 114: {
                        m.pollResultSnapshotMessageV3 = $root.proto.Message.PollResultSnapshotMessage.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Message.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Message)
                return d;
            var m = new $root.proto.Message();
            if (d.conversation != null) {
                m.conversation = String(d.conversation);
            }
            if (d.senderKeyDistributionMessage != null) {
                if (typeof d.senderKeyDistributionMessage !== "object")
                    throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected");
                m.senderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.fromObject(d.senderKeyDistributionMessage);
            }
            if (d.imageMessage != null) {
                if (typeof d.imageMessage !== "object")
                    throw TypeError(".proto.Message.imageMessage: object expected");
                m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage);
            }
            if (d.contactMessage != null) {
                if (typeof d.contactMessage !== "object")
                    throw TypeError(".proto.Message.contactMessage: object expected");
                m.contactMessage = $root.proto.Message.ContactMessage.fromObject(d.contactMessage);
            }
            if (d.locationMessage != null) {
                if (typeof d.locationMessage !== "object")
                    throw TypeError(".proto.Message.locationMessage: object expected");
                m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage);
            }
            if (d.extendedTextMessage != null) {
                if (typeof d.extendedTextMessage !== "object")
                    throw TypeError(".proto.Message.extendedTextMessage: object expected");
                m.extendedTextMessage = $root.proto.Message.ExtendedTextMessage.fromObject(d.extendedTextMessage);
            }
            if (d.documentMessage != null) {
                if (typeof d.documentMessage !== "object")
                    throw TypeError(".proto.Message.documentMessage: object expected");
                m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage);
            }
            if (d.audioMessage != null) {
                if (typeof d.audioMessage !== "object")
                    throw TypeError(".proto.Message.audioMessage: object expected");
                m.audioMessage = $root.proto.Message.AudioMessage.fromObject(d.audioMessage);
            }
            if (d.videoMessage != null) {
                if (typeof d.videoMessage !== "object")
                    throw TypeError(".proto.Message.videoMessage: object expected");
                m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage);
            }
            if (d.call != null) {
                if (typeof d.call !== "object")
                    throw TypeError(".proto.Message.call: object expected");
                m.call = $root.proto.Message.Call.fromObject(d.call);
            }
            if (d.chat != null) {
                if (typeof d.chat !== "object")
                    throw TypeError(".proto.Message.chat: object expected");
                m.chat = $root.proto.Message.Chat.fromObject(d.chat);
            }
            if (d.protocolMessage != null) {
                if (typeof d.protocolMessage !== "object")
                    throw TypeError(".proto.Message.protocolMessage: object expected");
                m.protocolMessage = $root.proto.Message.ProtocolMessage.fromObject(d.protocolMessage);
            }
            if (d.contactsArrayMessage != null) {
                if (typeof d.contactsArrayMessage !== "object")
                    throw TypeError(".proto.Message.contactsArrayMessage: object expected");
                m.contactsArrayMessage = $root.proto.Message.ContactsArrayMessage.fromObject(d.contactsArrayMessage);
            }
            if (d.highlyStructuredMessage != null) {
                if (typeof d.highlyStructuredMessage !== "object")
                    throw TypeError(".proto.Message.highlyStructuredMessage: object expected");
                m.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.fromObject(d.highlyStructuredMessage);
            }
            if (d.fastRatchetKeySenderKeyDistributionMessage != null) {
                if (typeof d.fastRatchetKeySenderKeyDistributionMessage !== "object")
                    throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected");
                m.fastRatchetKeySenderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.fromObject(d.fastRatchetKeySenderKeyDistributionMessage);
            }
            if (d.sendPaymentMessage != null) {
                if (typeof d.sendPaymentMessage !== "object")
                    throw TypeError(".proto.Message.sendPaymentMessage: object expected");
                m.sendPaymentMessage = $root.proto.Message.SendPaymentMessage.fromObject(d.sendPaymentMessage);
            }
            if (d.liveLocationMessage != null) {
                if (typeof d.liveLocationMessage !== "object")
                    throw TypeError(".proto.Message.liveLocationMessage: object expected");
                m.liveLocationMessage = $root.proto.Message.LiveLocationMessage.fromObject(d.liveLocationMessage);
            }
            if (d.requestPaymentMessage != null) {
                if (typeof d.requestPaymentMessage !== "object")
                    throw TypeError(".proto.Message.requestPaymentMessage: object expected");
                m.requestPaymentMessage = $root.proto.Message.RequestPaymentMessage.fromObject(d.requestPaymentMessage);
            }
            if (d.declinePaymentRequestMessage != null) {
                if (typeof d.declinePaymentRequestMessage !== "object")
                    throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected");
                m.declinePaymentRequestMessage = $root.proto.Message.DeclinePaymentRequestMessage.fromObject(d.declinePaymentRequestMessage);
            }
            if (d.cancelPaymentRequestMessage != null) {
                if (typeof d.cancelPaymentRequestMessage !== "object")
                    throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected");
                m.cancelPaymentRequestMessage = $root.proto.Message.CancelPaymentRequestMessage.fromObject(d.cancelPaymentRequestMessage);
            }
            if (d.templateMessage != null) {
                if (typeof d.templateMessage !== "object")
                    throw TypeError(".proto.Message.templateMessage: object expected");
                m.templateMessage = $root.proto.Message.TemplateMessage.fromObject(d.templateMessage);
            }
            if (d.stickerMessage != null) {
                if (typeof d.stickerMessage !== "object")
                    throw TypeError(".proto.Message.stickerMessage: object expected");
                m.stickerMessage = $root.proto.Message.StickerMessage.fromObject(d.stickerMessage);
            }
            if (d.groupInviteMessage != null) {
                if (typeof d.groupInviteMessage !== "object")
                    throw TypeError(".proto.Message.groupInviteMessage: object expected");
                m.groupInviteMessage = $root.proto.Message.GroupInviteMessage.fromObject(d.groupInviteMessage);
            }
            if (d.templateButtonReplyMessage != null) {
                if (typeof d.templateButtonReplyMessage !== "object")
                    throw TypeError(".proto.Message.templateButtonReplyMessage: object expected");
                m.templateButtonReplyMessage = $root.proto.Message.TemplateButtonReplyMessage.fromObject(d.templateButtonReplyMessage);
            }
            if (d.productMessage != null) {
                if (typeof d.productMessage !== "object")
                    throw TypeError(".proto.Message.productMessage: object expected");
                m.productMessage = $root.proto.Message.ProductMessage.fromObject(d.productMessage);
            }
            if (d.deviceSentMessage != null) {
                if (typeof d.deviceSentMessage !== "object")
                    throw TypeError(".proto.Message.deviceSentMessage: object expected");
                m.deviceSentMessage = $root.proto.Message.DeviceSentMessage.fromObject(d.deviceSentMessage);
            }
            if (d.messageContextInfo != null) {
                if (typeof d.messageContextInfo !== "object")
                    throw TypeError(".proto.Message.messageContextInfo: object expected");
                m.messageContextInfo = $root.proto.MessageContextInfo.fromObject(d.messageContextInfo);
            }
            if (d.listMessage != null) {
                if (typeof d.listMessage !== "object")
                    throw TypeError(".proto.Message.listMessage: object expected");
                m.listMessage = $root.proto.Message.ListMessage.fromObject(d.listMessage);
            }
            if (d.viewOnceMessage != null) {
                if (typeof d.viewOnceMessage !== "object")
                    throw TypeError(".proto.Message.viewOnceMessage: object expected");
                m.viewOnceMessage = $root.proto.Message.FutureProofMessage.fromObject(d.viewOnceMessage);
            }
            if (d.orderMessage != null) {
                if (typeof d.orderMessage !== "object")
                    throw TypeError(".proto.Message.orderMessage: object expected");
                m.orderMessage = $root.proto.Message.OrderMessage.fromObject(d.orderMessage);
            }
            if (d.listResponseMessage != null) {
                if (typeof d.listResponseMessage !== "object")
                    throw TypeError(".proto.Message.listResponseMessage: object expected");
                m.listResponseMessage = $root.proto.Message.ListResponseMessage.fromObject(d.listResponseMessage);
            }
            if (d.ephemeralMessage != null) {
                if (typeof d.ephemeralMessage !== "object")
                    throw TypeError(".proto.Message.ephemeralMessage: object expected");
                m.ephemeralMessage = $root.proto.Message.FutureProofMessage.fromObject(d.ephemeralMessage);
            }
            if (d.invoiceMessage != null) {
                if (typeof d.invoiceMessage !== "object")
                    throw TypeError(".proto.Message.invoiceMessage: object expected");
                m.invoiceMessage = $root.proto.Message.InvoiceMessage.fromObject(d.invoiceMessage);
            }
            if (d.buttonsMessage != null) {
                if (typeof d.buttonsMessage !== "object")
                    throw TypeError(".proto.Message.buttonsMessage: object expected");
                m.buttonsMessage = $root.proto.Message.ButtonsMessage.fromObject(d.buttonsMessage);
            }
            if (d.buttonsResponseMessage != null) {
                if (typeof d.buttonsResponseMessage !== "object")
                    throw TypeError(".proto.Message.buttonsResponseMessage: object expected");
                m.buttonsResponseMessage = $root.proto.Message.ButtonsResponseMessage.fromObject(d.buttonsResponseMessage);
            }
            if (d.paymentInviteMessage != null) {
                if (typeof d.paymentInviteMessage !== "object")
                    throw TypeError(".proto.Message.paymentInviteMessage: object expected");
                m.paymentInviteMessage = $root.proto.Message.PaymentInviteMessage.fromObject(d.paymentInviteMessage);
            }
            if (d.interactiveMessage != null) {
                if (typeof d.interactiveMessage !== "object")
                    throw TypeError(".proto.Message.interactiveMessage: object expected");
                m.interactiveMessage = $root.proto.Message.InteractiveMessage.fromObject(d.interactiveMessage);
            }
            if (d.reactionMessage != null) {
                if (typeof d.reactionMessage !== "object")
                    throw TypeError(".proto.Message.reactionMessage: object expected");
                m.reactionMessage = $root.proto.Message.ReactionMessage.fromObject(d.reactionMessage);
            }
            if (d.stickerSyncRmrMessage != null) {
                if (typeof d.stickerSyncRmrMessage !== "object")
                    throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected");
                m.stickerSyncRmrMessage = $root.proto.Message.StickerSyncRMRMessage.fromObject(d.stickerSyncRmrMessage);
            }
            if (d.interactiveResponseMessage != null) {
                if (typeof d.interactiveResponseMessage !== "object")
                    throw TypeError(".proto.Message.interactiveResponseMessage: object expected");
                m.interactiveResponseMessage = $root.proto.Message.InteractiveResponseMessage.fromObject(d.interactiveResponseMessage);
            }
            if (d.pollCreationMessage != null) {
                if (typeof d.pollCreationMessage !== "object")
                    throw TypeError(".proto.Message.pollCreationMessage: object expected");
                m.pollCreationMessage = $root.proto.Message.PollCreationMessage.fromObject(d.pollCreationMessage);
            }
            if (d.pollUpdateMessage != null) {
                if (typeof d.pollUpdateMessage !== "object")
                    throw TypeError(".proto.Message.pollUpdateMessage: object expected");
                m.pollUpdateMessage = $root.proto.Message.PollUpdateMessage.fromObject(d.pollUpdateMessage);
            }
            if (d.keepInChatMessage != null) {
                if (typeof d.keepInChatMessage !== "object")
                    throw TypeError(".proto.Message.keepInChatMessage: object expected");
                m.keepInChatMessage = $root.proto.Message.KeepInChatMessage.fromObject(d.keepInChatMessage);
            }
            if (d.documentWithCaptionMessage != null) {
                if (typeof d.documentWithCaptionMessage !== "object")
                    throw TypeError(".proto.Message.documentWithCaptionMessage: object expected");
                m.documentWithCaptionMessage = $root.proto.Message.FutureProofMessage.fromObject(d.documentWithCaptionMessage);
            }
            if (d.requestPhoneNumberMessage != null) {
                if (typeof d.requestPhoneNumberMessage !== "object")
                    throw TypeError(".proto.Message.requestPhoneNumberMessage: object expected");
                m.requestPhoneNumberMessage = $root.proto.Message.RequestPhoneNumberMessage.fromObject(d.requestPhoneNumberMessage);
            }
            if (d.viewOnceMessageV2 != null) {
                if (typeof d.viewOnceMessageV2 !== "object")
                    throw TypeError(".proto.Message.viewOnceMessageV2: object expected");
                m.viewOnceMessageV2 = $root.proto.Message.FutureProofMessage.fromObject(d.viewOnceMessageV2);
            }
            if (d.encReactionMessage != null) {
                if (typeof d.encReactionMessage !== "object")
                    throw TypeError(".proto.Message.encReactionMessage: object expected");
                m.encReactionMessage = $root.proto.Message.EncReactionMessage.fromObject(d.encReactionMessage);
            }
            if (d.editedMessage != null) {
                if (typeof d.editedMessage !== "object")
                    throw TypeError(".proto.Message.editedMessage: object expected");
                m.editedMessage = $root.proto.Message.FutureProofMessage.fromObject(d.editedMessage);
            }
            if (d.viewOnceMessageV2Extension != null) {
                if (typeof d.viewOnceMessageV2Extension !== "object")
                    throw TypeError(".proto.Message.viewOnceMessageV2Extension: object expected");
                m.viewOnceMessageV2Extension = $root.proto.Message.FutureProofMessage.fromObject(d.viewOnceMessageV2Extension);
            }
            if (d.pollCreationMessageV2 != null) {
                if (typeof d.pollCreationMessageV2 !== "object")
                    throw TypeError(".proto.Message.pollCreationMessageV2: object expected");
                m.pollCreationMessageV2 = $root.proto.Message.PollCreationMessage.fromObject(d.pollCreationMessageV2);
            }
            if (d.scheduledCallCreationMessage != null) {
                if (typeof d.scheduledCallCreationMessage !== "object")
                    throw TypeError(".proto.Message.scheduledCallCreationMessage: object expected");
                m.scheduledCallCreationMessage = $root.proto.Message.ScheduledCallCreationMessage.fromObject(d.scheduledCallCreationMessage);
            }
            if (d.groupMentionedMessage != null) {
                if (typeof d.groupMentionedMessage !== "object")
                    throw TypeError(".proto.Message.groupMentionedMessage: object expected");
                m.groupMentionedMessage = $root.proto.Message.FutureProofMessage.fromObject(d.groupMentionedMessage);
            }
            if (d.pinInChatMessage != null) {
                if (typeof d.pinInChatMessage !== "object")
                    throw TypeError(".proto.Message.pinInChatMessage: object expected");
                m.pinInChatMessage = $root.proto.Message.PinInChatMessage.fromObject(d.pinInChatMessage);
            }
            if (d.pollCreationMessageV3 != null) {
                if (typeof d.pollCreationMessageV3 !== "object")
                    throw TypeError(".proto.Message.pollCreationMessageV3: object expected");
                m.pollCreationMessageV3 = $root.proto.Message.PollCreationMessage.fromObject(d.pollCreationMessageV3);
            }
            if (d.scheduledCallEditMessage != null) {
                if (typeof d.scheduledCallEditMessage !== "object")
                    throw TypeError(".proto.Message.scheduledCallEditMessage: object expected");
                m.scheduledCallEditMessage = $root.proto.Message.ScheduledCallEditMessage.fromObject(d.scheduledCallEditMessage);
            }
            if (d.ptvMessage != null) {
                if (typeof d.ptvMessage !== "object")
                    throw TypeError(".proto.Message.ptvMessage: object expected");
                m.ptvMessage = $root.proto.Message.VideoMessage.fromObject(d.ptvMessage);
            }
            if (d.botInvokeMessage != null) {
                if (typeof d.botInvokeMessage !== "object")
                    throw TypeError(".proto.Message.botInvokeMessage: object expected");
                m.botInvokeMessage = $root.proto.Message.FutureProofMessage.fromObject(d.botInvokeMessage);
            }
            if (d.callLogMesssage != null) {
                if (typeof d.callLogMesssage !== "object")
                    throw TypeError(".proto.Message.callLogMesssage: object expected");
                m.callLogMesssage = $root.proto.Message.CallLogMessage.fromObject(d.callLogMesssage);
            }
            if (d.messageHistoryBundle != null) {
                if (typeof d.messageHistoryBundle !== "object")
                    throw TypeError(".proto.Message.messageHistoryBundle: object expected");
                m.messageHistoryBundle = $root.proto.Message.MessageHistoryBundle.fromObject(d.messageHistoryBundle);
            }
            if (d.encCommentMessage != null) {
                if (typeof d.encCommentMessage !== "object")
                    throw TypeError(".proto.Message.encCommentMessage: object expected");
                m.encCommentMessage = $root.proto.Message.EncCommentMessage.fromObject(d.encCommentMessage);
            }
            if (d.bcallMessage != null) {
                if (typeof d.bcallMessage !== "object")
                    throw TypeError(".proto.Message.bcallMessage: object expected");
                m.bcallMessage = $root.proto.Message.BCallMessage.fromObject(d.bcallMessage);
            }
            if (d.lottieStickerMessage != null) {
                if (typeof d.lottieStickerMessage !== "object")
                    throw TypeError(".proto.Message.lottieStickerMessage: object expected");
                m.lottieStickerMessage = $root.proto.Message.FutureProofMessage.fromObject(d.lottieStickerMessage);
            }
            if (d.eventMessage != null) {
                if (typeof d.eventMessage !== "object")
                    throw TypeError(".proto.Message.eventMessage: object expected");
                m.eventMessage = $root.proto.Message.EventMessage.fromObject(d.eventMessage);
            }
            if (d.encEventResponseMessage != null) {
                if (typeof d.encEventResponseMessage !== "object")
                    throw TypeError(".proto.Message.encEventResponseMessage: object expected");
                m.encEventResponseMessage = $root.proto.Message.EncEventResponseMessage.fromObject(d.encEventResponseMessage);
            }
            if (d.commentMessage != null) {
                if (typeof d.commentMessage !== "object")
                    throw TypeError(".proto.Message.commentMessage: object expected");
                m.commentMessage = $root.proto.Message.CommentMessage.fromObject(d.commentMessage);
            }
            if (d.newsletterAdminInviteMessage != null) {
                if (typeof d.newsletterAdminInviteMessage !== "object")
                    throw TypeError(".proto.Message.newsletterAdminInviteMessage: object expected");
                m.newsletterAdminInviteMessage = $root.proto.Message.NewsletterAdminInviteMessage.fromObject(d.newsletterAdminInviteMessage);
            }
            if (d.placeholderMessage != null) {
                if (typeof d.placeholderMessage !== "object")
                    throw TypeError(".proto.Message.placeholderMessage: object expected");
                m.placeholderMessage = $root.proto.Message.PlaceholderMessage.fromObject(d.placeholderMessage);
            }
            if (d.secretEncryptedMessage != null) {
                if (typeof d.secretEncryptedMessage !== "object")
                    throw TypeError(".proto.Message.secretEncryptedMessage: object expected");
                m.secretEncryptedMessage = $root.proto.Message.SecretEncryptedMessage.fromObject(d.secretEncryptedMessage);
            }
            if (d.albumMessage != null) {
                if (typeof d.albumMessage !== "object")
                    throw TypeError(".proto.Message.albumMessage: object expected");
                m.albumMessage = $root.proto.Message.AlbumMessage.fromObject(d.albumMessage);
            }
            if (d.eventCoverImage != null) {
                if (typeof d.eventCoverImage !== "object")
                    throw TypeError(".proto.Message.eventCoverImage: object expected");
                m.eventCoverImage = $root.proto.Message.FutureProofMessage.fromObject(d.eventCoverImage);
            }
            if (d.stickerPackMessage != null) {
                if (typeof d.stickerPackMessage !== "object")
                    throw TypeError(".proto.Message.stickerPackMessage: object expected");
                m.stickerPackMessage = $root.proto.Message.StickerPackMessage.fromObject(d.stickerPackMessage);
            }
            if (d.statusMentionMessage != null) {
                if (typeof d.statusMentionMessage !== "object")
                    throw TypeError(".proto.Message.statusMentionMessage: object expected");
                m.statusMentionMessage = $root.proto.Message.FutureProofMessage.fromObject(d.statusMentionMessage);
            }
            if (d.pollResultSnapshotMessage != null) {
                if (typeof d.pollResultSnapshotMessage !== "object")
                    throw TypeError(".proto.Message.pollResultSnapshotMessage: object expected");
                m.pollResultSnapshotMessage = $root.proto.Message.PollResultSnapshotMessage.fromObject(d.pollResultSnapshotMessage);
            }
            if (d.pollCreationOptionImageMessage != null) {
                if (typeof d.pollCreationOptionImageMessage !== "object")
                    throw TypeError(".proto.Message.pollCreationOptionImageMessage: object expected");
                m.pollCreationOptionImageMessage = $root.proto.Message.FutureProofMessage.fromObject(d.pollCreationOptionImageMessage);
            }
            if (d.associatedChildMessage != null) {
                if (typeof d.associatedChildMessage !== "object")
                    throw TypeError(".proto.Message.associatedChildMessage: object expected");
                m.associatedChildMessage = $root.proto.Message.FutureProofMessage.fromObject(d.associatedChildMessage);
            }
            if (d.groupStatusMentionMessage != null) {
                if (typeof d.groupStatusMentionMessage !== "object")
                    throw TypeError(".proto.Message.groupStatusMentionMessage: object expected");
                m.groupStatusMentionMessage = $root.proto.Message.FutureProofMessage.fromObject(d.groupStatusMentionMessage);
            }
            if (d.pollCreationMessageV4 != null) {
                if (typeof d.pollCreationMessageV4 !== "object")
                    throw TypeError(".proto.Message.pollCreationMessageV4: object expected");
                m.pollCreationMessageV4 = $root.proto.Message.FutureProofMessage.fromObject(d.pollCreationMessageV4);
            }
            if (d.statusAddYours != null) {
                if (typeof d.statusAddYours !== "object")
                    throw TypeError(".proto.Message.statusAddYours: object expected");
                m.statusAddYours = $root.proto.Message.FutureProofMessage.fromObject(d.statusAddYours);
            }
            if (d.groupStatusMessage != null) {
                if (typeof d.groupStatusMessage !== "object")
                    throw TypeError(".proto.Message.groupStatusMessage: object expected");
                m.groupStatusMessage = $root.proto.Message.FutureProofMessage.fromObject(d.groupStatusMessage);
            }
            if (d.richResponseMessage != null) {
                if (typeof d.richResponseMessage !== "object")
                    throw TypeError(".proto.Message.richResponseMessage: object expected");
                m.richResponseMessage = $root.proto.AIRichResponseMessage.fromObject(d.richResponseMessage);
            }
            if (d.statusNotificationMessage != null) {
                if (typeof d.statusNotificationMessage !== "object")
                    throw TypeError(".proto.Message.statusNotificationMessage: object expected");
                m.statusNotificationMessage = $root.proto.Message.StatusNotificationMessage.fromObject(d.statusNotificationMessage);
            }
            if (d.limitSharingMessage != null) {
                if (typeof d.limitSharingMessage !== "object")
                    throw TypeError(".proto.Message.limitSharingMessage: object expected");
                m.limitSharingMessage = $root.proto.Message.FutureProofMessage.fromObject(d.limitSharingMessage);
            }
            if (d.botTaskMessage != null) {
                if (typeof d.botTaskMessage !== "object")
                    throw TypeError(".proto.Message.botTaskMessage: object expected");
                m.botTaskMessage = $root.proto.Message.FutureProofMessage.fromObject(d.botTaskMessage);
            }
            if (d.questionMessage != null) {
                if (typeof d.questionMessage !== "object")
                    throw TypeError(".proto.Message.questionMessage: object expected");
                m.questionMessage = $root.proto.Message.FutureProofMessage.fromObject(d.questionMessage);
            }
            if (d.messageHistoryNotice != null) {
                if (typeof d.messageHistoryNotice !== "object")
                    throw TypeError(".proto.Message.messageHistoryNotice: object expected");
                m.messageHistoryNotice = $root.proto.Message.MessageHistoryNotice.fromObject(d.messageHistoryNotice);
            }
            if (d.groupStatusMessageV2 != null) {
                if (typeof d.groupStatusMessageV2 !== "object")
                    throw TypeError(".proto.Message.groupStatusMessageV2: object expected");
                m.groupStatusMessageV2 = $root.proto.Message.FutureProofMessage.fromObject(d.groupStatusMessageV2);
            }
            if (d.botForwardedMessage != null) {
                if (typeof d.botForwardedMessage !== "object")
                    throw TypeError(".proto.Message.botForwardedMessage: object expected");
                m.botForwardedMessage = $root.proto.Message.FutureProofMessage.fromObject(d.botForwardedMessage);
            }
            if (d.statusQuestionAnswerMessage != null) {
                if (typeof d.statusQuestionAnswerMessage !== "object")
                    throw TypeError(".proto.Message.statusQuestionAnswerMessage: object expected");
                m.statusQuestionAnswerMessage = $root.proto.Message.StatusQuestionAnswerMessage.fromObject(d.statusQuestionAnswerMessage);
            }
            if (d.questionReplyMessage != null) {
                if (typeof d.questionReplyMessage !== "object")
                    throw TypeError(".proto.Message.questionReplyMessage: object expected");
                m.questionReplyMessage = $root.proto.Message.FutureProofMessage.fromObject(d.questionReplyMessage);
            }
            if (d.questionResponseMessage != null) {
                if (typeof d.questionResponseMessage !== "object")
                    throw TypeError(".proto.Message.questionResponseMessage: object expected");
                m.questionResponseMessage = $root.proto.Message.QuestionResponseMessage.fromObject(d.questionResponseMessage);
            }
            if (d.statusQuotedMessage != null) {
                if (typeof d.statusQuotedMessage !== "object")
                    throw TypeError(".proto.Message.statusQuotedMessage: object expected");
                m.statusQuotedMessage = $root.proto.Message.StatusQuotedMessage.fromObject(d.statusQuotedMessage);
            }
            if (d.statusStickerInteractionMessage != null) {
                if (typeof d.statusStickerInteractionMessage !== "object")
                    throw TypeError(".proto.Message.statusStickerInteractionMessage: object expected");
                m.statusStickerInteractionMessage = $root.proto.Message.StatusStickerInteractionMessage.fromObject(d.statusStickerInteractionMessage);
            }
            if (d.pollCreationMessageV5 != null) {
                if (typeof d.pollCreationMessageV5 !== "object")
                    throw TypeError(".proto.Message.pollCreationMessageV5: object expected");
                m.pollCreationMessageV5 = $root.proto.Message.PollCreationMessage.fromObject(d.pollCreationMessageV5);
            }
            if (d.newsletterFollowerInviteMessageV2 != null) {
                if (typeof d.newsletterFollowerInviteMessageV2 !== "object")
                    throw TypeError(".proto.Message.newsletterFollowerInviteMessageV2: object expected");
                m.newsletterFollowerInviteMessageV2 = $root.proto.Message.NewsletterFollowerInviteMessage.fromObject(d.newsletterFollowerInviteMessageV2);
            }
            if (d.pollResultSnapshotMessageV3 != null) {
                if (typeof d.pollResultSnapshotMessageV3 !== "object")
                    throw TypeError(".proto.Message.pollResultSnapshotMessageV3: object expected");
                m.pollResultSnapshotMessageV3 = $root.proto.Message.PollResultSnapshotMessage.fromObject(d.pollResultSnapshotMessageV3);
            }
            return m;
        };

        Message.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.conversation != null && m.hasOwnProperty("conversation")) {
                d.conversation = m.conversation;
                if (o.oneofs)
                    d._conversation = "conversation";
            }
            if (m.senderKeyDistributionMessage != null && m.hasOwnProperty("senderKeyDistributionMessage")) {
                d.senderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.toObject(m.senderKeyDistributionMessage, o);
                if (o.oneofs)
                    d._senderKeyDistributionMessage = "senderKeyDistributionMessage";
            }
            if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) {
                d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o);
                if (o.oneofs)
                    d._imageMessage = "imageMessage";
            }
            if (m.contactMessage != null && m.hasOwnProperty("contactMessage")) {
                d.contactMessage = $root.proto.Message.ContactMessage.toObject(m.contactMessage, o);
                if (o.oneofs)
                    d._contactMessage = "contactMessage";
            }
            if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) {
                d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o);
                if (o.oneofs)
                    d._locationMessage = "locationMessage";
            }
            if (m.extendedTextMessage != null && m.hasOwnProperty("extendedTextMessage")) {
                d.extendedTextMessage = $root.proto.Message.ExtendedTextMessage.toObject(m.extendedTextMessage, o);
                if (o.oneofs)
                    d._extendedTextMessage = "extendedTextMessage";
            }
            if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) {
                d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o);
                if (o.oneofs)
                    d._documentMessage = "documentMessage";
            }
            if (m.audioMessage != null && m.hasOwnProperty("audioMessage")) {
                d.audioMessage = $root.proto.Message.AudioMessage.toObject(m.audioMessage, o);
                if (o.oneofs)
                    d._audioMessage = "audioMessage";
            }
            if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) {
                d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o);
                if (o.oneofs)
                    d._videoMessage = "videoMessage";
            }
            if (m.call != null && m.hasOwnProperty("call")) {
                d.call = $root.proto.Message.Call.toObject(m.call, o);
                if (o.oneofs)
                    d._call = "call";
            }
            if (m.chat != null && m.hasOwnProperty("chat")) {
                d.chat = $root.proto.Message.Chat.toObject(m.chat, o);
                if (o.oneofs)
                    d._chat = "chat";
            }
            if (m.protocolMessage != null && m.hasOwnProperty("protocolMessage")) {
                d.protocolMessage = $root.proto.Message.ProtocolMessage.toObject(m.protocolMessage, o);
                if (o.oneofs)
                    d._protocolMessage = "protocolMessage";
            }
            if (m.contactsArrayMessage != null && m.hasOwnProperty("contactsArrayMessage")) {
                d.contactsArrayMessage = $root.proto.Message.ContactsArrayMessage.toObject(m.contactsArrayMessage, o);
                if (o.oneofs)
                    d._contactsArrayMessage = "contactsArrayMessage";
            }
            if (m.highlyStructuredMessage != null && m.hasOwnProperty("highlyStructuredMessage")) {
                d.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.toObject(m.highlyStructuredMessage, o);
                if (o.oneofs)
                    d._highlyStructuredMessage = "highlyStructuredMessage";
            }
            if (m.fastRatchetKeySenderKeyDistributionMessage != null && m.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")) {
                d.fastRatchetKeySenderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.toObject(m.fastRatchetKeySenderKeyDistributionMessage, o);
                if (o.oneofs)
                    d._fastRatchetKeySenderKeyDistributionMessage = "fastRatchetKeySenderKeyDistributionMessage";
            }
            if (m.sendPaymentMessage != null && m.hasOwnProperty("sendPaymentMessage")) {
                d.sendPaymentMessage = $root.proto.Message.SendPaymentMessage.toObject(m.sendPaymentMessage, o);
                if (o.oneofs)
                    d._sendPaymentMessage = "sendPaymentMessage";
            }
            if (m.liveLocationMessage != null && m.hasOwnProperty("liveLocationMessage")) {
                d.liveLocationMessage = $root.proto.Message.LiveLocationMessage.toObject(m.liveLocationMessage, o);
                if (o.oneofs)
                    d._liveLocationMessage = "liveLocationMessage";
            }
            if (m.requestPaymentMessage != null && m.hasOwnProperty("requestPaymentMessage")) {
                d.requestPaymentMessage = $root.proto.Message.RequestPaymentMessage.toObject(m.requestPaymentMessage, o);
                if (o.oneofs)
                    d._requestPaymentMessage = "requestPaymentMessage";
            }
            if (m.declinePaymentRequestMessage != null && m.hasOwnProperty("declinePaymentRequestMessage")) {
                d.declinePaymentRequestMessage = $root.proto.Message.DeclinePaymentRequestMessage.toObject(m.declinePaymentRequestMessage, o);
                if (o.oneofs)
                    d._declinePaymentRequestMessage = "declinePaymentRequestMessage";
            }
            if (m.cancelPaymentRequestMessage != null && m.hasOwnProperty("cancelPaymentRequestMessage")) {
                d.cancelPaymentRequestMessage = $root.proto.Message.CancelPaymentRequestMessage.toObject(m.cancelPaymentRequestMessage, o);
                if (o.oneofs)
                    d._cancelPaymentRequestMessage = "cancelPaymentRequestMessage";
            }
            if (m.templateMessage != null && m.hasOwnProperty("templateMessage")) {
                d.templateMessage = $root.proto.Message.TemplateMessage.toObject(m.templateMessage, o);
                if (o.oneofs)
                    d._templateMessage = "templateMessage";
            }
            if (m.stickerMessage != null && m.hasOwnProperty("stickerMessage")) {
                d.stickerMessage = $root.proto.Message.StickerMessage.toObject(m.stickerMessage, o);
                if (o.oneofs)
                    d._stickerMessage = "stickerMessage";
            }
            if (m.groupInviteMessage != null && m.hasOwnProperty("groupInviteMessage")) {
                d.groupInviteMessage = $root.proto.Message.GroupInviteMessage.toObject(m.groupInviteMessage, o);
                if (o.oneofs)
                    d._groupInviteMessage = "groupInviteMessage";
            }
            if (m.templateButtonReplyMessage != null && m.hasOwnProperty("templateButtonReplyMessage")) {
                d.templateButtonReplyMessage = $root.proto.Message.TemplateButtonReplyMessage.toObject(m.templateButtonReplyMessage, o);
                if (o.oneofs)
                    d._templateButtonReplyMessage = "templateButtonReplyMessage";
            }
            if (m.productMessage != null && m.hasOwnProperty("productMessage")) {
                d.productMessage = $root.proto.Message.ProductMessage.toObject(m.productMessage, o);
                if (o.oneofs)
                    d._productMessage = "productMessage";
            }
            if (m.deviceSentMessage != null && m.hasOwnProperty("deviceSentMessage")) {
                d.deviceSentMessage = $root.proto.Message.DeviceSentMessage.toObject(m.deviceSentMessage, o);
                if (o.oneofs)
                    d._deviceSentMessage = "deviceSentMessage";
            }
            if (m.messageContextInfo != null && m.hasOwnProperty("messageContextInfo")) {
                d.messageContextInfo = $root.proto.MessageContextInfo.toObject(m.messageContextInfo, o);
                if (o.oneofs)
                    d._messageContextInfo = "messageContextInfo";
            }
            if (m.listMessage != null && m.hasOwnProperty("listMessage")) {
                d.listMessage = $root.proto.Message.ListMessage.toObject(m.listMessage, o);
                if (o.oneofs)
                    d._listMessage = "listMessage";
            }
            if (m.viewOnceMessage != null && m.hasOwnProperty("viewOnceMessage")) {
                d.viewOnceMessage = $root.proto.Message.FutureProofMessage.toObject(m.viewOnceMessage, o);
                if (o.oneofs)
                    d._viewOnceMessage = "viewOnceMessage";
            }
            if (m.orderMessage != null && m.hasOwnProperty("orderMessage")) {
                d.orderMessage = $root.proto.Message.OrderMessage.toObject(m.orderMessage, o);
                if (o.oneofs)
                    d._orderMessage = "orderMessage";
            }
            if (m.listResponseMessage != null && m.hasOwnProperty("listResponseMessage")) {
                d.listResponseMessage = $root.proto.Message.ListResponseMessage.toObject(m.listResponseMessage, o);
                if (o.oneofs)
                    d._listResponseMessage = "listResponseMessage";
            }
            if (m.ephemeralMessage != null && m.hasOwnProperty("ephemeralMessage")) {
                d.ephemeralMessage = $root.proto.Message.FutureProofMessage.toObject(m.ephemeralMessage, o);
                if (o.oneofs)
                    d._ephemeralMessage = "ephemeralMessage";
            }
            if (m.invoiceMessage != null && m.hasOwnProperty("invoiceMessage")) {
                d.invoiceMessage = $root.proto.Message.InvoiceMessage.toObject(m.invoiceMessage, o);
                if (o.oneofs)
                    d._invoiceMessage = "invoiceMessage";
            }
            if (m.buttonsMessage != null && m.hasOwnProperty("buttonsMessage")) {
                d.buttonsMessage = $root.proto.Message.ButtonsMessage.toObject(m.buttonsMessage, o);
                if (o.oneofs)
                    d._buttonsMessage = "buttonsMessage";
            }
            if (m.buttonsResponseMessage != null && m.hasOwnProperty("buttonsResponseMessage")) {
                d.buttonsResponseMessage = $root.proto.Message.ButtonsResponseMessage.toObject(m.buttonsResponseMessage, o);
                if (o.oneofs)
                    d._buttonsResponseMessage = "buttonsResponseMessage";
            }
            if (m.paymentInviteMessage != null && m.hasOwnProperty("paymentInviteMessage")) {
                d.paymentInviteMessage = $root.proto.Message.PaymentInviteMessage.toObject(m.paymentInviteMessage, o);
                if (o.oneofs)
                    d._paymentInviteMessage = "paymentInviteMessage";
            }
            if (m.interactiveMessage != null && m.hasOwnProperty("interactiveMessage")) {
                d.interactiveMessage = $root.proto.Message.InteractiveMessage.toObject(m.interactiveMessage, o);
                if (o.oneofs)
                    d._interactiveMessage = "interactiveMessage";
            }
            if (m.reactionMessage != null && m.hasOwnProperty("reactionMessage")) {
                d.reactionMessage = $root.proto.Message.ReactionMessage.toObject(m.reactionMessage, o);
                if (o.oneofs)
                    d._reactionMessage = "reactionMessage";
            }
            if (m.stickerSyncRmrMessage != null && m.hasOwnProperty("stickerSyncRmrMessage")) {
                d.stickerSyncRmrMessage = $root.proto.Message.StickerSyncRMRMessage.toObject(m.stickerSyncRmrMessage, o);
                if (o.oneofs)
                    d._stickerSyncRmrMessage = "stickerSyncRmrMessage";
            }
            if (m.interactiveResponseMessage != null && m.hasOwnProperty("interactiveResponseMessage")) {
                d.interactiveResponseMessage = $root.proto.Message.InteractiveResponseMessage.toObject(m.interactiveResponseMessage, o);
                if (o.oneofs)
                    d._interactiveResponseMessage = "interactiveResponseMessage";
            }
            if (m.pollCreationMessage != null && m.hasOwnProperty("pollCreationMessage")) {
                d.pollCreationMessage = $root.proto.Message.PollCreationMessage.toObject(m.pollCreationMessage, o);
                if (o.oneofs)
                    d._pollCreationMessage = "pollCreationMessage";
            }
            if (m.pollUpdateMessage != null && m.hasOwnProperty("pollUpdateMessage")) {
                d.pollUpdateMessage = $root.proto.Message.PollUpdateMessage.toObject(m.pollUpdateMessage, o);
                if (o.oneofs)
                    d._pollUpdateMessage = "pollUpdateMessage";
            }
            if (m.keepInChatMessage != null && m.hasOwnProperty("keepInChatMessage")) {
                d.keepInChatMessage = $root.proto.Message.KeepInChatMessage.toObject(m.keepInChatMessage, o);
                if (o.oneofs)
                    d._keepInChatMessage = "keepInChatMessage";
            }
            if (m.documentWithCaptionMessage != null && m.hasOwnProperty("documentWithCaptionMessage")) {
                d.documentWithCaptionMessage = $root.proto.Message.FutureProofMessage.toObject(m.documentWithCaptionMessage, o);
                if (o.oneofs)
                    d._documentWithCaptionMessage = "documentWithCaptionMessage";
            }
            if (m.requestPhoneNumberMessage != null && m.hasOwnProperty("requestPhoneNumberMessage")) {
                d.requestPhoneNumberMessage = $root.proto.Message.RequestPhoneNumberMessage.toObject(m.requestPhoneNumberMessage, o);
                if (o.oneofs)
                    d._requestPhoneNumberMessage = "requestPhoneNumberMessage";
            }
            if (m.viewOnceMessageV2 != null && m.hasOwnProperty("viewOnceMessageV2")) {
                d.viewOnceMessageV2 = $root.proto.Message.FutureProofMessage.toObject(m.viewOnceMessageV2, o);
                if (o.oneofs)
                    d._viewOnceMessageV2 = "viewOnceMessageV2";
            }
            if (m.encReactionMessage != null && m.hasOwnProperty("encReactionMessage")) {
                d.encReactionMessage = $root.proto.Message.EncReactionMessage.toObject(m.encReactionMessage, o);
                if (o.oneofs)
                    d._encReactionMessage = "encReactionMessage";
            }
            if (m.editedMessage != null && m.hasOwnProperty("editedMessage")) {
                d.editedMessage = $root.proto.Message.FutureProofMessage.toObject(m.editedMessage, o);
                if (o.oneofs)
                    d._editedMessage = "editedMessage";
            }
            if (m.viewOnceMessageV2Extension != null && m.hasOwnProperty("viewOnceMessageV2Extension")) {
                d.viewOnceMessageV2Extension = $root.proto.Message.FutureProofMessage.toObject(m.viewOnceMessageV2Extension, o);
                if (o.oneofs)
                    d._viewOnceMessageV2Extension = "viewOnceMessageV2Extension";
            }
            if (m.pollCreationMessageV2 != null && m.hasOwnProperty("pollCreationMessageV2")) {
                d.pollCreationMessageV2 = $root.proto.Message.PollCreationMessage.toObject(m.pollCreationMessageV2, o);
                if (o.oneofs)
                    d._pollCreationMessageV2 = "pollCreationMessageV2";
            }
            if (m.scheduledCallCreationMessage != null && m.hasOwnProperty("scheduledCallCreationMessage")) {
                d.scheduledCallCreationMessage = $root.proto.Message.ScheduledCallCreationMessage.toObject(m.scheduledCallCreationMessage, o);
                if (o.oneofs)
                    d._scheduledCallCreationMessage = "scheduledCallCreationMessage";
            }
            if (m.groupMentionedMessage != null && m.hasOwnProperty("groupMentionedMessage")) {
                d.groupMentionedMessage = $root.proto.Message.FutureProofMessage.toObject(m.groupMentionedMessage, o);
                if (o.oneofs)
                    d._groupMentionedMessage = "groupMentionedMessage";
            }
            if (m.pinInChatMessage != null && m.hasOwnProperty("pinInChatMessage")) {
                d.pinInChatMessage = $root.proto.Message.PinInChatMessage.toObject(m.pinInChatMessage, o);
                if (o.oneofs)
                    d._pinInChatMessage = "pinInChatMessage";
            }
            if (m.pollCreationMessageV3 != null && m.hasOwnProperty("pollCreationMessageV3")) {
                d.pollCreationMessageV3 = $root.proto.Message.PollCreationMessage.toObject(m.pollCreationMessageV3, o);
                if (o.oneofs)
                    d._pollCreationMessageV3 = "pollCreationMessageV3";
            }
            if (m.scheduledCallEditMessage != null && m.hasOwnProperty("scheduledCallEditMessage")) {
                d.scheduledCallEditMessage = $root.proto.Message.ScheduledCallEditMessage.toObject(m.scheduledCallEditMessage, o);
                if (o.oneofs)
                    d._scheduledCallEditMessage = "scheduledCallEditMessage";
            }
            if (m.ptvMessage != null && m.hasOwnProperty("ptvMessage")) {
                d.ptvMessage = $root.proto.Message.VideoMessage.toObject(m.ptvMessage, o);
                if (o.oneofs)
                    d._ptvMessage = "ptvMessage";
            }
            if (m.botInvokeMessage != null && m.hasOwnProperty("botInvokeMessage")) {
                d.botInvokeMessage = $root.proto.Message.FutureProofMessage.toObject(m.botInvokeMessage, o);
                if (o.oneofs)
                    d._botInvokeMessage = "botInvokeMessage";
            }
            if (m.callLogMesssage != null && m.hasOwnProperty("callLogMesssage")) {
                d.callLogMesssage = $root.proto.Message.CallLogMessage.toObject(m.callLogMesssage, o);
                if (o.oneofs)
                    d._callLogMesssage = "callLogMesssage";
            }
            if (m.messageHistoryBundle != null && m.hasOwnProperty("messageHistoryBundle")) {
                d.messageHistoryBundle = $root.proto.Message.MessageHistoryBundle.toObject(m.messageHistoryBundle, o);
                if (o.oneofs)
                    d._messageHistoryBundle = "messageHistoryBundle";
            }
            if (m.encCommentMessage != null && m.hasOwnProperty("encCommentMessage")) {
                d.encCommentMessage = $root.proto.Message.EncCommentMessage.toObject(m.encCommentMessage, o);
                if (o.oneofs)
                    d._encCommentMessage = "encCommentMessage";
            }
            if (m.bcallMessage != null && m.hasOwnProperty("bcallMessage")) {
                d.bcallMessage = $root.proto.Message.BCallMessage.toObject(m.bcallMessage, o);
                if (o.oneofs)
                    d._bcallMessage = "bcallMessage";
            }
            if (m.lottieStickerMessage != null && m.hasOwnProperty("lottieStickerMessage")) {
                d.lottieStickerMessage = $root.proto.Message.FutureProofMessage.toObject(m.lottieStickerMessage, o);
                if (o.oneofs)
                    d._lottieStickerMessage = "lottieStickerMessage";
            }
            if (m.eventMessage != null && m.hasOwnProperty("eventMessage")) {
                d.eventMessage = $root.proto.Message.EventMessage.toObject(m.eventMessage, o);
                if (o.oneofs)
                    d._eventMessage = "eventMessage";
            }
            if (m.encEventResponseMessage != null && m.hasOwnProperty("encEventResponseMessage")) {
                d.encEventResponseMessage = $root.proto.Message.EncEventResponseMessage.toObject(m.encEventResponseMessage, o);
                if (o.oneofs)
                    d._encEventResponseMessage = "encEventResponseMessage";
            }
            if (m.commentMessage != null && m.hasOwnProperty("commentMessage")) {
                d.commentMessage = $root.proto.Message.CommentMessage.toObject(m.commentMessage, o);
                if (o.oneofs)
                    d._commentMessage = "commentMessage";
            }
            if (m.newsletterAdminInviteMessage != null && m.hasOwnProperty("newsletterAdminInviteMessage")) {
                d.newsletterAdminInviteMessage = $root.proto.Message.NewsletterAdminInviteMessage.toObject(m.newsletterAdminInviteMessage, o);
                if (o.oneofs)
                    d._newsletterAdminInviteMessage = "newsletterAdminInviteMessage";
            }
            if (m.placeholderMessage != null && m.hasOwnProperty("placeholderMessage")) {
                d.placeholderMessage = $root.proto.Message.PlaceholderMessage.toObject(m.placeholderMessage, o);
                if (o.oneofs)
                    d._placeholderMessage = "placeholderMessage";
            }
            if (m.secretEncryptedMessage != null && m.hasOwnProperty("secretEncryptedMessage")) {
                d.secretEncryptedMessage = $root.proto.Message.SecretEncryptedMessage.toObject(m.secretEncryptedMessage, o);
                if (o.oneofs)
                    d._secretEncryptedMessage = "secretEncryptedMessage";
            }
            if (m.albumMessage != null && m.hasOwnProperty("albumMessage")) {
                d.albumMessage = $root.proto.Message.AlbumMessage.toObject(m.albumMessage, o);
                if (o.oneofs)
                    d._albumMessage = "albumMessage";
            }
            if (m.eventCoverImage != null && m.hasOwnProperty("eventCoverImage")) {
                d.eventCoverImage = $root.proto.Message.FutureProofMessage.toObject(m.eventCoverImage, o);
                if (o.oneofs)
                    d._eventCoverImage = "eventCoverImage";
            }
            if (m.stickerPackMessage != null && m.hasOwnProperty("stickerPackMessage")) {
                d.stickerPackMessage = $root.proto.Message.StickerPackMessage.toObject(m.stickerPackMessage, o);
                if (o.oneofs)
                    d._stickerPackMessage = "stickerPackMessage";
            }
            if (m.statusMentionMessage != null && m.hasOwnProperty("statusMentionMessage")) {
                d.statusMentionMessage = $root.proto.Message.FutureProofMessage.toObject(m.statusMentionMessage, o);
                if (o.oneofs)
                    d._statusMentionMessage = "statusMentionMessage";
            }
            if (m.pollResultSnapshotMessage != null && m.hasOwnProperty("pollResultSnapshotMessage")) {
                d.pollResultSnapshotMessage = $root.proto.Message.PollResultSnapshotMessage.toObject(m.pollResultSnapshotMessage, o);
                if (o.oneofs)
                    d._pollResultSnapshotMessage = "pollResultSnapshotMessage";
            }
            if (m.pollCreationOptionImageMessage != null && m.hasOwnProperty("pollCreationOptionImageMessage")) {
                d.pollCreationOptionImageMessage = $root.proto.Message.FutureProofMessage.toObject(m.pollCreationOptionImageMessage, o);
                if (o.oneofs)
                    d._pollCreationOptionImageMessage = "pollCreationOptionImageMessage";
            }
            if (m.associatedChildMessage != null && m.hasOwnProperty("associatedChildMessage")) {
                d.associatedChildMessage = $root.proto.Message.FutureProofMessage.toObject(m.associatedChildMessage, o);
                if (o.oneofs)
                    d._associatedChildMessage = "associatedChildMessage";
            }
            if (m.groupStatusMentionMessage != null && m.hasOwnProperty("groupStatusMentionMessage")) {
                d.groupStatusMentionMessage = $root.proto.Message.FutureProofMessage.toObject(m.groupStatusMentionMessage, o);
                if (o.oneofs)
                    d._groupStatusMentionMessage = "groupStatusMentionMessage";
            }
            if (m.pollCreationMessageV4 != null && m.hasOwnProperty("pollCreationMessageV4")) {
                d.pollCreationMessageV4 = $root.proto.Message.FutureProofMessage.toObject(m.pollCreationMessageV4, o);
                if (o.oneofs)
                    d._pollCreationMessageV4 = "pollCreationMessageV4";
            }
            if (m.statusAddYours != null && m.hasOwnProperty("statusAddYours")) {
                d.statusAddYours = $root.proto.Message.FutureProofMessage.toObject(m.statusAddYours, o);
                if (o.oneofs)
                    d._statusAddYours = "statusAddYours";
            }
            if (m.groupStatusMessage != null && m.hasOwnProperty("groupStatusMessage")) {
                d.groupStatusMessage = $root.proto.Message.FutureProofMessage.toObject(m.groupStatusMessage, o);
                if (o.oneofs)
                    d._groupStatusMessage = "groupStatusMessage";
            }
            if (m.richResponseMessage != null && m.hasOwnProperty("richResponseMessage")) {
                d.richResponseMessage = $root.proto.AIRichResponseMessage.toObject(m.richResponseMessage, o);
                if (o.oneofs)
                    d._richResponseMessage = "richResponseMessage";
            }
            if (m.statusNotificationMessage != null && m.hasOwnProperty("statusNotificationMessage")) {
                d.statusNotificationMessage = $root.proto.Message.StatusNotificationMessage.toObject(m.statusNotificationMessage, o);
                if (o.oneofs)
                    d._statusNotificationMessage = "statusNotificationMessage";
            }
            if (m.limitSharingMessage != null && m.hasOwnProperty("limitSharingMessage")) {
                d.limitSharingMessage = $root.proto.Message.FutureProofMessage.toObject(m.limitSharingMessage, o);
                if (o.oneofs)
                    d._limitSharingMessage = "limitSharingMessage";
            }
            if (m.botTaskMessage != null && m.hasOwnProperty("botTaskMessage")) {
                d.botTaskMessage = $root.proto.Message.FutureProofMessage.toObject(m.botTaskMessage, o);
                if (o.oneofs)
                    d._botTaskMessage = "botTaskMessage";
            }
            if (m.questionMessage != null && m.hasOwnProperty("questionMessage")) {
                d.questionMessage = $root.proto.Message.FutureProofMessage.toObject(m.questionMessage, o);
                if (o.oneofs)
                    d._questionMessage = "questionMessage";
            }
            if (m.messageHistoryNotice != null && m.hasOwnProperty("messageHistoryNotice")) {
                d.messageHistoryNotice = $root.proto.Message.MessageHistoryNotice.toObject(m.messageHistoryNotice, o);
                if (o.oneofs)
                    d._messageHistoryNotice = "messageHistoryNotice";
            }
            if (m.groupStatusMessageV2 != null && m.hasOwnProperty("groupStatusMessageV2")) {
                d.groupStatusMessageV2 = $root.proto.Message.FutureProofMessage.toObject(m.groupStatusMessageV2, o);
                if (o.oneofs)
                    d._groupStatusMessageV2 = "groupStatusMessageV2";
            }
            if (m.botForwardedMessage != null && m.hasOwnProperty("botForwardedMessage")) {
                d.botForwardedMessage = $root.proto.Message.FutureProofMessage.toObject(m.botForwardedMessage, o);
                if (o.oneofs)
                    d._botForwardedMessage = "botForwardedMessage";
            }
            if (m.statusQuestionAnswerMessage != null && m.hasOwnProperty("statusQuestionAnswerMessage")) {
                d.statusQuestionAnswerMessage = $root.proto.Message.StatusQuestionAnswerMessage.toObject(m.statusQuestionAnswerMessage, o);
                if (o.oneofs)
                    d._statusQuestionAnswerMessage = "statusQuestionAnswerMessage";
            }
            if (m.questionReplyMessage != null && m.hasOwnProperty("questionReplyMessage")) {
                d.questionReplyMessage = $root.proto.Message.FutureProofMessage.toObject(m.questionReplyMessage, o);
                if (o.oneofs)
                    d._questionReplyMessage = "questionReplyMessage";
            }
            if (m.questionResponseMessage != null && m.hasOwnProperty("questionResponseMessage")) {
                d.questionResponseMessage = $root.proto.Message.QuestionResponseMessage.toObject(m.questionResponseMessage, o);
                if (o.oneofs)
                    d._questionResponseMessage = "questionResponseMessage";
            }
            if (m.statusQuotedMessage != null && m.hasOwnProperty("statusQuotedMessage")) {
                d.statusQuotedMessage = $root.proto.Message.StatusQuotedMessage.toObject(m.statusQuotedMessage, o);
                if (o.oneofs)
                    d._statusQuotedMessage = "statusQuotedMessage";
            }
            if (m.statusStickerInteractionMessage != null && m.hasOwnProperty("statusStickerInteractionMessage")) {
                d.statusStickerInteractionMessage = $root.proto.Message.StatusStickerInteractionMessage.toObject(m.statusStickerInteractionMessage, o);
                if (o.oneofs)
                    d._statusStickerInteractionMessage = "statusStickerInteractionMessage";
            }
            if (m.pollCreationMessageV5 != null && m.hasOwnProperty("pollCreationMessageV5")) {
                d.pollCreationMessageV5 = $root.proto.Message.PollCreationMessage.toObject(m.pollCreationMessageV5, o);
                if (o.oneofs)
                    d._pollCreationMessageV5 = "pollCreationMessageV5";
            }
            if (m.newsletterFollowerInviteMessageV2 != null && m.hasOwnProperty("newsletterFollowerInviteMessageV2")) {
                d.newsletterFollowerInviteMessageV2 = $root.proto.Message.NewsletterFollowerInviteMessage.toObject(m.newsletterFollowerInviteMessageV2, o);
                if (o.oneofs)
                    d._newsletterFollowerInviteMessageV2 = "newsletterFollowerInviteMessageV2";
            }
            if (m.pollResultSnapshotMessageV3 != null && m.hasOwnProperty("pollResultSnapshotMessageV3")) {
                d.pollResultSnapshotMessageV3 = $root.proto.Message.PollResultSnapshotMessage.toObject(m.pollResultSnapshotMessageV3, o);
                if (o.oneofs)
                    d._pollResultSnapshotMessageV3 = "pollResultSnapshotMessageV3";
            }
            return d;
        };

        Message.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Message";
        };

        Message.AlbumMessage = (function() {

            function AlbumMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AlbumMessage.prototype.expectedImageCount = null;
            AlbumMessage.prototype.expectedVideoCount = null;
            AlbumMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AlbumMessage.prototype, "_expectedImageCount", {
                get: $util.oneOfGetter($oneOfFields = ["expectedImageCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AlbumMessage.prototype, "_expectedVideoCount", {
                get: $util.oneOfGetter($oneOfFields = ["expectedVideoCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AlbumMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AlbumMessage.create = function create(properties) {
                return new AlbumMessage(properties);
            };

            AlbumMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.expectedImageCount != null && Object.hasOwnProperty.call(m, "expectedImageCount"))
                    w.uint32(16).uint32(m.expectedImageCount);
                if (m.expectedVideoCount != null && Object.hasOwnProperty.call(m, "expectedVideoCount"))
                    w.uint32(24).uint32(m.expectedVideoCount);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                return w;
            };

            AlbumMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AlbumMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 2: {
                            m.expectedImageCount = r.uint32();
                            break;
                        }
                    case 3: {
                            m.expectedVideoCount = r.uint32();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AlbumMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AlbumMessage)
                    return d;
                var m = new $root.proto.Message.AlbumMessage();
                if (d.expectedImageCount != null) {
                    m.expectedImageCount = d.expectedImageCount >>> 0;
                }
                if (d.expectedVideoCount != null) {
                    m.expectedVideoCount = d.expectedVideoCount >>> 0;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.AlbumMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            AlbumMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.expectedImageCount != null && m.hasOwnProperty("expectedImageCount")) {
                    d.expectedImageCount = m.expectedImageCount;
                    if (o.oneofs)
                        d._expectedImageCount = "expectedImageCount";
                }
                if (m.expectedVideoCount != null && m.hasOwnProperty("expectedVideoCount")) {
                    d.expectedVideoCount = m.expectedVideoCount;
                    if (o.oneofs)
                        d._expectedVideoCount = "expectedVideoCount";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            AlbumMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AlbumMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AlbumMessage";
            };

            return AlbumMessage;
        })();

        Message.AppStateFatalExceptionNotification = (function() {

            function AppStateFatalExceptionNotification(p) {
                this.collectionNames = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AppStateFatalExceptionNotification.prototype.collectionNames = $util.emptyArray;
            AppStateFatalExceptionNotification.prototype.timestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateFatalExceptionNotification.prototype, "_timestamp", {
                get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AppStateFatalExceptionNotification.create = function create(properties) {
                return new AppStateFatalExceptionNotification(properties);
            };

            AppStateFatalExceptionNotification.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.collectionNames != null && m.collectionNames.length) {
                    for (var i = 0; i < m.collectionNames.length; ++i)
                        w.uint32(10).string(m.collectionNames[i]);
                }
                if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                    w.uint32(16).int64(m.timestamp);
                return w;
            };

            AppStateFatalExceptionNotification.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AppStateFatalExceptionNotification();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.collectionNames && m.collectionNames.length))
                                m.collectionNames = [];
                            m.collectionNames.push(r.string());
                            break;
                        }
                    case 2: {
                            m.timestamp = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AppStateFatalExceptionNotification.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AppStateFatalExceptionNotification)
                    return d;
                var m = new $root.proto.Message.AppStateFatalExceptionNotification();
                if (d.collectionNames) {
                    if (!Array.isArray(d.collectionNames))
                        throw TypeError(".proto.Message.AppStateFatalExceptionNotification.collectionNames: array expected");
                    m.collectionNames = [];
                    for (var i = 0; i < d.collectionNames.length; ++i) {
                        m.collectionNames[i] = String(d.collectionNames[i]);
                    }
                }
                if (d.timestamp != null) {
                    if ($util.Long)
                        (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                    else if (typeof d.timestamp === "string")
                        m.timestamp = parseInt(d.timestamp, 10);
                    else if (typeof d.timestamp === "number")
                        m.timestamp = d.timestamp;
                    else if (typeof d.timestamp === "object")
                        m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
                }
                return m;
            };

            AppStateFatalExceptionNotification.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.collectionNames = [];
                }
                if (m.collectionNames && m.collectionNames.length) {
                    d.collectionNames = [];
                    for (var j = 0; j < m.collectionNames.length; ++j) {
                        d.collectionNames[j] = m.collectionNames[j];
                    }
                }
                if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                    if (typeof m.timestamp === "number")
                        d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                    else
                        d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                    if (o.oneofs)
                        d._timestamp = "timestamp";
                }
                return d;
            };

            AppStateFatalExceptionNotification.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AppStateFatalExceptionNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AppStateFatalExceptionNotification";
            };

            return AppStateFatalExceptionNotification;
        })();

        Message.AppStateSyncKey = (function() {

            function AppStateSyncKey(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AppStateSyncKey.prototype.keyId = null;
            AppStateSyncKey.prototype.keyData = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateSyncKey.prototype, "_keyId", {
                get: $util.oneOfGetter($oneOfFields = ["keyId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateSyncKey.prototype, "_keyData", {
                get: $util.oneOfGetter($oneOfFields = ["keyData"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AppStateSyncKey.create = function create(properties) {
                return new AppStateSyncKey(properties);
            };

            AppStateSyncKey.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.keyId != null && Object.hasOwnProperty.call(m, "keyId"))
                    $root.proto.Message.AppStateSyncKeyId.encode(m.keyId, w.uint32(10).fork()).ldelim();
                if (m.keyData != null && Object.hasOwnProperty.call(m, "keyData"))
                    $root.proto.Message.AppStateSyncKeyData.encode(m.keyData, w.uint32(18).fork()).ldelim();
                return w;
            };

            AppStateSyncKey.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AppStateSyncKey();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.keyId = $root.proto.Message.AppStateSyncKeyId.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.keyData = $root.proto.Message.AppStateSyncKeyData.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AppStateSyncKey.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AppStateSyncKey)
                    return d;
                var m = new $root.proto.Message.AppStateSyncKey();
                if (d.keyId != null) {
                    if (typeof d.keyId !== "object")
                        throw TypeError(".proto.Message.AppStateSyncKey.keyId: object expected");
                    m.keyId = $root.proto.Message.AppStateSyncKeyId.fromObject(d.keyId);
                }
                if (d.keyData != null) {
                    if (typeof d.keyData !== "object")
                        throw TypeError(".proto.Message.AppStateSyncKey.keyData: object expected");
                    m.keyData = $root.proto.Message.AppStateSyncKeyData.fromObject(d.keyData);
                }
                return m;
            };

            AppStateSyncKey.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.keyId != null && m.hasOwnProperty("keyId")) {
                    d.keyId = $root.proto.Message.AppStateSyncKeyId.toObject(m.keyId, o);
                    if (o.oneofs)
                        d._keyId = "keyId";
                }
                if (m.keyData != null && m.hasOwnProperty("keyData")) {
                    d.keyData = $root.proto.Message.AppStateSyncKeyData.toObject(m.keyData, o);
                    if (o.oneofs)
                        d._keyData = "keyData";
                }
                return d;
            };

            AppStateSyncKey.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AppStateSyncKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AppStateSyncKey";
            };

            return AppStateSyncKey;
        })();

        Message.AppStateSyncKeyData = (function() {

            function AppStateSyncKeyData(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AppStateSyncKeyData.prototype.keyData = null;
            AppStateSyncKeyData.prototype.fingerprint = null;
            AppStateSyncKeyData.prototype.timestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateSyncKeyData.prototype, "_keyData", {
                get: $util.oneOfGetter($oneOfFields = ["keyData"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateSyncKeyData.prototype, "_fingerprint", {
                get: $util.oneOfGetter($oneOfFields = ["fingerprint"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateSyncKeyData.prototype, "_timestamp", {
                get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AppStateSyncKeyData.create = function create(properties) {
                return new AppStateSyncKeyData(properties);
            };

            AppStateSyncKeyData.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.keyData != null && Object.hasOwnProperty.call(m, "keyData"))
                    w.uint32(10).bytes(m.keyData);
                if (m.fingerprint != null && Object.hasOwnProperty.call(m, "fingerprint"))
                    $root.proto.Message.AppStateSyncKeyFingerprint.encode(m.fingerprint, w.uint32(18).fork()).ldelim();
                if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                    w.uint32(24).int64(m.timestamp);
                return w;
            };

            AppStateSyncKeyData.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AppStateSyncKeyData();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.keyData = r.bytes();
                            break;
                        }
                    case 2: {
                            m.fingerprint = $root.proto.Message.AppStateSyncKeyFingerprint.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.timestamp = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AppStateSyncKeyData.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AppStateSyncKeyData)
                    return d;
                var m = new $root.proto.Message.AppStateSyncKeyData();
                if (d.keyData != null) {
                    if (typeof d.keyData === "string")
                        $util.base64.decode(d.keyData, m.keyData = $util.newBuffer($util.base64.length(d.keyData)), 0);
                    else if (d.keyData.length >= 0)
                        m.keyData = d.keyData;
                }
                if (d.fingerprint != null) {
                    if (typeof d.fingerprint !== "object")
                        throw TypeError(".proto.Message.AppStateSyncKeyData.fingerprint: object expected");
                    m.fingerprint = $root.proto.Message.AppStateSyncKeyFingerprint.fromObject(d.fingerprint);
                }
                if (d.timestamp != null) {
                    if ($util.Long)
                        (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                    else if (typeof d.timestamp === "string")
                        m.timestamp = parseInt(d.timestamp, 10);
                    else if (typeof d.timestamp === "number")
                        m.timestamp = d.timestamp;
                    else if (typeof d.timestamp === "object")
                        m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
                }
                return m;
            };

            AppStateSyncKeyData.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.keyData != null && m.hasOwnProperty("keyData")) {
                    d.keyData = o.bytes === String ? $util.base64.encode(m.keyData, 0, m.keyData.length) : o.bytes === Array ? Array.prototype.slice.call(m.keyData) : m.keyData;
                    if (o.oneofs)
                        d._keyData = "keyData";
                }
                if (m.fingerprint != null && m.hasOwnProperty("fingerprint")) {
                    d.fingerprint = $root.proto.Message.AppStateSyncKeyFingerprint.toObject(m.fingerprint, o);
                    if (o.oneofs)
                        d._fingerprint = "fingerprint";
                }
                if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                    if (typeof m.timestamp === "number")
                        d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                    else
                        d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                    if (o.oneofs)
                        d._timestamp = "timestamp";
                }
                return d;
            };

            AppStateSyncKeyData.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AppStateSyncKeyData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AppStateSyncKeyData";
            };

            return AppStateSyncKeyData;
        })();

        Message.AppStateSyncKeyFingerprint = (function() {

            function AppStateSyncKeyFingerprint(p) {
                this.deviceIndexes = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AppStateSyncKeyFingerprint.prototype.rawId = null;
            AppStateSyncKeyFingerprint.prototype.currentIndex = null;
            AppStateSyncKeyFingerprint.prototype.deviceIndexes = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateSyncKeyFingerprint.prototype, "_rawId", {
                get: $util.oneOfGetter($oneOfFields = ["rawId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateSyncKeyFingerprint.prototype, "_currentIndex", {
                get: $util.oneOfGetter($oneOfFields = ["currentIndex"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AppStateSyncKeyFingerprint.create = function create(properties) {
                return new AppStateSyncKeyFingerprint(properties);
            };

            AppStateSyncKeyFingerprint.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.rawId != null && Object.hasOwnProperty.call(m, "rawId"))
                    w.uint32(8).uint32(m.rawId);
                if (m.currentIndex != null && Object.hasOwnProperty.call(m, "currentIndex"))
                    w.uint32(16).uint32(m.currentIndex);
                if (m.deviceIndexes != null && m.deviceIndexes.length) {
                    w.uint32(26).fork();
                    for (var i = 0; i < m.deviceIndexes.length; ++i)
                        w.uint32(m.deviceIndexes[i]);
                    w.ldelim();
                }
                return w;
            };

            AppStateSyncKeyFingerprint.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AppStateSyncKeyFingerprint();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.rawId = r.uint32();
                            break;
                        }
                    case 2: {
                            m.currentIndex = r.uint32();
                            break;
                        }
                    case 3: {
                            if (!(m.deviceIndexes && m.deviceIndexes.length))
                                m.deviceIndexes = [];
                            if ((t & 7) === 2) {
                                var c2 = r.uint32() + r.pos;
                                while (r.pos < c2)
                                    m.deviceIndexes.push(r.uint32());
                            } else
                                m.deviceIndexes.push(r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AppStateSyncKeyFingerprint.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AppStateSyncKeyFingerprint)
                    return d;
                var m = new $root.proto.Message.AppStateSyncKeyFingerprint();
                if (d.rawId != null) {
                    m.rawId = d.rawId >>> 0;
                }
                if (d.currentIndex != null) {
                    m.currentIndex = d.currentIndex >>> 0;
                }
                if (d.deviceIndexes) {
                    if (!Array.isArray(d.deviceIndexes))
                        throw TypeError(".proto.Message.AppStateSyncKeyFingerprint.deviceIndexes: array expected");
                    m.deviceIndexes = [];
                    for (var i = 0; i < d.deviceIndexes.length; ++i) {
                        m.deviceIndexes[i] = d.deviceIndexes[i] >>> 0;
                    }
                }
                return m;
            };

            AppStateSyncKeyFingerprint.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.deviceIndexes = [];
                }
                if (m.rawId != null && m.hasOwnProperty("rawId")) {
                    d.rawId = m.rawId;
                    if (o.oneofs)
                        d._rawId = "rawId";
                }
                if (m.currentIndex != null && m.hasOwnProperty("currentIndex")) {
                    d.currentIndex = m.currentIndex;
                    if (o.oneofs)
                        d._currentIndex = "currentIndex";
                }
                if (m.deviceIndexes && m.deviceIndexes.length) {
                    d.deviceIndexes = [];
                    for (var j = 0; j < m.deviceIndexes.length; ++j) {
                        d.deviceIndexes[j] = m.deviceIndexes[j];
                    }
                }
                return d;
            };

            AppStateSyncKeyFingerprint.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AppStateSyncKeyFingerprint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AppStateSyncKeyFingerprint";
            };

            return AppStateSyncKeyFingerprint;
        })();

        Message.AppStateSyncKeyId = (function() {

            function AppStateSyncKeyId(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AppStateSyncKeyId.prototype.keyId = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AppStateSyncKeyId.prototype, "_keyId", {
                get: $util.oneOfGetter($oneOfFields = ["keyId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AppStateSyncKeyId.create = function create(properties) {
                return new AppStateSyncKeyId(properties);
            };

            AppStateSyncKeyId.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.keyId != null && Object.hasOwnProperty.call(m, "keyId"))
                    w.uint32(10).bytes(m.keyId);
                return w;
            };

            AppStateSyncKeyId.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AppStateSyncKeyId();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.keyId = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AppStateSyncKeyId.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AppStateSyncKeyId)
                    return d;
                var m = new $root.proto.Message.AppStateSyncKeyId();
                if (d.keyId != null) {
                    if (typeof d.keyId === "string")
                        $util.base64.decode(d.keyId, m.keyId = $util.newBuffer($util.base64.length(d.keyId)), 0);
                    else if (d.keyId.length >= 0)
                        m.keyId = d.keyId;
                }
                return m;
            };

            AppStateSyncKeyId.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.keyId != null && m.hasOwnProperty("keyId")) {
                    d.keyId = o.bytes === String ? $util.base64.encode(m.keyId, 0, m.keyId.length) : o.bytes === Array ? Array.prototype.slice.call(m.keyId) : m.keyId;
                    if (o.oneofs)
                        d._keyId = "keyId";
                }
                return d;
            };

            AppStateSyncKeyId.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AppStateSyncKeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AppStateSyncKeyId";
            };

            return AppStateSyncKeyId;
        })();

        Message.AppStateSyncKeyRequest = (function() {

            function AppStateSyncKeyRequest(p) {
                this.keyIds = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AppStateSyncKeyRequest.prototype.keyIds = $util.emptyArray;

            AppStateSyncKeyRequest.create = function create(properties) {
                return new AppStateSyncKeyRequest(properties);
            };

            AppStateSyncKeyRequest.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.keyIds != null && m.keyIds.length) {
                    for (var i = 0; i < m.keyIds.length; ++i)
                        $root.proto.Message.AppStateSyncKeyId.encode(m.keyIds[i], w.uint32(10).fork()).ldelim();
                }
                return w;
            };

            AppStateSyncKeyRequest.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AppStateSyncKeyRequest();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.keyIds && m.keyIds.length))
                                m.keyIds = [];
                            m.keyIds.push($root.proto.Message.AppStateSyncKeyId.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AppStateSyncKeyRequest.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AppStateSyncKeyRequest)
                    return d;
                var m = new $root.proto.Message.AppStateSyncKeyRequest();
                if (d.keyIds) {
                    if (!Array.isArray(d.keyIds))
                        throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: array expected");
                    m.keyIds = [];
                    for (var i = 0; i < d.keyIds.length; ++i) {
                        if (typeof d.keyIds[i] !== "object")
                            throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: object expected");
                        m.keyIds[i] = $root.proto.Message.AppStateSyncKeyId.fromObject(d.keyIds[i]);
                    }
                }
                return m;
            };

            AppStateSyncKeyRequest.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.keyIds = [];
                }
                if (m.keyIds && m.keyIds.length) {
                    d.keyIds = [];
                    for (var j = 0; j < m.keyIds.length; ++j) {
                        d.keyIds[j] = $root.proto.Message.AppStateSyncKeyId.toObject(m.keyIds[j], o);
                    }
                }
                return d;
            };

            AppStateSyncKeyRequest.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AppStateSyncKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AppStateSyncKeyRequest";
            };

            return AppStateSyncKeyRequest;
        })();

        Message.AppStateSyncKeyShare = (function() {

            function AppStateSyncKeyShare(p) {
                this.keys = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AppStateSyncKeyShare.prototype.keys = $util.emptyArray;

            AppStateSyncKeyShare.create = function create(properties) {
                return new AppStateSyncKeyShare(properties);
            };

            AppStateSyncKeyShare.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.keys != null && m.keys.length) {
                    for (var i = 0; i < m.keys.length; ++i)
                        $root.proto.Message.AppStateSyncKey.encode(m.keys[i], w.uint32(10).fork()).ldelim();
                }
                return w;
            };

            AppStateSyncKeyShare.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AppStateSyncKeyShare();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.keys && m.keys.length))
                                m.keys = [];
                            m.keys.push($root.proto.Message.AppStateSyncKey.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AppStateSyncKeyShare.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AppStateSyncKeyShare)
                    return d;
                var m = new $root.proto.Message.AppStateSyncKeyShare();
                if (d.keys) {
                    if (!Array.isArray(d.keys))
                        throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: array expected");
                    m.keys = [];
                    for (var i = 0; i < d.keys.length; ++i) {
                        if (typeof d.keys[i] !== "object")
                            throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: object expected");
                        m.keys[i] = $root.proto.Message.AppStateSyncKey.fromObject(d.keys[i]);
                    }
                }
                return m;
            };

            AppStateSyncKeyShare.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.keys = [];
                }
                if (m.keys && m.keys.length) {
                    d.keys = [];
                    for (var j = 0; j < m.keys.length; ++j) {
                        d.keys[j] = $root.proto.Message.AppStateSyncKey.toObject(m.keys[j], o);
                    }
                }
                return d;
            };

            AppStateSyncKeyShare.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AppStateSyncKeyShare.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AppStateSyncKeyShare";
            };

            return AppStateSyncKeyShare;
        })();

        Message.AudioMessage = (function() {

            function AudioMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AudioMessage.prototype.url = null;
            AudioMessage.prototype.mimetype = null;
            AudioMessage.prototype.fileSha256 = null;
            AudioMessage.prototype.fileLength = null;
            AudioMessage.prototype.seconds = null;
            AudioMessage.prototype.ptt = null;
            AudioMessage.prototype.mediaKey = null;
            AudioMessage.prototype.fileEncSha256 = null;
            AudioMessage.prototype.directPath = null;
            AudioMessage.prototype.mediaKeyTimestamp = null;
            AudioMessage.prototype.contextInfo = null;
            AudioMessage.prototype.streamingSidecar = null;
            AudioMessage.prototype.waveform = null;
            AudioMessage.prototype.backgroundArgb = null;
            AudioMessage.prototype.viewOnce = null;
            AudioMessage.prototype.accessibilityLabel = null;
            AudioMessage.prototype.mediaKeyDomain = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_mimetype", {
                get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_fileLength", {
                get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_seconds", {
                get: $util.oneOfGetter($oneOfFields = ["seconds"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_ptt", {
                get: $util.oneOfGetter($oneOfFields = ["ptt"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_streamingSidecar", {
                get: $util.oneOfGetter($oneOfFields = ["streamingSidecar"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_waveform", {
                get: $util.oneOfGetter($oneOfFields = ["waveform"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_backgroundArgb", {
                get: $util.oneOfGetter($oneOfFields = ["backgroundArgb"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_viewOnce", {
                get: $util.oneOfGetter($oneOfFields = ["viewOnce"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_accessibilityLabel", {
                get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AudioMessage.prototype, "_mediaKeyDomain", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyDomain"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AudioMessage.create = function create(properties) {
                return new AudioMessage(properties);
            };

            AudioMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(10).string(m.url);
                if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                    w.uint32(18).string(m.mimetype);
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(26).bytes(m.fileSha256);
                if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                    w.uint32(32).uint64(m.fileLength);
                if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds"))
                    w.uint32(40).uint32(m.seconds);
                if (m.ptt != null && Object.hasOwnProperty.call(m, "ptt"))
                    w.uint32(48).bool(m.ptt);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(58).bytes(m.mediaKey);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(66).bytes(m.fileEncSha256);
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(74).string(m.directPath);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(80).int64(m.mediaKeyTimestamp);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                if (m.streamingSidecar != null && Object.hasOwnProperty.call(m, "streamingSidecar"))
                    w.uint32(146).bytes(m.streamingSidecar);
                if (m.waveform != null && Object.hasOwnProperty.call(m, "waveform"))
                    w.uint32(154).bytes(m.waveform);
                if (m.backgroundArgb != null && Object.hasOwnProperty.call(m, "backgroundArgb"))
                    w.uint32(165).fixed32(m.backgroundArgb);
                if (m.viewOnce != null && Object.hasOwnProperty.call(m, "viewOnce"))
                    w.uint32(168).bool(m.viewOnce);
                if (m.accessibilityLabel != null && Object.hasOwnProperty.call(m, "accessibilityLabel"))
                    w.uint32(178).string(m.accessibilityLabel);
                if (m.mediaKeyDomain != null && Object.hasOwnProperty.call(m, "mediaKeyDomain"))
                    w.uint32(184).int32(m.mediaKeyDomain);
                return w;
            };

            AudioMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.AudioMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.url = r.string();
                            break;
                        }
                    case 2: {
                            m.mimetype = r.string();
                            break;
                        }
                    case 3: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 4: {
                            m.fileLength = r.uint64();
                            break;
                        }
                    case 5: {
                            m.seconds = r.uint32();
                            break;
                        }
                    case 6: {
                            m.ptt = r.bool();
                            break;
                        }
                    case 7: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 8: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 9: {
                            m.directPath = r.string();
                            break;
                        }
                    case 10: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 18: {
                            m.streamingSidecar = r.bytes();
                            break;
                        }
                    case 19: {
                            m.waveform = r.bytes();
                            break;
                        }
                    case 20: {
                            m.backgroundArgb = r.fixed32();
                            break;
                        }
                    case 21: {
                            m.viewOnce = r.bool();
                            break;
                        }
                    case 22: {
                            m.accessibilityLabel = r.string();
                            break;
                        }
                    case 23: {
                            m.mediaKeyDomain = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AudioMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.AudioMessage)
                    return d;
                var m = new $root.proto.Message.AudioMessage();
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.mimetype != null) {
                    m.mimetype = String(d.mimetype);
                }
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.fileLength != null) {
                    if ($util.Long)
                        (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                    else if (typeof d.fileLength === "string")
                        m.fileLength = parseInt(d.fileLength, 10);
                    else if (typeof d.fileLength === "number")
                        m.fileLength = d.fileLength;
                    else if (typeof d.fileLength === "object")
                        m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
                }
                if (d.seconds != null) {
                    m.seconds = d.seconds >>> 0;
                }
                if (d.ptt != null) {
                    m.ptt = Boolean(d.ptt);
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.AudioMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.streamingSidecar != null) {
                    if (typeof d.streamingSidecar === "string")
                        $util.base64.decode(d.streamingSidecar, m.streamingSidecar = $util.newBuffer($util.base64.length(d.streamingSidecar)), 0);
                    else if (d.streamingSidecar.length >= 0)
                        m.streamingSidecar = d.streamingSidecar;
                }
                if (d.waveform != null) {
                    if (typeof d.waveform === "string")
                        $util.base64.decode(d.waveform, m.waveform = $util.newBuffer($util.base64.length(d.waveform)), 0);
                    else if (d.waveform.length >= 0)
                        m.waveform = d.waveform;
                }
                if (d.backgroundArgb != null) {
                    m.backgroundArgb = d.backgroundArgb >>> 0;
                }
                if (d.viewOnce != null) {
                    m.viewOnce = Boolean(d.viewOnce);
                }
                if (d.accessibilityLabel != null) {
                    m.accessibilityLabel = String(d.accessibilityLabel);
                }
                switch (d.mediaKeyDomain) {
                default:
                    if (typeof d.mediaKeyDomain === "number") {
                        m.mediaKeyDomain = d.mediaKeyDomain;
                        break;
                    }
                    break;
                case "UNSET":
                case 0:
                    m.mediaKeyDomain = 0;
                    break;
                case "E2EE_CHAT":
                case 1:
                    m.mediaKeyDomain = 1;
                    break;
                case "STATUS":
                case 2:
                    m.mediaKeyDomain = 2;
                    break;
                case "CAPI":
                case 3:
                    m.mediaKeyDomain = 3;
                    break;
                case "BOT":
                case 4:
                    m.mediaKeyDomain = 4;
                    break;
                }
                return m;
            };

            AudioMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                    d.mimetype = m.mimetype;
                    if (o.oneofs)
                        d._mimetype = "mimetype";
                }
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                    if (typeof m.fileLength === "number")
                        d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                    else
                        d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                    if (o.oneofs)
                        d._fileLength = "fileLength";
                }
                if (m.seconds != null && m.hasOwnProperty("seconds")) {
                    d.seconds = m.seconds;
                    if (o.oneofs)
                        d._seconds = "seconds";
                }
                if (m.ptt != null && m.hasOwnProperty("ptt")) {
                    d.ptt = m.ptt;
                    if (o.oneofs)
                        d._ptt = "ptt";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.streamingSidecar != null && m.hasOwnProperty("streamingSidecar")) {
                    d.streamingSidecar = o.bytes === String ? $util.base64.encode(m.streamingSidecar, 0, m.streamingSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.streamingSidecar) : m.streamingSidecar;
                    if (o.oneofs)
                        d._streamingSidecar = "streamingSidecar";
                }
                if (m.waveform != null && m.hasOwnProperty("waveform")) {
                    d.waveform = o.bytes === String ? $util.base64.encode(m.waveform, 0, m.waveform.length) : o.bytes === Array ? Array.prototype.slice.call(m.waveform) : m.waveform;
                    if (o.oneofs)
                        d._waveform = "waveform";
                }
                if (m.backgroundArgb != null && m.hasOwnProperty("backgroundArgb")) {
                    d.backgroundArgb = m.backgroundArgb;
                    if (o.oneofs)
                        d._backgroundArgb = "backgroundArgb";
                }
                if (m.viewOnce != null && m.hasOwnProperty("viewOnce")) {
                    d.viewOnce = m.viewOnce;
                    if (o.oneofs)
                        d._viewOnce = "viewOnce";
                }
                if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) {
                    d.accessibilityLabel = m.accessibilityLabel;
                    if (o.oneofs)
                        d._accessibilityLabel = "accessibilityLabel";
                }
                if (m.mediaKeyDomain != null && m.hasOwnProperty("mediaKeyDomain")) {
                    d.mediaKeyDomain = o.enums === String ? $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] === undefined ? m.mediaKeyDomain : $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] : m.mediaKeyDomain;
                    if (o.oneofs)
                        d._mediaKeyDomain = "mediaKeyDomain";
                }
                return d;
            };

            AudioMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AudioMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.AudioMessage";
            };

            return AudioMessage;
        })();

        Message.BCallMessage = (function() {

            function BCallMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BCallMessage.prototype.sessionId = null;
            BCallMessage.prototype.mediaType = null;
            BCallMessage.prototype.masterKey = null;
            BCallMessage.prototype.caption = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BCallMessage.prototype, "_sessionId", {
                get: $util.oneOfGetter($oneOfFields = ["sessionId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BCallMessage.prototype, "_mediaType", {
                get: $util.oneOfGetter($oneOfFields = ["mediaType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BCallMessage.prototype, "_masterKey", {
                get: $util.oneOfGetter($oneOfFields = ["masterKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BCallMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BCallMessage.create = function create(properties) {
                return new BCallMessage(properties);
            };

            BCallMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.sessionId != null && Object.hasOwnProperty.call(m, "sessionId"))
                    w.uint32(10).string(m.sessionId);
                if (m.mediaType != null && Object.hasOwnProperty.call(m, "mediaType"))
                    w.uint32(16).int32(m.mediaType);
                if (m.masterKey != null && Object.hasOwnProperty.call(m, "masterKey"))
                    w.uint32(26).bytes(m.masterKey);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(34).string(m.caption);
                return w;
            };

            BCallMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.BCallMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.sessionId = r.string();
                            break;
                        }
                    case 2: {
                            m.mediaType = r.int32();
                            break;
                        }
                    case 3: {
                            m.masterKey = r.bytes();
                            break;
                        }
                    case 4: {
                            m.caption = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BCallMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.BCallMessage)
                    return d;
                var m = new $root.proto.Message.BCallMessage();
                if (d.sessionId != null) {
                    m.sessionId = String(d.sessionId);
                }
                switch (d.mediaType) {
                default:
                    if (typeof d.mediaType === "number") {
                        m.mediaType = d.mediaType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.mediaType = 0;
                    break;
                case "AUDIO":
                case 1:
                    m.mediaType = 1;
                    break;
                case "VIDEO":
                case 2:
                    m.mediaType = 2;
                    break;
                }
                if (d.masterKey != null) {
                    if (typeof d.masterKey === "string")
                        $util.base64.decode(d.masterKey, m.masterKey = $util.newBuffer($util.base64.length(d.masterKey)), 0);
                    else if (d.masterKey.length >= 0)
                        m.masterKey = d.masterKey;
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                return m;
            };

            BCallMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.sessionId != null && m.hasOwnProperty("sessionId")) {
                    d.sessionId = m.sessionId;
                    if (o.oneofs)
                        d._sessionId = "sessionId";
                }
                if (m.mediaType != null && m.hasOwnProperty("mediaType")) {
                    d.mediaType = o.enums === String ? $root.proto.Message.BCallMessage.MediaType[m.mediaType] === undefined ? m.mediaType : $root.proto.Message.BCallMessage.MediaType[m.mediaType] : m.mediaType;
                    if (o.oneofs)
                        d._mediaType = "mediaType";
                }
                if (m.masterKey != null && m.hasOwnProperty("masterKey")) {
                    d.masterKey = o.bytes === String ? $util.base64.encode(m.masterKey, 0, m.masterKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.masterKey) : m.masterKey;
                    if (o.oneofs)
                        d._masterKey = "masterKey";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                return d;
            };

            BCallMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BCallMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.BCallMessage";
            };

            BCallMessage.MediaType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "AUDIO"] = 1;
                values[valuesById[2] = "VIDEO"] = 2;
                return values;
            })();

            return BCallMessage;
        })();

        Message.ButtonsMessage = (function() {

            function ButtonsMessage(p) {
                this.buttons = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ButtonsMessage.prototype.contentText = null;
            ButtonsMessage.prototype.footerText = null;
            ButtonsMessage.prototype.contextInfo = null;
            ButtonsMessage.prototype.buttons = $util.emptyArray;
            ButtonsMessage.prototype.headerType = null;
            ButtonsMessage.prototype.text = null;
            ButtonsMessage.prototype.documentMessage = null;
            ButtonsMessage.prototype.imageMessage = null;
            ButtonsMessage.prototype.videoMessage = null;
            ButtonsMessage.prototype.locationMessage = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ButtonsMessage.prototype, "_contentText", {
                get: $util.oneOfGetter($oneOfFields = ["contentText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ButtonsMessage.prototype, "_footerText", {
                get: $util.oneOfGetter($oneOfFields = ["footerText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ButtonsMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ButtonsMessage.prototype, "_headerType", {
                get: $util.oneOfGetter($oneOfFields = ["headerType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Object.defineProperty(ButtonsMessage.prototype, "header", {
                get: $util.oneOfGetter($oneOfFields = ["text", "documentMessage", "imageMessage", "videoMessage", "locationMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ButtonsMessage.create = function create(properties) {
                return new ButtonsMessage(properties);
            };

            ButtonsMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                    w.uint32(10).string(m.text);
                if (m.documentMessage != null && Object.hasOwnProperty.call(m, "documentMessage"))
                    $root.proto.Message.DocumentMessage.encode(m.documentMessage, w.uint32(18).fork()).ldelim();
                if (m.imageMessage != null && Object.hasOwnProperty.call(m, "imageMessage"))
                    $root.proto.Message.ImageMessage.encode(m.imageMessage, w.uint32(26).fork()).ldelim();
                if (m.videoMessage != null && Object.hasOwnProperty.call(m, "videoMessage"))
                    $root.proto.Message.VideoMessage.encode(m.videoMessage, w.uint32(34).fork()).ldelim();
                if (m.locationMessage != null && Object.hasOwnProperty.call(m, "locationMessage"))
                    $root.proto.Message.LocationMessage.encode(m.locationMessage, w.uint32(42).fork()).ldelim();
                if (m.contentText != null && Object.hasOwnProperty.call(m, "contentText"))
                    w.uint32(50).string(m.contentText);
                if (m.footerText != null && Object.hasOwnProperty.call(m, "footerText"))
                    w.uint32(58).string(m.footerText);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(66).fork()).ldelim();
                if (m.buttons != null && m.buttons.length) {
                    for (var i = 0; i < m.buttons.length; ++i)
                        $root.proto.Message.ButtonsMessage.Button.encode(m.buttons[i], w.uint32(74).fork()).ldelim();
                }
                if (m.headerType != null && Object.hasOwnProperty.call(m, "headerType"))
                    w.uint32(80).int32(m.headerType);
                return w;
            };

            ButtonsMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ButtonsMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 6: {
                            m.contentText = r.string();
                            break;
                        }
                    case 7: {
                            m.footerText = r.string();
                            break;
                        }
                    case 8: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 9: {
                            if (!(m.buttons && m.buttons.length))
                                m.buttons = [];
                            m.buttons.push($root.proto.Message.ButtonsMessage.Button.decode(r, r.uint32()));
                            break;
                        }
                    case 10: {
                            m.headerType = r.int32();
                            break;
                        }
                    case 1: {
                            m.text = r.string();
                            break;
                        }
                    case 2: {
                            m.documentMessage = $root.proto.Message.DocumentMessage.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.imageMessage = $root.proto.Message.ImageMessage.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.videoMessage = $root.proto.Message.VideoMessage.decode(r, r.uint32());
                            break;
                        }
                    case 5: {
                            m.locationMessage = $root.proto.Message.LocationMessage.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ButtonsMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ButtonsMessage)
                    return d;
                var m = new $root.proto.Message.ButtonsMessage();
                if (d.contentText != null) {
                    m.contentText = String(d.contentText);
                }
                if (d.footerText != null) {
                    m.footerText = String(d.footerText);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ButtonsMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.buttons) {
                    if (!Array.isArray(d.buttons))
                        throw TypeError(".proto.Message.ButtonsMessage.buttons: array expected");
                    m.buttons = [];
                    for (var i = 0; i < d.buttons.length; ++i) {
                        if (typeof d.buttons[i] !== "object")
                            throw TypeError(".proto.Message.ButtonsMessage.buttons: object expected");
                        m.buttons[i] = $root.proto.Message.ButtonsMessage.Button.fromObject(d.buttons[i]);
                    }
                }
                switch (d.headerType) {
                default:
                    if (typeof d.headerType === "number") {
                        m.headerType = d.headerType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.headerType = 0;
                    break;
                case "EMPTY":
                case 1:
                    m.headerType = 1;
                    break;
                case "TEXT":
                case 2:
                    m.headerType = 2;
                    break;
                case "DOCUMENT":
                case 3:
                    m.headerType = 3;
                    break;
                case "IMAGE":
                case 4:
                    m.headerType = 4;
                    break;
                case "VIDEO":
                case 5:
                    m.headerType = 5;
                    break;
                case "LOCATION":
                case 6:
                    m.headerType = 6;
                    break;
                }
                if (d.text != null) {
                    m.text = String(d.text);
                }
                if (d.documentMessage != null) {
                    if (typeof d.documentMessage !== "object")
                        throw TypeError(".proto.Message.ButtonsMessage.documentMessage: object expected");
                    m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage);
                }
                if (d.imageMessage != null) {
                    if (typeof d.imageMessage !== "object")
                        throw TypeError(".proto.Message.ButtonsMessage.imageMessage: object expected");
                    m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage);
                }
                if (d.videoMessage != null) {
                    if (typeof d.videoMessage !== "object")
                        throw TypeError(".proto.Message.ButtonsMessage.videoMessage: object expected");
                    m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage);
                }
                if (d.locationMessage != null) {
                    if (typeof d.locationMessage !== "object")
                        throw TypeError(".proto.Message.ButtonsMessage.locationMessage: object expected");
                    m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage);
                }
                return m;
            };

            ButtonsMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.buttons = [];
                }
                if (m.text != null && m.hasOwnProperty("text")) {
                    d.text = m.text;
                    if (o.oneofs)
                        d.header = "text";
                }
                if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) {
                    d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o);
                    if (o.oneofs)
                        d.header = "documentMessage";
                }
                if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) {
                    d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o);
                    if (o.oneofs)
                        d.header = "imageMessage";
                }
                if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) {
                    d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o);
                    if (o.oneofs)
                        d.header = "videoMessage";
                }
                if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) {
                    d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o);
                    if (o.oneofs)
                        d.header = "locationMessage";
                }
                if (m.contentText != null && m.hasOwnProperty("contentText")) {
                    d.contentText = m.contentText;
                    if (o.oneofs)
                        d._contentText = "contentText";
                }
                if (m.footerText != null && m.hasOwnProperty("footerText")) {
                    d.footerText = m.footerText;
                    if (o.oneofs)
                        d._footerText = "footerText";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.buttons && m.buttons.length) {
                    d.buttons = [];
                    for (var j = 0; j < m.buttons.length; ++j) {
                        d.buttons[j] = $root.proto.Message.ButtonsMessage.Button.toObject(m.buttons[j], o);
                    }
                }
                if (m.headerType != null && m.hasOwnProperty("headerType")) {
                    d.headerType = o.enums === String ? $root.proto.Message.ButtonsMessage.HeaderType[m.headerType] === undefined ? m.headerType : $root.proto.Message.ButtonsMessage.HeaderType[m.headerType] : m.headerType;
                    if (o.oneofs)
                        d._headerType = "headerType";
                }
                return d;
            };

            ButtonsMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ButtonsMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ButtonsMessage";
            };

            ButtonsMessage.Button = (function() {

                function Button(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Button.prototype.buttonId = null;
                Button.prototype.buttonText = null;
                Button.prototype.type = null;
                Button.prototype.nativeFlowInfo = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Button.prototype, "_buttonId", {
                    get: $util.oneOfGetter($oneOfFields = ["buttonId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Button.prototype, "_buttonText", {
                    get: $util.oneOfGetter($oneOfFields = ["buttonText"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Button.prototype, "_type", {
                    get: $util.oneOfGetter($oneOfFields = ["type"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Button.prototype, "_nativeFlowInfo", {
                    get: $util.oneOfGetter($oneOfFields = ["nativeFlowInfo"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Button.create = function create(properties) {
                    return new Button(properties);
                };

                Button.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.buttonId != null && Object.hasOwnProperty.call(m, "buttonId"))
                        w.uint32(10).string(m.buttonId);
                    if (m.buttonText != null && Object.hasOwnProperty.call(m, "buttonText"))
                        $root.proto.Message.ButtonsMessage.Button.ButtonText.encode(m.buttonText, w.uint32(18).fork()).ldelim();
                    if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                        w.uint32(24).int32(m.type);
                    if (m.nativeFlowInfo != null && Object.hasOwnProperty.call(m, "nativeFlowInfo"))
                        $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo.encode(m.nativeFlowInfo, w.uint32(34).fork()).ldelim();
                    return w;
                };

                Button.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ButtonsMessage.Button();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.buttonId = r.string();
                                break;
                            }
                        case 2: {
                                m.buttonText = $root.proto.Message.ButtonsMessage.Button.ButtonText.decode(r, r.uint32());
                                break;
                            }
                        case 3: {
                                m.type = r.int32();
                                break;
                            }
                        case 4: {
                                m.nativeFlowInfo = $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Button.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ButtonsMessage.Button)
                        return d;
                    var m = new $root.proto.Message.ButtonsMessage.Button();
                    if (d.buttonId != null) {
                        m.buttonId = String(d.buttonId);
                    }
                    if (d.buttonText != null) {
                        if (typeof d.buttonText !== "object")
                            throw TypeError(".proto.Message.ButtonsMessage.Button.buttonText: object expected");
                        m.buttonText = $root.proto.Message.ButtonsMessage.Button.ButtonText.fromObject(d.buttonText);
                    }
                    switch (d.type) {
                    default:
                        if (typeof d.type === "number") {
                            m.type = d.type;
                            break;
                        }
                        break;
                    case "UNKNOWN":
                    case 0:
                        m.type = 0;
                        break;
                    case "RESPONSE":
                    case 1:
                        m.type = 1;
                        break;
                    case "NATIVE_FLOW":
                    case 2:
                        m.type = 2;
                        break;
                    }
                    if (d.nativeFlowInfo != null) {
                        if (typeof d.nativeFlowInfo !== "object")
                            throw TypeError(".proto.Message.ButtonsMessage.Button.nativeFlowInfo: object expected");
                        m.nativeFlowInfo = $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo.fromObject(d.nativeFlowInfo);
                    }
                    return m;
                };

                Button.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.buttonId != null && m.hasOwnProperty("buttonId")) {
                        d.buttonId = m.buttonId;
                        if (o.oneofs)
                            d._buttonId = "buttonId";
                    }
                    if (m.buttonText != null && m.hasOwnProperty("buttonText")) {
                        d.buttonText = $root.proto.Message.ButtonsMessage.Button.ButtonText.toObject(m.buttonText, o);
                        if (o.oneofs)
                            d._buttonText = "buttonText";
                    }
                    if (m.type != null && m.hasOwnProperty("type")) {
                        d.type = o.enums === String ? $root.proto.Message.ButtonsMessage.Button.Type[m.type] === undefined ? m.type : $root.proto.Message.ButtonsMessage.Button.Type[m.type] : m.type;
                        if (o.oneofs)
                            d._type = "type";
                    }
                    if (m.nativeFlowInfo != null && m.hasOwnProperty("nativeFlowInfo")) {
                        d.nativeFlowInfo = $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo.toObject(m.nativeFlowInfo, o);
                        if (o.oneofs)
                            d._nativeFlowInfo = "nativeFlowInfo";
                    }
                    return d;
                };

                Button.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Button.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ButtonsMessage.Button";
                };

                Button.ButtonText = (function() {

                    function ButtonText(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    ButtonText.prototype.displayText = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(ButtonText.prototype, "_displayText", {
                        get: $util.oneOfGetter($oneOfFields = ["displayText"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    ButtonText.create = function create(properties) {
                        return new ButtonText(properties);
                    };

                    ButtonText.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.displayText != null && Object.hasOwnProperty.call(m, "displayText"))
                            w.uint32(10).string(m.displayText);
                        return w;
                    };

                    ButtonText.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ButtonsMessage.Button.ButtonText();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.displayText = r.string();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    ButtonText.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.ButtonsMessage.Button.ButtonText)
                            return d;
                        var m = new $root.proto.Message.ButtonsMessage.Button.ButtonText();
                        if (d.displayText != null) {
                            m.displayText = String(d.displayText);
                        }
                        return m;
                    };

                    ButtonText.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.displayText != null && m.hasOwnProperty("displayText")) {
                            d.displayText = m.displayText;
                            if (o.oneofs)
                                d._displayText = "displayText";
                        }
                        return d;
                    };

                    ButtonText.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    ButtonText.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.ButtonsMessage.Button.ButtonText";
                    };

                    return ButtonText;
                })();

                Button.NativeFlowInfo = (function() {

                    function NativeFlowInfo(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    NativeFlowInfo.prototype.name = null;
                    NativeFlowInfo.prototype.paramsJson = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(NativeFlowInfo.prototype, "_name", {
                        get: $util.oneOfGetter($oneOfFields = ["name"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(NativeFlowInfo.prototype, "_paramsJson", {
                        get: $util.oneOfGetter($oneOfFields = ["paramsJson"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    NativeFlowInfo.create = function create(properties) {
                        return new NativeFlowInfo(properties);
                    };

                    NativeFlowInfo.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                            w.uint32(10).string(m.name);
                        if (m.paramsJson != null && Object.hasOwnProperty.call(m, "paramsJson"))
                            w.uint32(18).string(m.paramsJson);
                        return w;
                    };

                    NativeFlowInfo.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.name = r.string();
                                    break;
                                }
                            case 2: {
                                    m.paramsJson = r.string();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    NativeFlowInfo.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo)
                            return d;
                        var m = new $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo();
                        if (d.name != null) {
                            m.name = String(d.name);
                        }
                        if (d.paramsJson != null) {
                            m.paramsJson = String(d.paramsJson);
                        }
                        return m;
                    };

                    NativeFlowInfo.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.name != null && m.hasOwnProperty("name")) {
                            d.name = m.name;
                            if (o.oneofs)
                                d._name = "name";
                        }
                        if (m.paramsJson != null && m.hasOwnProperty("paramsJson")) {
                            d.paramsJson = m.paramsJson;
                            if (o.oneofs)
                                d._paramsJson = "paramsJson";
                        }
                        return d;
                    };

                    NativeFlowInfo.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    NativeFlowInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.ButtonsMessage.Button.NativeFlowInfo";
                    };

                    return NativeFlowInfo;
                })();

                Button.Type = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "UNKNOWN"] = 0;
                    values[valuesById[1] = "RESPONSE"] = 1;
                    values[valuesById[2] = "NATIVE_FLOW"] = 2;
                    return values;
                })();

                return Button;
            })();

            ButtonsMessage.HeaderType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "EMPTY"] = 1;
                values[valuesById[2] = "TEXT"] = 2;
                values[valuesById[3] = "DOCUMENT"] = 3;
                values[valuesById[4] = "IMAGE"] = 4;
                values[valuesById[5] = "VIDEO"] = 5;
                values[valuesById[6] = "LOCATION"] = 6;
                return values;
            })();

            return ButtonsMessage;
        })();

        Message.ButtonsResponseMessage = (function() {

            function ButtonsResponseMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ButtonsResponseMessage.prototype.selectedButtonId = null;
            ButtonsResponseMessage.prototype.contextInfo = null;
            ButtonsResponseMessage.prototype.type = null;
            ButtonsResponseMessage.prototype.selectedDisplayText = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ButtonsResponseMessage.prototype, "_selectedButtonId", {
                get: $util.oneOfGetter($oneOfFields = ["selectedButtonId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ButtonsResponseMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ButtonsResponseMessage.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Object.defineProperty(ButtonsResponseMessage.prototype, "response", {
                get: $util.oneOfGetter($oneOfFields = ["selectedDisplayText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ButtonsResponseMessage.create = function create(properties) {
                return new ButtonsResponseMessage(properties);
            };

            ButtonsResponseMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.selectedButtonId != null && Object.hasOwnProperty.call(m, "selectedButtonId"))
                    w.uint32(10).string(m.selectedButtonId);
                if (m.selectedDisplayText != null && Object.hasOwnProperty.call(m, "selectedDisplayText"))
                    w.uint32(18).string(m.selectedDisplayText);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(26).fork()).ldelim();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(32).int32(m.type);
                return w;
            };

            ButtonsResponseMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ButtonsResponseMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.selectedButtonId = r.string();
                            break;
                        }
                    case 3: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.type = r.int32();
                            break;
                        }
                    case 2: {
                            m.selectedDisplayText = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ButtonsResponseMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ButtonsResponseMessage)
                    return d;
                var m = new $root.proto.Message.ButtonsResponseMessage();
                if (d.selectedButtonId != null) {
                    m.selectedButtonId = String(d.selectedButtonId);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ButtonsResponseMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.type = 0;
                    break;
                case "DISPLAY_TEXT":
                case 1:
                    m.type = 1;
                    break;
                }
                if (d.selectedDisplayText != null) {
                    m.selectedDisplayText = String(d.selectedDisplayText);
                }
                return m;
            };

            ButtonsResponseMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.selectedButtonId != null && m.hasOwnProperty("selectedButtonId")) {
                    d.selectedButtonId = m.selectedButtonId;
                    if (o.oneofs)
                        d._selectedButtonId = "selectedButtonId";
                }
                if (m.selectedDisplayText != null && m.hasOwnProperty("selectedDisplayText")) {
                    d.selectedDisplayText = m.selectedDisplayText;
                    if (o.oneofs)
                        d.response = "selectedDisplayText";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.Message.ButtonsResponseMessage.Type[m.type] === undefined ? m.type : $root.proto.Message.ButtonsResponseMessage.Type[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                return d;
            };

            ButtonsResponseMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ButtonsResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ButtonsResponseMessage";
            };

            ButtonsResponseMessage.Type = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "DISPLAY_TEXT"] = 1;
                return values;
            })();

            return ButtonsResponseMessage;
        })();

        Message.Call = (function() {

            function Call(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            Call.prototype.callKey = null;
            Call.prototype.conversionSource = null;
            Call.prototype.conversionData = null;
            Call.prototype.conversionDelaySeconds = null;
            Call.prototype.ctwaSignals = null;
            Call.prototype.ctwaPayload = null;
            Call.prototype.contextInfo = null;
            Call.prototype.nativeFlowCallButtonPayload = null;
            Call.prototype.deeplinkPayload = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_callKey", {
                get: $util.oneOfGetter($oneOfFields = ["callKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_conversionSource", {
                get: $util.oneOfGetter($oneOfFields = ["conversionSource"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_conversionData", {
                get: $util.oneOfGetter($oneOfFields = ["conversionData"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_conversionDelaySeconds", {
                get: $util.oneOfGetter($oneOfFields = ["conversionDelaySeconds"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_ctwaSignals", {
                get: $util.oneOfGetter($oneOfFields = ["ctwaSignals"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_ctwaPayload", {
                get: $util.oneOfGetter($oneOfFields = ["ctwaPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_nativeFlowCallButtonPayload", {
                get: $util.oneOfGetter($oneOfFields = ["nativeFlowCallButtonPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Call.prototype, "_deeplinkPayload", {
                get: $util.oneOfGetter($oneOfFields = ["deeplinkPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Call.create = function create(properties) {
                return new Call(properties);
            };

            Call.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.callKey != null && Object.hasOwnProperty.call(m, "callKey"))
                    w.uint32(10).bytes(m.callKey);
                if (m.conversionSource != null && Object.hasOwnProperty.call(m, "conversionSource"))
                    w.uint32(18).string(m.conversionSource);
                if (m.conversionData != null && Object.hasOwnProperty.call(m, "conversionData"))
                    w.uint32(26).bytes(m.conversionData);
                if (m.conversionDelaySeconds != null && Object.hasOwnProperty.call(m, "conversionDelaySeconds"))
                    w.uint32(32).uint32(m.conversionDelaySeconds);
                if (m.ctwaSignals != null && Object.hasOwnProperty.call(m, "ctwaSignals"))
                    w.uint32(42).string(m.ctwaSignals);
                if (m.ctwaPayload != null && Object.hasOwnProperty.call(m, "ctwaPayload"))
                    w.uint32(50).bytes(m.ctwaPayload);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(58).fork()).ldelim();
                if (m.nativeFlowCallButtonPayload != null && Object.hasOwnProperty.call(m, "nativeFlowCallButtonPayload"))
                    w.uint32(66).string(m.nativeFlowCallButtonPayload);
                if (m.deeplinkPayload != null && Object.hasOwnProperty.call(m, "deeplinkPayload"))
                    w.uint32(74).string(m.deeplinkPayload);
                return w;
            };

            Call.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.Call();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.callKey = r.bytes();
                            break;
                        }
                    case 2: {
                            m.conversionSource = r.string();
                            break;
                        }
                    case 3: {
                            m.conversionData = r.bytes();
                            break;
                        }
                    case 4: {
                            m.conversionDelaySeconds = r.uint32();
                            break;
                        }
                    case 5: {
                            m.ctwaSignals = r.string();
                            break;
                        }
                    case 6: {
                            m.ctwaPayload = r.bytes();
                            break;
                        }
                    case 7: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 8: {
                            m.nativeFlowCallButtonPayload = r.string();
                            break;
                        }
                    case 9: {
                            m.deeplinkPayload = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            Call.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.Call)
                    return d;
                var m = new $root.proto.Message.Call();
                if (d.callKey != null) {
                    if (typeof d.callKey === "string")
                        $util.base64.decode(d.callKey, m.callKey = $util.newBuffer($util.base64.length(d.callKey)), 0);
                    else if (d.callKey.length >= 0)
                        m.callKey = d.callKey;
                }
                if (d.conversionSource != null) {
                    m.conversionSource = String(d.conversionSource);
                }
                if (d.conversionData != null) {
                    if (typeof d.conversionData === "string")
                        $util.base64.decode(d.conversionData, m.conversionData = $util.newBuffer($util.base64.length(d.conversionData)), 0);
                    else if (d.conversionData.length >= 0)
                        m.conversionData = d.conversionData;
                }
                if (d.conversionDelaySeconds != null) {
                    m.conversionDelaySeconds = d.conversionDelaySeconds >>> 0;
                }
                if (d.ctwaSignals != null) {
                    m.ctwaSignals = String(d.ctwaSignals);
                }
                if (d.ctwaPayload != null) {
                    if (typeof d.ctwaPayload === "string")
                        $util.base64.decode(d.ctwaPayload, m.ctwaPayload = $util.newBuffer($util.base64.length(d.ctwaPayload)), 0);
                    else if (d.ctwaPayload.length >= 0)
                        m.ctwaPayload = d.ctwaPayload;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.Call.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.nativeFlowCallButtonPayload != null) {
                    m.nativeFlowCallButtonPayload = String(d.nativeFlowCallButtonPayload);
                }
                if (d.deeplinkPayload != null) {
                    m.deeplinkPayload = String(d.deeplinkPayload);
                }
                return m;
            };

            Call.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.callKey != null && m.hasOwnProperty("callKey")) {
                    d.callKey = o.bytes === String ? $util.base64.encode(m.callKey, 0, m.callKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.callKey) : m.callKey;
                    if (o.oneofs)
                        d._callKey = "callKey";
                }
                if (m.conversionSource != null && m.hasOwnProperty("conversionSource")) {
                    d.conversionSource = m.conversionSource;
                    if (o.oneofs)
                        d._conversionSource = "conversionSource";
                }
                if (m.conversionData != null && m.hasOwnProperty("conversionData")) {
                    d.conversionData = o.bytes === String ? $util.base64.encode(m.conversionData, 0, m.conversionData.length) : o.bytes === Array ? Array.prototype.slice.call(m.conversionData) : m.conversionData;
                    if (o.oneofs)
                        d._conversionData = "conversionData";
                }
                if (m.conversionDelaySeconds != null && m.hasOwnProperty("conversionDelaySeconds")) {
                    d.conversionDelaySeconds = m.conversionDelaySeconds;
                    if (o.oneofs)
                        d._conversionDelaySeconds = "conversionDelaySeconds";
                }
                if (m.ctwaSignals != null && m.hasOwnProperty("ctwaSignals")) {
                    d.ctwaSignals = m.ctwaSignals;
                    if (o.oneofs)
                        d._ctwaSignals = "ctwaSignals";
                }
                if (m.ctwaPayload != null && m.hasOwnProperty("ctwaPayload")) {
                    d.ctwaPayload = o.bytes === String ? $util.base64.encode(m.ctwaPayload, 0, m.ctwaPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.ctwaPayload) : m.ctwaPayload;
                    if (o.oneofs)
                        d._ctwaPayload = "ctwaPayload";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.nativeFlowCallButtonPayload != null && m.hasOwnProperty("nativeFlowCallButtonPayload")) {
                    d.nativeFlowCallButtonPayload = m.nativeFlowCallButtonPayload;
                    if (o.oneofs)
                        d._nativeFlowCallButtonPayload = "nativeFlowCallButtonPayload";
                }
                if (m.deeplinkPayload != null && m.hasOwnProperty("deeplinkPayload")) {
                    d.deeplinkPayload = m.deeplinkPayload;
                    if (o.oneofs)
                        d._deeplinkPayload = "deeplinkPayload";
                }
                return d;
            };

            Call.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            Call.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.Call";
            };

            return Call;
        })();

        Message.CallLogMessage = (function() {

            function CallLogMessage(p) {
                this.participants = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CallLogMessage.prototype.isVideo = null;
            CallLogMessage.prototype.callOutcome = null;
            CallLogMessage.prototype.durationSecs = null;
            CallLogMessage.prototype.callType = null;
            CallLogMessage.prototype.participants = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CallLogMessage.prototype, "_isVideo", {
                get: $util.oneOfGetter($oneOfFields = ["isVideo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CallLogMessage.prototype, "_callOutcome", {
                get: $util.oneOfGetter($oneOfFields = ["callOutcome"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CallLogMessage.prototype, "_durationSecs", {
                get: $util.oneOfGetter($oneOfFields = ["durationSecs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CallLogMessage.prototype, "_callType", {
                get: $util.oneOfGetter($oneOfFields = ["callType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            CallLogMessage.create = function create(properties) {
                return new CallLogMessage(properties);
            };

            CallLogMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isVideo != null && Object.hasOwnProperty.call(m, "isVideo"))
                    w.uint32(8).bool(m.isVideo);
                if (m.callOutcome != null && Object.hasOwnProperty.call(m, "callOutcome"))
                    w.uint32(16).int32(m.callOutcome);
                if (m.durationSecs != null && Object.hasOwnProperty.call(m, "durationSecs"))
                    w.uint32(24).int64(m.durationSecs);
                if (m.callType != null && Object.hasOwnProperty.call(m, "callType"))
                    w.uint32(32).int32(m.callType);
                if (m.participants != null && m.participants.length) {
                    for (var i = 0; i < m.participants.length; ++i)
                        $root.proto.Message.CallLogMessage.CallParticipant.encode(m.participants[i], w.uint32(42).fork()).ldelim();
                }
                return w;
            };

            CallLogMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.CallLogMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isVideo = r.bool();
                            break;
                        }
                    case 2: {
                            m.callOutcome = r.int32();
                            break;
                        }
                    case 3: {
                            m.durationSecs = r.int64();
                            break;
                        }
                    case 4: {
                            m.callType = r.int32();
                            break;
                        }
                    case 5: {
                            if (!(m.participants && m.participants.length))
                                m.participants = [];
                            m.participants.push($root.proto.Message.CallLogMessage.CallParticipant.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CallLogMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.CallLogMessage)
                    return d;
                var m = new $root.proto.Message.CallLogMessage();
                if (d.isVideo != null) {
                    m.isVideo = Boolean(d.isVideo);
                }
                switch (d.callOutcome) {
                default:
                    if (typeof d.callOutcome === "number") {
                        m.callOutcome = d.callOutcome;
                        break;
                    }
                    break;
                case "CONNECTED":
                case 0:
                    m.callOutcome = 0;
                    break;
                case "MISSED":
                case 1:
                    m.callOutcome = 1;
                    break;
                case "FAILED":
                case 2:
                    m.callOutcome = 2;
                    break;
                case "REJECTED":
                case 3:
                    m.callOutcome = 3;
                    break;
                case "ACCEPTED_ELSEWHERE":
                case 4:
                    m.callOutcome = 4;
                    break;
                case "ONGOING":
                case 5:
                    m.callOutcome = 5;
                    break;
                case "SILENCED_BY_DND":
                case 6:
                    m.callOutcome = 6;
                    break;
                case "SILENCED_UNKNOWN_CALLER":
                case 7:
                    m.callOutcome = 7;
                    break;
                }
                if (d.durationSecs != null) {
                    if ($util.Long)
                        (m.durationSecs = $util.Long.fromValue(d.durationSecs)).unsigned = false;
                    else if (typeof d.durationSecs === "string")
                        m.durationSecs = parseInt(d.durationSecs, 10);
                    else if (typeof d.durationSecs === "number")
                        m.durationSecs = d.durationSecs;
                    else if (typeof d.durationSecs === "object")
                        m.durationSecs = new $util.LongBits(d.durationSecs.low >>> 0, d.durationSecs.high >>> 0).toNumber();
                }
                switch (d.callType) {
                default:
                    if (typeof d.callType === "number") {
                        m.callType = d.callType;
                        break;
                    }
                    break;
                case "REGULAR":
                case 0:
                    m.callType = 0;
                    break;
                case "SCHEDULED_CALL":
                case 1:
                    m.callType = 1;
                    break;
                case "VOICE_CHAT":
                case 2:
                    m.callType = 2;
                    break;
                }
                if (d.participants) {
                    if (!Array.isArray(d.participants))
                        throw TypeError(".proto.Message.CallLogMessage.participants: array expected");
                    m.participants = [];
                    for (var i = 0; i < d.participants.length; ++i) {
                        if (typeof d.participants[i] !== "object")
                            throw TypeError(".proto.Message.CallLogMessage.participants: object expected");
                        m.participants[i] = $root.proto.Message.CallLogMessage.CallParticipant.fromObject(d.participants[i]);
                    }
                }
                return m;
            };

            CallLogMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.participants = [];
                }
                if (m.isVideo != null && m.hasOwnProperty("isVideo")) {
                    d.isVideo = m.isVideo;
                    if (o.oneofs)
                        d._isVideo = "isVideo";
                }
                if (m.callOutcome != null && m.hasOwnProperty("callOutcome")) {
                    d.callOutcome = o.enums === String ? $root.proto.Message.CallLogMessage.CallOutcome[m.callOutcome] === undefined ? m.callOutcome : $root.proto.Message.CallLogMessage.CallOutcome[m.callOutcome] : m.callOutcome;
                    if (o.oneofs)
                        d._callOutcome = "callOutcome";
                }
                if (m.durationSecs != null && m.hasOwnProperty("durationSecs")) {
                    if (typeof m.durationSecs === "number")
                        d.durationSecs = o.longs === String ? String(m.durationSecs) : m.durationSecs;
                    else
                        d.durationSecs = o.longs === String ? longToString(m.durationSecs) : o.longs === Number ? longToNumber(m.durationSecs) : m.durationSecs;
                    if (o.oneofs)
                        d._durationSecs = "durationSecs";
                }
                if (m.callType != null && m.hasOwnProperty("callType")) {
                    d.callType = o.enums === String ? $root.proto.Message.CallLogMessage.CallType[m.callType] === undefined ? m.callType : $root.proto.Message.CallLogMessage.CallType[m.callType] : m.callType;
                    if (o.oneofs)
                        d._callType = "callType";
                }
                if (m.participants && m.participants.length) {
                    d.participants = [];
                    for (var j = 0; j < m.participants.length; ++j) {
                        d.participants[j] = $root.proto.Message.CallLogMessage.CallParticipant.toObject(m.participants[j], o);
                    }
                }
                return d;
            };

            CallLogMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CallLogMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.CallLogMessage";
            };

            CallLogMessage.CallOutcome = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "CONNECTED"] = 0;
                values[valuesById[1] = "MISSED"] = 1;
                values[valuesById[2] = "FAILED"] = 2;
                values[valuesById[3] = "REJECTED"] = 3;
                values[valuesById[4] = "ACCEPTED_ELSEWHERE"] = 4;
                values[valuesById[5] = "ONGOING"] = 5;
                values[valuesById[6] = "SILENCED_BY_DND"] = 6;
                values[valuesById[7] = "SILENCED_UNKNOWN_CALLER"] = 7;
                return values;
            })();

            CallLogMessage.CallParticipant = (function() {

                function CallParticipant(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                CallParticipant.prototype.jid = null;
                CallParticipant.prototype.callOutcome = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CallParticipant.prototype, "_jid", {
                    get: $util.oneOfGetter($oneOfFields = ["jid"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CallParticipant.prototype, "_callOutcome", {
                    get: $util.oneOfGetter($oneOfFields = ["callOutcome"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                CallParticipant.create = function create(properties) {
                    return new CallParticipant(properties);
                };

                CallParticipant.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.jid != null && Object.hasOwnProperty.call(m, "jid"))
                        w.uint32(10).string(m.jid);
                    if (m.callOutcome != null && Object.hasOwnProperty.call(m, "callOutcome"))
                        w.uint32(16).int32(m.callOutcome);
                    return w;
                };

                CallParticipant.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.CallLogMessage.CallParticipant();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.jid = r.string();
                                break;
                            }
                        case 2: {
                                m.callOutcome = r.int32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                CallParticipant.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.CallLogMessage.CallParticipant)
                        return d;
                    var m = new $root.proto.Message.CallLogMessage.CallParticipant();
                    if (d.jid != null) {
                        m.jid = String(d.jid);
                    }
                    switch (d.callOutcome) {
                    default:
                        if (typeof d.callOutcome === "number") {
                            m.callOutcome = d.callOutcome;
                            break;
                        }
                        break;
                    case "CONNECTED":
                    case 0:
                        m.callOutcome = 0;
                        break;
                    case "MISSED":
                    case 1:
                        m.callOutcome = 1;
                        break;
                    case "FAILED":
                    case 2:
                        m.callOutcome = 2;
                        break;
                    case "REJECTED":
                    case 3:
                        m.callOutcome = 3;
                        break;
                    case "ACCEPTED_ELSEWHERE":
                    case 4:
                        m.callOutcome = 4;
                        break;
                    case "ONGOING":
                    case 5:
                        m.callOutcome = 5;
                        break;
                    case "SILENCED_BY_DND":
                    case 6:
                        m.callOutcome = 6;
                        break;
                    case "SILENCED_UNKNOWN_CALLER":
                    case 7:
                        m.callOutcome = 7;
                        break;
                    }
                    return m;
                };

                CallParticipant.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.jid != null && m.hasOwnProperty("jid")) {
                        d.jid = m.jid;
                        if (o.oneofs)
                            d._jid = "jid";
                    }
                    if (m.callOutcome != null && m.hasOwnProperty("callOutcome")) {
                        d.callOutcome = o.enums === String ? $root.proto.Message.CallLogMessage.CallOutcome[m.callOutcome] === undefined ? m.callOutcome : $root.proto.Message.CallLogMessage.CallOutcome[m.callOutcome] : m.callOutcome;
                        if (o.oneofs)
                            d._callOutcome = "callOutcome";
                    }
                    return d;
                };

                CallParticipant.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                CallParticipant.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.CallLogMessage.CallParticipant";
                };

                return CallParticipant;
            })();

            CallLogMessage.CallType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "REGULAR"] = 0;
                values[valuesById[1] = "SCHEDULED_CALL"] = 1;
                values[valuesById[2] = "VOICE_CHAT"] = 2;
                return values;
            })();

            return CallLogMessage;
        })();

        Message.CancelPaymentRequestMessage = (function() {

            function CancelPaymentRequestMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CancelPaymentRequestMessage.prototype.key = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CancelPaymentRequestMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            CancelPaymentRequestMessage.create = function create(properties) {
                return new CancelPaymentRequestMessage(properties);
            };

            CancelPaymentRequestMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                return w;
            };

            CancelPaymentRequestMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.CancelPaymentRequestMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CancelPaymentRequestMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.CancelPaymentRequestMessage)
                    return d;
                var m = new $root.proto.Message.CancelPaymentRequestMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.CancelPaymentRequestMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                return m;
            };

            CancelPaymentRequestMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                return d;
            };

            CancelPaymentRequestMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CancelPaymentRequestMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.CancelPaymentRequestMessage";
            };

            return CancelPaymentRequestMessage;
        })();

        Message.Chat = (function() {

            function Chat(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            Chat.prototype.displayName = null;
            Chat.prototype.id = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Chat.prototype, "_displayName", {
                get: $util.oneOfGetter($oneOfFields = ["displayName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Chat.prototype, "_id", {
                get: $util.oneOfGetter($oneOfFields = ["id"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Chat.create = function create(properties) {
                return new Chat(properties);
            };

            Chat.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayName != null && Object.hasOwnProperty.call(m, "displayName"))
                    w.uint32(10).string(m.displayName);
                if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                    w.uint32(18).string(m.id);
                return w;
            };

            Chat.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.Chat();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayName = r.string();
                            break;
                        }
                    case 2: {
                            m.id = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            Chat.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.Chat)
                    return d;
                var m = new $root.proto.Message.Chat();
                if (d.displayName != null) {
                    m.displayName = String(d.displayName);
                }
                if (d.id != null) {
                    m.id = String(d.id);
                }
                return m;
            };

            Chat.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.displayName != null && m.hasOwnProperty("displayName")) {
                    d.displayName = m.displayName;
                    if (o.oneofs)
                        d._displayName = "displayName";
                }
                if (m.id != null && m.hasOwnProperty("id")) {
                    d.id = m.id;
                    if (o.oneofs)
                        d._id = "id";
                }
                return d;
            };

            Chat.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            Chat.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.Chat";
            };

            return Chat;
        })();

        Message.CloudAPIThreadControlNotification = (function() {

            function CloudAPIThreadControlNotification(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CloudAPIThreadControlNotification.prototype.status = null;
            CloudAPIThreadControlNotification.prototype.senderNotificationTimestampMs = null;
            CloudAPIThreadControlNotification.prototype.consumerLid = null;
            CloudAPIThreadControlNotification.prototype.consumerPhoneNumber = null;
            CloudAPIThreadControlNotification.prototype.notificationContent = null;
            CloudAPIThreadControlNotification.prototype.shouldSuppressNotification = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_status", {
                get: $util.oneOfGetter($oneOfFields = ["status"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_senderNotificationTimestampMs", {
                get: $util.oneOfGetter($oneOfFields = ["senderNotificationTimestampMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_consumerLid", {
                get: $util.oneOfGetter($oneOfFields = ["consumerLid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_consumerPhoneNumber", {
                get: $util.oneOfGetter($oneOfFields = ["consumerPhoneNumber"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_notificationContent", {
                get: $util.oneOfGetter($oneOfFields = ["notificationContent"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_shouldSuppressNotification", {
                get: $util.oneOfGetter($oneOfFields = ["shouldSuppressNotification"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            CloudAPIThreadControlNotification.create = function create(properties) {
                return new CloudAPIThreadControlNotification(properties);
            };

            CloudAPIThreadControlNotification.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.status != null && Object.hasOwnProperty.call(m, "status"))
                    w.uint32(8).int32(m.status);
                if (m.senderNotificationTimestampMs != null && Object.hasOwnProperty.call(m, "senderNotificationTimestampMs"))
                    w.uint32(16).int64(m.senderNotificationTimestampMs);
                if (m.consumerLid != null && Object.hasOwnProperty.call(m, "consumerLid"))
                    w.uint32(26).string(m.consumerLid);
                if (m.consumerPhoneNumber != null && Object.hasOwnProperty.call(m, "consumerPhoneNumber"))
                    w.uint32(34).string(m.consumerPhoneNumber);
                if (m.notificationContent != null && Object.hasOwnProperty.call(m, "notificationContent"))
                    $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.encode(m.notificationContent, w.uint32(42).fork()).ldelim();
                if (m.shouldSuppressNotification != null && Object.hasOwnProperty.call(m, "shouldSuppressNotification"))
                    w.uint32(48).bool(m.shouldSuppressNotification);
                return w;
            };

            CloudAPIThreadControlNotification.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.CloudAPIThreadControlNotification();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.status = r.int32();
                            break;
                        }
                    case 2: {
                            m.senderNotificationTimestampMs = r.int64();
                            break;
                        }
                    case 3: {
                            m.consumerLid = r.string();
                            break;
                        }
                    case 4: {
                            m.consumerPhoneNumber = r.string();
                            break;
                        }
                    case 5: {
                            m.notificationContent = $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.decode(r, r.uint32());
                            break;
                        }
                    case 6: {
                            m.shouldSuppressNotification = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CloudAPIThreadControlNotification.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.CloudAPIThreadControlNotification)
                    return d;
                var m = new $root.proto.Message.CloudAPIThreadControlNotification();
                switch (d.status) {
                default:
                    if (typeof d.status === "number") {
                        m.status = d.status;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.status = 0;
                    break;
                case "CONTROL_PASSED":
                case 1:
                    m.status = 1;
                    break;
                case "CONTROL_TAKEN":
                case 2:
                    m.status = 2;
                    break;
                }
                if (d.senderNotificationTimestampMs != null) {
                    if ($util.Long)
                        (m.senderNotificationTimestampMs = $util.Long.fromValue(d.senderNotificationTimestampMs)).unsigned = false;
                    else if (typeof d.senderNotificationTimestampMs === "string")
                        m.senderNotificationTimestampMs = parseInt(d.senderNotificationTimestampMs, 10);
                    else if (typeof d.senderNotificationTimestampMs === "number")
                        m.senderNotificationTimestampMs = d.senderNotificationTimestampMs;
                    else if (typeof d.senderNotificationTimestampMs === "object")
                        m.senderNotificationTimestampMs = new $util.LongBits(d.senderNotificationTimestampMs.low >>> 0, d.senderNotificationTimestampMs.high >>> 0).toNumber();
                }
                if (d.consumerLid != null) {
                    m.consumerLid = String(d.consumerLid);
                }
                if (d.consumerPhoneNumber != null) {
                    m.consumerPhoneNumber = String(d.consumerPhoneNumber);
                }
                if (d.notificationContent != null) {
                    if (typeof d.notificationContent !== "object")
                        throw TypeError(".proto.Message.CloudAPIThreadControlNotification.notificationContent: object expected");
                    m.notificationContent = $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.fromObject(d.notificationContent);
                }
                if (d.shouldSuppressNotification != null) {
                    m.shouldSuppressNotification = Boolean(d.shouldSuppressNotification);
                }
                return m;
            };

            CloudAPIThreadControlNotification.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.status != null && m.hasOwnProperty("status")) {
                    d.status = o.enums === String ? $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[m.status] === undefined ? m.status : $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[m.status] : m.status;
                    if (o.oneofs)
                        d._status = "status";
                }
                if (m.senderNotificationTimestampMs != null && m.hasOwnProperty("senderNotificationTimestampMs")) {
                    if (typeof m.senderNotificationTimestampMs === "number")
                        d.senderNotificationTimestampMs = o.longs === String ? String(m.senderNotificationTimestampMs) : m.senderNotificationTimestampMs;
                    else
                        d.senderNotificationTimestampMs = o.longs === String ? longToString(m.senderNotificationTimestampMs) : o.longs === Number ? longToNumber(m.senderNotificationTimestampMs) : m.senderNotificationTimestampMs;
                    if (o.oneofs)
                        d._senderNotificationTimestampMs = "senderNotificationTimestampMs";
                }
                if (m.consumerLid != null && m.hasOwnProperty("consumerLid")) {
                    d.consumerLid = m.consumerLid;
                    if (o.oneofs)
                        d._consumerLid = "consumerLid";
                }
                if (m.consumerPhoneNumber != null && m.hasOwnProperty("consumerPhoneNumber")) {
                    d.consumerPhoneNumber = m.consumerPhoneNumber;
                    if (o.oneofs)
                        d._consumerPhoneNumber = "consumerPhoneNumber";
                }
                if (m.notificationContent != null && m.hasOwnProperty("notificationContent")) {
                    d.notificationContent = $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.toObject(m.notificationContent, o);
                    if (o.oneofs)
                        d._notificationContent = "notificationContent";
                }
                if (m.shouldSuppressNotification != null && m.hasOwnProperty("shouldSuppressNotification")) {
                    d.shouldSuppressNotification = m.shouldSuppressNotification;
                    if (o.oneofs)
                        d._shouldSuppressNotification = "shouldSuppressNotification";
                }
                return d;
            };

            CloudAPIThreadControlNotification.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CloudAPIThreadControlNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.CloudAPIThreadControlNotification";
            };

            CloudAPIThreadControlNotification.CloudAPIThreadControl = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "CONTROL_PASSED"] = 1;
                values[valuesById[2] = "CONTROL_TAKEN"] = 2;
                return values;
            })();

            CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent = (function() {

                function CloudAPIThreadControlNotificationContent(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                CloudAPIThreadControlNotificationContent.prototype.handoffNotificationText = null;
                CloudAPIThreadControlNotificationContent.prototype.extraJson = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CloudAPIThreadControlNotificationContent.prototype, "_handoffNotificationText", {
                    get: $util.oneOfGetter($oneOfFields = ["handoffNotificationText"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CloudAPIThreadControlNotificationContent.prototype, "_extraJson", {
                    get: $util.oneOfGetter($oneOfFields = ["extraJson"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                CloudAPIThreadControlNotificationContent.create = function create(properties) {
                    return new CloudAPIThreadControlNotificationContent(properties);
                };

                CloudAPIThreadControlNotificationContent.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.handoffNotificationText != null && Object.hasOwnProperty.call(m, "handoffNotificationText"))
                        w.uint32(10).string(m.handoffNotificationText);
                    if (m.extraJson != null && Object.hasOwnProperty.call(m, "extraJson"))
                        w.uint32(18).string(m.extraJson);
                    return w;
                };

                CloudAPIThreadControlNotificationContent.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.handoffNotificationText = r.string();
                                break;
                            }
                        case 2: {
                                m.extraJson = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                CloudAPIThreadControlNotificationContent.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent)
                        return d;
                    var m = new $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent();
                    if (d.handoffNotificationText != null) {
                        m.handoffNotificationText = String(d.handoffNotificationText);
                    }
                    if (d.extraJson != null) {
                        m.extraJson = String(d.extraJson);
                    }
                    return m;
                };

                CloudAPIThreadControlNotificationContent.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.handoffNotificationText != null && m.hasOwnProperty("handoffNotificationText")) {
                        d.handoffNotificationText = m.handoffNotificationText;
                        if (o.oneofs)
                            d._handoffNotificationText = "handoffNotificationText";
                    }
                    if (m.extraJson != null && m.hasOwnProperty("extraJson")) {
                        d.extraJson = m.extraJson;
                        if (o.oneofs)
                            d._extraJson = "extraJson";
                    }
                    return d;
                };

                CloudAPIThreadControlNotificationContent.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                CloudAPIThreadControlNotificationContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent";
                };

                return CloudAPIThreadControlNotificationContent;
            })();

            return CloudAPIThreadControlNotification;
        })();

        Message.CommentMessage = (function() {

            function CommentMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CommentMessage.prototype.message = null;
            CommentMessage.prototype.targetMessageKey = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CommentMessage.prototype, "_message", {
                get: $util.oneOfGetter($oneOfFields = ["message"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CommentMessage.prototype, "_targetMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            CommentMessage.create = function create(properties) {
                return new CommentMessage(properties);
            };

            CommentMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                    $root.proto.Message.encode(m.message, w.uint32(10).fork()).ldelim();
                if (m.targetMessageKey != null && Object.hasOwnProperty.call(m, "targetMessageKey"))
                    $root.proto.MessageKey.encode(m.targetMessageKey, w.uint32(18).fork()).ldelim();
                return w;
            };

            CommentMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.CommentMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.message = $root.proto.Message.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.targetMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CommentMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.CommentMessage)
                    return d;
                var m = new $root.proto.Message.CommentMessage();
                if (d.message != null) {
                    if (typeof d.message !== "object")
                        throw TypeError(".proto.Message.CommentMessage.message: object expected");
                    m.message = $root.proto.Message.fromObject(d.message);
                }
                if (d.targetMessageKey != null) {
                    if (typeof d.targetMessageKey !== "object")
                        throw TypeError(".proto.Message.CommentMessage.targetMessageKey: object expected");
                    m.targetMessageKey = $root.proto.MessageKey.fromObject(d.targetMessageKey);
                }
                return m;
            };

            CommentMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.message != null && m.hasOwnProperty("message")) {
                    d.message = $root.proto.Message.toObject(m.message, o);
                    if (o.oneofs)
                        d._message = "message";
                }
                if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) {
                    d.targetMessageKey = $root.proto.MessageKey.toObject(m.targetMessageKey, o);
                    if (o.oneofs)
                        d._targetMessageKey = "targetMessageKey";
                }
                return d;
            };

            CommentMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CommentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.CommentMessage";
            };

            return CommentMessage;
        })();

        Message.ContactMessage = (function() {

            function ContactMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ContactMessage.prototype.displayName = null;
            ContactMessage.prototype.vcard = null;
            ContactMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactMessage.prototype, "_displayName", {
                get: $util.oneOfGetter($oneOfFields = ["displayName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactMessage.prototype, "_vcard", {
                get: $util.oneOfGetter($oneOfFields = ["vcard"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ContactMessage.create = function create(properties) {
                return new ContactMessage(properties);
            };

            ContactMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayName != null && Object.hasOwnProperty.call(m, "displayName"))
                    w.uint32(10).string(m.displayName);
                if (m.vcard != null && Object.hasOwnProperty.call(m, "vcard"))
                    w.uint32(130).string(m.vcard);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                return w;
            };

            ContactMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ContactMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayName = r.string();
                            break;
                        }
                    case 16: {
                            m.vcard = r.string();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ContactMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ContactMessage)
                    return d;
                var m = new $root.proto.Message.ContactMessage();
                if (d.displayName != null) {
                    m.displayName = String(d.displayName);
                }
                if (d.vcard != null) {
                    m.vcard = String(d.vcard);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ContactMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            ContactMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.displayName != null && m.hasOwnProperty("displayName")) {
                    d.displayName = m.displayName;
                    if (o.oneofs)
                        d._displayName = "displayName";
                }
                if (m.vcard != null && m.hasOwnProperty("vcard")) {
                    d.vcard = m.vcard;
                    if (o.oneofs)
                        d._vcard = "vcard";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            ContactMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ContactMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ContactMessage";
            };

            return ContactMessage;
        })();

        Message.ContactsArrayMessage = (function() {

            function ContactsArrayMessage(p) {
                this.contacts = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ContactsArrayMessage.prototype.displayName = null;
            ContactsArrayMessage.prototype.contacts = $util.emptyArray;
            ContactsArrayMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactsArrayMessage.prototype, "_displayName", {
                get: $util.oneOfGetter($oneOfFields = ["displayName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactsArrayMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ContactsArrayMessage.create = function create(properties) {
                return new ContactsArrayMessage(properties);
            };

            ContactsArrayMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayName != null && Object.hasOwnProperty.call(m, "displayName"))
                    w.uint32(10).string(m.displayName);
                if (m.contacts != null && m.contacts.length) {
                    for (var i = 0; i < m.contacts.length; ++i)
                        $root.proto.Message.ContactMessage.encode(m.contacts[i], w.uint32(18).fork()).ldelim();
                }
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                return w;
            };

            ContactsArrayMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ContactsArrayMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayName = r.string();
                            break;
                        }
                    case 2: {
                            if (!(m.contacts && m.contacts.length))
                                m.contacts = [];
                            m.contacts.push($root.proto.Message.ContactMessage.decode(r, r.uint32()));
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ContactsArrayMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ContactsArrayMessage)
                    return d;
                var m = new $root.proto.Message.ContactsArrayMessage();
                if (d.displayName != null) {
                    m.displayName = String(d.displayName);
                }
                if (d.contacts) {
                    if (!Array.isArray(d.contacts))
                        throw TypeError(".proto.Message.ContactsArrayMessage.contacts: array expected");
                    m.contacts = [];
                    for (var i = 0; i < d.contacts.length; ++i) {
                        if (typeof d.contacts[i] !== "object")
                            throw TypeError(".proto.Message.ContactsArrayMessage.contacts: object expected");
                        m.contacts[i] = $root.proto.Message.ContactMessage.fromObject(d.contacts[i]);
                    }
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ContactsArrayMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            ContactsArrayMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.contacts = [];
                }
                if (m.displayName != null && m.hasOwnProperty("displayName")) {
                    d.displayName = m.displayName;
                    if (o.oneofs)
                        d._displayName = "displayName";
                }
                if (m.contacts && m.contacts.length) {
                    d.contacts = [];
                    for (var j = 0; j < m.contacts.length; ++j) {
                        d.contacts[j] = $root.proto.Message.ContactMessage.toObject(m.contacts[j], o);
                    }
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            ContactsArrayMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ContactsArrayMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ContactsArrayMessage";
            };

            return ContactsArrayMessage;
        })();

        Message.DeclinePaymentRequestMessage = (function() {

            function DeclinePaymentRequestMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DeclinePaymentRequestMessage.prototype.key = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeclinePaymentRequestMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DeclinePaymentRequestMessage.create = function create(properties) {
                return new DeclinePaymentRequestMessage(properties);
            };

            DeclinePaymentRequestMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                return w;
            };

            DeclinePaymentRequestMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.DeclinePaymentRequestMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DeclinePaymentRequestMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.DeclinePaymentRequestMessage)
                    return d;
                var m = new $root.proto.Message.DeclinePaymentRequestMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.DeclinePaymentRequestMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                return m;
            };

            DeclinePaymentRequestMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                return d;
            };

            DeclinePaymentRequestMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DeclinePaymentRequestMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.DeclinePaymentRequestMessage";
            };

            return DeclinePaymentRequestMessage;
        })();

        Message.DeviceSentMessage = (function() {

            function DeviceSentMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DeviceSentMessage.prototype.destinationJid = null;
            DeviceSentMessage.prototype.message = null;
            DeviceSentMessage.prototype.phash = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeviceSentMessage.prototype, "_destinationJid", {
                get: $util.oneOfGetter($oneOfFields = ["destinationJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeviceSentMessage.prototype, "_message", {
                get: $util.oneOfGetter($oneOfFields = ["message"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeviceSentMessage.prototype, "_phash", {
                get: $util.oneOfGetter($oneOfFields = ["phash"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DeviceSentMessage.create = function create(properties) {
                return new DeviceSentMessage(properties);
            };

            DeviceSentMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.destinationJid != null && Object.hasOwnProperty.call(m, "destinationJid"))
                    w.uint32(10).string(m.destinationJid);
                if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                    $root.proto.Message.encode(m.message, w.uint32(18).fork()).ldelim();
                if (m.phash != null && Object.hasOwnProperty.call(m, "phash"))
                    w.uint32(26).string(m.phash);
                return w;
            };

            DeviceSentMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.DeviceSentMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.destinationJid = r.string();
                            break;
                        }
                    case 2: {
                            m.message = $root.proto.Message.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.phash = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DeviceSentMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.DeviceSentMessage)
                    return d;
                var m = new $root.proto.Message.DeviceSentMessage();
                if (d.destinationJid != null) {
                    m.destinationJid = String(d.destinationJid);
                }
                if (d.message != null) {
                    if (typeof d.message !== "object")
                        throw TypeError(".proto.Message.DeviceSentMessage.message: object expected");
                    m.message = $root.proto.Message.fromObject(d.message);
                }
                if (d.phash != null) {
                    m.phash = String(d.phash);
                }
                return m;
            };

            DeviceSentMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.destinationJid != null && m.hasOwnProperty("destinationJid")) {
                    d.destinationJid = m.destinationJid;
                    if (o.oneofs)
                        d._destinationJid = "destinationJid";
                }
                if (m.message != null && m.hasOwnProperty("message")) {
                    d.message = $root.proto.Message.toObject(m.message, o);
                    if (o.oneofs)
                        d._message = "message";
                }
                if (m.phash != null && m.hasOwnProperty("phash")) {
                    d.phash = m.phash;
                    if (o.oneofs)
                        d._phash = "phash";
                }
                return d;
            };

            DeviceSentMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DeviceSentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.DeviceSentMessage";
            };

            return DeviceSentMessage;
        })();

        Message.DocumentMessage = (function() {

            function DocumentMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DocumentMessage.prototype.url = null;
            DocumentMessage.prototype.mimetype = null;
            DocumentMessage.prototype.title = null;
            DocumentMessage.prototype.fileSha256 = null;
            DocumentMessage.prototype.fileLength = null;
            DocumentMessage.prototype.pageCount = null;
            DocumentMessage.prototype.mediaKey = null;
            DocumentMessage.prototype.fileName = null;
            DocumentMessage.prototype.fileEncSha256 = null;
            DocumentMessage.prototype.directPath = null;
            DocumentMessage.prototype.mediaKeyTimestamp = null;
            DocumentMessage.prototype.contactVcard = null;
            DocumentMessage.prototype.thumbnailDirectPath = null;
            DocumentMessage.prototype.thumbnailSha256 = null;
            DocumentMessage.prototype.thumbnailEncSha256 = null;
            DocumentMessage.prototype.jpegThumbnail = null;
            DocumentMessage.prototype.contextInfo = null;
            DocumentMessage.prototype.thumbnailHeight = null;
            DocumentMessage.prototype.thumbnailWidth = null;
            DocumentMessage.prototype.caption = null;
            DocumentMessage.prototype.accessibilityLabel = null;
            DocumentMessage.prototype.mediaKeyDomain = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_mimetype", {
                get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_fileLength", {
                get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_pageCount", {
                get: $util.oneOfGetter($oneOfFields = ["pageCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_fileName", {
                get: $util.oneOfGetter($oneOfFields = ["fileName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_contactVcard", {
                get: $util.oneOfGetter($oneOfFields = ["contactVcard"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_thumbnailDirectPath", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_thumbnailSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_thumbnailEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_thumbnailHeight", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailHeight"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_thumbnailWidth", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailWidth"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_accessibilityLabel", {
                get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DocumentMessage.prototype, "_mediaKeyDomain", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyDomain"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DocumentMessage.create = function create(properties) {
                return new DocumentMessage(properties);
            };

            DocumentMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(10).string(m.url);
                if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                    w.uint32(18).string(m.mimetype);
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(26).string(m.title);
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(34).bytes(m.fileSha256);
                if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                    w.uint32(40).uint64(m.fileLength);
                if (m.pageCount != null && Object.hasOwnProperty.call(m, "pageCount"))
                    w.uint32(48).uint32(m.pageCount);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(58).bytes(m.mediaKey);
                if (m.fileName != null && Object.hasOwnProperty.call(m, "fileName"))
                    w.uint32(66).string(m.fileName);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(74).bytes(m.fileEncSha256);
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(82).string(m.directPath);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(88).int64(m.mediaKeyTimestamp);
                if (m.contactVcard != null && Object.hasOwnProperty.call(m, "contactVcard"))
                    w.uint32(96).bool(m.contactVcard);
                if (m.thumbnailDirectPath != null && Object.hasOwnProperty.call(m, "thumbnailDirectPath"))
                    w.uint32(106).string(m.thumbnailDirectPath);
                if (m.thumbnailSha256 != null && Object.hasOwnProperty.call(m, "thumbnailSha256"))
                    w.uint32(114).bytes(m.thumbnailSha256);
                if (m.thumbnailEncSha256 != null && Object.hasOwnProperty.call(m, "thumbnailEncSha256"))
                    w.uint32(122).bytes(m.thumbnailEncSha256);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(130).bytes(m.jpegThumbnail);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                if (m.thumbnailHeight != null && Object.hasOwnProperty.call(m, "thumbnailHeight"))
                    w.uint32(144).uint32(m.thumbnailHeight);
                if (m.thumbnailWidth != null && Object.hasOwnProperty.call(m, "thumbnailWidth"))
                    w.uint32(152).uint32(m.thumbnailWidth);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(162).string(m.caption);
                if (m.accessibilityLabel != null && Object.hasOwnProperty.call(m, "accessibilityLabel"))
                    w.uint32(170).string(m.accessibilityLabel);
                if (m.mediaKeyDomain != null && Object.hasOwnProperty.call(m, "mediaKeyDomain"))
                    w.uint32(176).int32(m.mediaKeyDomain);
                return w;
            };

            DocumentMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.DocumentMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.url = r.string();
                            break;
                        }
                    case 2: {
                            m.mimetype = r.string();
                            break;
                        }
                    case 3: {
                            m.title = r.string();
                            break;
                        }
                    case 4: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 5: {
                            m.fileLength = r.uint64();
                            break;
                        }
                    case 6: {
                            m.pageCount = r.uint32();
                            break;
                        }
                    case 7: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 8: {
                            m.fileName = r.string();
                            break;
                        }
                    case 9: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 10: {
                            m.directPath = r.string();
                            break;
                        }
                    case 11: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 12: {
                            m.contactVcard = r.bool();
                            break;
                        }
                    case 13: {
                            m.thumbnailDirectPath = r.string();
                            break;
                        }
                    case 14: {
                            m.thumbnailSha256 = r.bytes();
                            break;
                        }
                    case 15: {
                            m.thumbnailEncSha256 = r.bytes();
                            break;
                        }
                    case 16: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 18: {
                            m.thumbnailHeight = r.uint32();
                            break;
                        }
                    case 19: {
                            m.thumbnailWidth = r.uint32();
                            break;
                        }
                    case 20: {
                            m.caption = r.string();
                            break;
                        }
                    case 21: {
                            m.accessibilityLabel = r.string();
                            break;
                        }
                    case 22: {
                            m.mediaKeyDomain = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DocumentMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.DocumentMessage)
                    return d;
                var m = new $root.proto.Message.DocumentMessage();
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.mimetype != null) {
                    m.mimetype = String(d.mimetype);
                }
                if (d.title != null) {
                    m.title = String(d.title);
                }
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.fileLength != null) {
                    if ($util.Long)
                        (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                    else if (typeof d.fileLength === "string")
                        m.fileLength = parseInt(d.fileLength, 10);
                    else if (typeof d.fileLength === "number")
                        m.fileLength = d.fileLength;
                    else if (typeof d.fileLength === "object")
                        m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
                }
                if (d.pageCount != null) {
                    m.pageCount = d.pageCount >>> 0;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.fileName != null) {
                    m.fileName = String(d.fileName);
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.contactVcard != null) {
                    m.contactVcard = Boolean(d.contactVcard);
                }
                if (d.thumbnailDirectPath != null) {
                    m.thumbnailDirectPath = String(d.thumbnailDirectPath);
                }
                if (d.thumbnailSha256 != null) {
                    if (typeof d.thumbnailSha256 === "string")
                        $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0);
                    else if (d.thumbnailSha256.length >= 0)
                        m.thumbnailSha256 = d.thumbnailSha256;
                }
                if (d.thumbnailEncSha256 != null) {
                    if (typeof d.thumbnailEncSha256 === "string")
                        $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0);
                    else if (d.thumbnailEncSha256.length >= 0)
                        m.thumbnailEncSha256 = d.thumbnailEncSha256;
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.DocumentMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.thumbnailHeight != null) {
                    m.thumbnailHeight = d.thumbnailHeight >>> 0;
                }
                if (d.thumbnailWidth != null) {
                    m.thumbnailWidth = d.thumbnailWidth >>> 0;
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.accessibilityLabel != null) {
                    m.accessibilityLabel = String(d.accessibilityLabel);
                }
                switch (d.mediaKeyDomain) {
                default:
                    if (typeof d.mediaKeyDomain === "number") {
                        m.mediaKeyDomain = d.mediaKeyDomain;
                        break;
                    }
                    break;
                case "UNSET":
                case 0:
                    m.mediaKeyDomain = 0;
                    break;
                case "E2EE_CHAT":
                case 1:
                    m.mediaKeyDomain = 1;
                    break;
                case "STATUS":
                case 2:
                    m.mediaKeyDomain = 2;
                    break;
                case "CAPI":
                case 3:
                    m.mediaKeyDomain = 3;
                    break;
                case "BOT":
                case 4:
                    m.mediaKeyDomain = 4;
                    break;
                }
                return m;
            };

            DocumentMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                    d.mimetype = m.mimetype;
                    if (o.oneofs)
                        d._mimetype = "mimetype";
                }
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                    if (typeof m.fileLength === "number")
                        d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                    else
                        d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                    if (o.oneofs)
                        d._fileLength = "fileLength";
                }
                if (m.pageCount != null && m.hasOwnProperty("pageCount")) {
                    d.pageCount = m.pageCount;
                    if (o.oneofs)
                        d._pageCount = "pageCount";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.fileName != null && m.hasOwnProperty("fileName")) {
                    d.fileName = m.fileName;
                    if (o.oneofs)
                        d._fileName = "fileName";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.contactVcard != null && m.hasOwnProperty("contactVcard")) {
                    d.contactVcard = m.contactVcard;
                    if (o.oneofs)
                        d._contactVcard = "contactVcard";
                }
                if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) {
                    d.thumbnailDirectPath = m.thumbnailDirectPath;
                    if (o.oneofs)
                        d._thumbnailDirectPath = "thumbnailDirectPath";
                }
                if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) {
                    d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256;
                    if (o.oneofs)
                        d._thumbnailSha256 = "thumbnailSha256";
                }
                if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) {
                    d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256;
                    if (o.oneofs)
                        d._thumbnailEncSha256 = "thumbnailEncSha256";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.thumbnailHeight != null && m.hasOwnProperty("thumbnailHeight")) {
                    d.thumbnailHeight = m.thumbnailHeight;
                    if (o.oneofs)
                        d._thumbnailHeight = "thumbnailHeight";
                }
                if (m.thumbnailWidth != null && m.hasOwnProperty("thumbnailWidth")) {
                    d.thumbnailWidth = m.thumbnailWidth;
                    if (o.oneofs)
                        d._thumbnailWidth = "thumbnailWidth";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) {
                    d.accessibilityLabel = m.accessibilityLabel;
                    if (o.oneofs)
                        d._accessibilityLabel = "accessibilityLabel";
                }
                if (m.mediaKeyDomain != null && m.hasOwnProperty("mediaKeyDomain")) {
                    d.mediaKeyDomain = o.enums === String ? $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] === undefined ? m.mediaKeyDomain : $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] : m.mediaKeyDomain;
                    if (o.oneofs)
                        d._mediaKeyDomain = "mediaKeyDomain";
                }
                return d;
            };

            DocumentMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DocumentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.DocumentMessage";
            };

            return DocumentMessage;
        })();

        Message.EncCommentMessage = (function() {

            function EncCommentMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            EncCommentMessage.prototype.targetMessageKey = null;
            EncCommentMessage.prototype.encPayload = null;
            EncCommentMessage.prototype.encIv = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncCommentMessage.prototype, "_targetMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncCommentMessage.prototype, "_encPayload", {
                get: $util.oneOfGetter($oneOfFields = ["encPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncCommentMessage.prototype, "_encIv", {
                get: $util.oneOfGetter($oneOfFields = ["encIv"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            EncCommentMessage.create = function create(properties) {
                return new EncCommentMessage(properties);
            };

            EncCommentMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.targetMessageKey != null && Object.hasOwnProperty.call(m, "targetMessageKey"))
                    $root.proto.MessageKey.encode(m.targetMessageKey, w.uint32(10).fork()).ldelim();
                if (m.encPayload != null && Object.hasOwnProperty.call(m, "encPayload"))
                    w.uint32(18).bytes(m.encPayload);
                if (m.encIv != null && Object.hasOwnProperty.call(m, "encIv"))
                    w.uint32(26).bytes(m.encIv);
                return w;
            };

            EncCommentMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.EncCommentMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.targetMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.encPayload = r.bytes();
                            break;
                        }
                    case 3: {
                            m.encIv = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            EncCommentMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.EncCommentMessage)
                    return d;
                var m = new $root.proto.Message.EncCommentMessage();
                if (d.targetMessageKey != null) {
                    if (typeof d.targetMessageKey !== "object")
                        throw TypeError(".proto.Message.EncCommentMessage.targetMessageKey: object expected");
                    m.targetMessageKey = $root.proto.MessageKey.fromObject(d.targetMessageKey);
                }
                if (d.encPayload != null) {
                    if (typeof d.encPayload === "string")
                        $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0);
                    else if (d.encPayload.length >= 0)
                        m.encPayload = d.encPayload;
                }
                if (d.encIv != null) {
                    if (typeof d.encIv === "string")
                        $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0);
                    else if (d.encIv.length >= 0)
                        m.encIv = d.encIv;
                }
                return m;
            };

            EncCommentMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) {
                    d.targetMessageKey = $root.proto.MessageKey.toObject(m.targetMessageKey, o);
                    if (o.oneofs)
                        d._targetMessageKey = "targetMessageKey";
                }
                if (m.encPayload != null && m.hasOwnProperty("encPayload")) {
                    d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload;
                    if (o.oneofs)
                        d._encPayload = "encPayload";
                }
                if (m.encIv != null && m.hasOwnProperty("encIv")) {
                    d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv;
                    if (o.oneofs)
                        d._encIv = "encIv";
                }
                return d;
            };

            EncCommentMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            EncCommentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.EncCommentMessage";
            };

            return EncCommentMessage;
        })();

        Message.EncEventResponseMessage = (function() {

            function EncEventResponseMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            EncEventResponseMessage.prototype.eventCreationMessageKey = null;
            EncEventResponseMessage.prototype.encPayload = null;
            EncEventResponseMessage.prototype.encIv = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncEventResponseMessage.prototype, "_eventCreationMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["eventCreationMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncEventResponseMessage.prototype, "_encPayload", {
                get: $util.oneOfGetter($oneOfFields = ["encPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncEventResponseMessage.prototype, "_encIv", {
                get: $util.oneOfGetter($oneOfFields = ["encIv"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            EncEventResponseMessage.create = function create(properties) {
                return new EncEventResponseMessage(properties);
            };

            EncEventResponseMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.eventCreationMessageKey != null && Object.hasOwnProperty.call(m, "eventCreationMessageKey"))
                    $root.proto.MessageKey.encode(m.eventCreationMessageKey, w.uint32(10).fork()).ldelim();
                if (m.encPayload != null && Object.hasOwnProperty.call(m, "encPayload"))
                    w.uint32(18).bytes(m.encPayload);
                if (m.encIv != null && Object.hasOwnProperty.call(m, "encIv"))
                    w.uint32(26).bytes(m.encIv);
                return w;
            };

            EncEventResponseMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.EncEventResponseMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.eventCreationMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.encPayload = r.bytes();
                            break;
                        }
                    case 3: {
                            m.encIv = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            EncEventResponseMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.EncEventResponseMessage)
                    return d;
                var m = new $root.proto.Message.EncEventResponseMessage();
                if (d.eventCreationMessageKey != null) {
                    if (typeof d.eventCreationMessageKey !== "object")
                        throw TypeError(".proto.Message.EncEventResponseMessage.eventCreationMessageKey: object expected");
                    m.eventCreationMessageKey = $root.proto.MessageKey.fromObject(d.eventCreationMessageKey);
                }
                if (d.encPayload != null) {
                    if (typeof d.encPayload === "string")
                        $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0);
                    else if (d.encPayload.length >= 0)
                        m.encPayload = d.encPayload;
                }
                if (d.encIv != null) {
                    if (typeof d.encIv === "string")
                        $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0);
                    else if (d.encIv.length >= 0)
                        m.encIv = d.encIv;
                }
                return m;
            };

            EncEventResponseMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.eventCreationMessageKey != null && m.hasOwnProperty("eventCreationMessageKey")) {
                    d.eventCreationMessageKey = $root.proto.MessageKey.toObject(m.eventCreationMessageKey, o);
                    if (o.oneofs)
                        d._eventCreationMessageKey = "eventCreationMessageKey";
                }
                if (m.encPayload != null && m.hasOwnProperty("encPayload")) {
                    d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload;
                    if (o.oneofs)
                        d._encPayload = "encPayload";
                }
                if (m.encIv != null && m.hasOwnProperty("encIv")) {
                    d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv;
                    if (o.oneofs)
                        d._encIv = "encIv";
                }
                return d;
            };

            EncEventResponseMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            EncEventResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.EncEventResponseMessage";
            };

            return EncEventResponseMessage;
        })();

        Message.EncReactionMessage = (function() {

            function EncReactionMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            EncReactionMessage.prototype.targetMessageKey = null;
            EncReactionMessage.prototype.encPayload = null;
            EncReactionMessage.prototype.encIv = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncReactionMessage.prototype, "_targetMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncReactionMessage.prototype, "_encPayload", {
                get: $util.oneOfGetter($oneOfFields = ["encPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EncReactionMessage.prototype, "_encIv", {
                get: $util.oneOfGetter($oneOfFields = ["encIv"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            EncReactionMessage.create = function create(properties) {
                return new EncReactionMessage(properties);
            };

            EncReactionMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.targetMessageKey != null && Object.hasOwnProperty.call(m, "targetMessageKey"))
                    $root.proto.MessageKey.encode(m.targetMessageKey, w.uint32(10).fork()).ldelim();
                if (m.encPayload != null && Object.hasOwnProperty.call(m, "encPayload"))
                    w.uint32(18).bytes(m.encPayload);
                if (m.encIv != null && Object.hasOwnProperty.call(m, "encIv"))
                    w.uint32(26).bytes(m.encIv);
                return w;
            };

            EncReactionMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.EncReactionMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.targetMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.encPayload = r.bytes();
                            break;
                        }
                    case 3: {
                            m.encIv = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            EncReactionMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.EncReactionMessage)
                    return d;
                var m = new $root.proto.Message.EncReactionMessage();
                if (d.targetMessageKey != null) {
                    if (typeof d.targetMessageKey !== "object")
                        throw TypeError(".proto.Message.EncReactionMessage.targetMessageKey: object expected");
                    m.targetMessageKey = $root.proto.MessageKey.fromObject(d.targetMessageKey);
                }
                if (d.encPayload != null) {
                    if (typeof d.encPayload === "string")
                        $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0);
                    else if (d.encPayload.length >= 0)
                        m.encPayload = d.encPayload;
                }
                if (d.encIv != null) {
                    if (typeof d.encIv === "string")
                        $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0);
                    else if (d.encIv.length >= 0)
                        m.encIv = d.encIv;
                }
                return m;
            };

            EncReactionMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) {
                    d.targetMessageKey = $root.proto.MessageKey.toObject(m.targetMessageKey, o);
                    if (o.oneofs)
                        d._targetMessageKey = "targetMessageKey";
                }
                if (m.encPayload != null && m.hasOwnProperty("encPayload")) {
                    d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload;
                    if (o.oneofs)
                        d._encPayload = "encPayload";
                }
                if (m.encIv != null && m.hasOwnProperty("encIv")) {
                    d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv;
                    if (o.oneofs)
                        d._encIv = "encIv";
                }
                return d;
            };

            EncReactionMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            EncReactionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.EncReactionMessage";
            };

            return EncReactionMessage;
        })();

        Message.EventMessage = (function() {

            function EventMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            EventMessage.prototype.contextInfo = null;
            EventMessage.prototype.isCanceled = null;
            EventMessage.prototype.name = null;
            EventMessage.prototype.description = null;
            EventMessage.prototype.location = null;
            EventMessage.prototype.joinLink = null;
            EventMessage.prototype.startTime = null;
            EventMessage.prototype.endTime = null;
            EventMessage.prototype.extraGuestsAllowed = null;
            EventMessage.prototype.isScheduleCall = null;
            EventMessage.prototype.hasReminder = null;
            EventMessage.prototype.reminderOffsetSec = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_isCanceled", {
                get: $util.oneOfGetter($oneOfFields = ["isCanceled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_description", {
                get: $util.oneOfGetter($oneOfFields = ["description"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_location", {
                get: $util.oneOfGetter($oneOfFields = ["location"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_joinLink", {
                get: $util.oneOfGetter($oneOfFields = ["joinLink"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_startTime", {
                get: $util.oneOfGetter($oneOfFields = ["startTime"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_endTime", {
                get: $util.oneOfGetter($oneOfFields = ["endTime"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_extraGuestsAllowed", {
                get: $util.oneOfGetter($oneOfFields = ["extraGuestsAllowed"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_isScheduleCall", {
                get: $util.oneOfGetter($oneOfFields = ["isScheduleCall"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_hasReminder", {
                get: $util.oneOfGetter($oneOfFields = ["hasReminder"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventMessage.prototype, "_reminderOffsetSec", {
                get: $util.oneOfGetter($oneOfFields = ["reminderOffsetSec"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            EventMessage.create = function create(properties) {
                return new EventMessage(properties);
            };

            EventMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(10).fork()).ldelim();
                if (m.isCanceled != null && Object.hasOwnProperty.call(m, "isCanceled"))
                    w.uint32(16).bool(m.isCanceled);
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(26).string(m.name);
                if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                    w.uint32(34).string(m.description);
                if (m.location != null && Object.hasOwnProperty.call(m, "location"))
                    $root.proto.Message.LocationMessage.encode(m.location, w.uint32(42).fork()).ldelim();
                if (m.joinLink != null && Object.hasOwnProperty.call(m, "joinLink"))
                    w.uint32(50).string(m.joinLink);
                if (m.startTime != null && Object.hasOwnProperty.call(m, "startTime"))
                    w.uint32(56).int64(m.startTime);
                if (m.endTime != null && Object.hasOwnProperty.call(m, "endTime"))
                    w.uint32(64).int64(m.endTime);
                if (m.extraGuestsAllowed != null && Object.hasOwnProperty.call(m, "extraGuestsAllowed"))
                    w.uint32(72).bool(m.extraGuestsAllowed);
                if (m.isScheduleCall != null && Object.hasOwnProperty.call(m, "isScheduleCall"))
                    w.uint32(80).bool(m.isScheduleCall);
                if (m.hasReminder != null && Object.hasOwnProperty.call(m, "hasReminder"))
                    w.uint32(88).bool(m.hasReminder);
                if (m.reminderOffsetSec != null && Object.hasOwnProperty.call(m, "reminderOffsetSec"))
                    w.uint32(96).int64(m.reminderOffsetSec);
                return w;
            };

            EventMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.EventMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.isCanceled = r.bool();
                            break;
                        }
                    case 3: {
                            m.name = r.string();
                            break;
                        }
                    case 4: {
                            m.description = r.string();
                            break;
                        }
                    case 5: {
                            m.location = $root.proto.Message.LocationMessage.decode(r, r.uint32());
                            break;
                        }
                    case 6: {
                            m.joinLink = r.string();
                            break;
                        }
                    case 7: {
                            m.startTime = r.int64();
                            break;
                        }
                    case 8: {
                            m.endTime = r.int64();
                            break;
                        }
                    case 9: {
                            m.extraGuestsAllowed = r.bool();
                            break;
                        }
                    case 10: {
                            m.isScheduleCall = r.bool();
                            break;
                        }
                    case 11: {
                            m.hasReminder = r.bool();
                            break;
                        }
                    case 12: {
                            m.reminderOffsetSec = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            EventMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.EventMessage)
                    return d;
                var m = new $root.proto.Message.EventMessage();
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.EventMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.isCanceled != null) {
                    m.isCanceled = Boolean(d.isCanceled);
                }
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.description != null) {
                    m.description = String(d.description);
                }
                if (d.location != null) {
                    if (typeof d.location !== "object")
                        throw TypeError(".proto.Message.EventMessage.location: object expected");
                    m.location = $root.proto.Message.LocationMessage.fromObject(d.location);
                }
                if (d.joinLink != null) {
                    m.joinLink = String(d.joinLink);
                }
                if (d.startTime != null) {
                    if ($util.Long)
                        (m.startTime = $util.Long.fromValue(d.startTime)).unsigned = false;
                    else if (typeof d.startTime === "string")
                        m.startTime = parseInt(d.startTime, 10);
                    else if (typeof d.startTime === "number")
                        m.startTime = d.startTime;
                    else if (typeof d.startTime === "object")
                        m.startTime = new $util.LongBits(d.startTime.low >>> 0, d.startTime.high >>> 0).toNumber();
                }
                if (d.endTime != null) {
                    if ($util.Long)
                        (m.endTime = $util.Long.fromValue(d.endTime)).unsigned = false;
                    else if (typeof d.endTime === "string")
                        m.endTime = parseInt(d.endTime, 10);
                    else if (typeof d.endTime === "number")
                        m.endTime = d.endTime;
                    else if (typeof d.endTime === "object")
                        m.endTime = new $util.LongBits(d.endTime.low >>> 0, d.endTime.high >>> 0).toNumber();
                }
                if (d.extraGuestsAllowed != null) {
                    m.extraGuestsAllowed = Boolean(d.extraGuestsAllowed);
                }
                if (d.isScheduleCall != null) {
                    m.isScheduleCall = Boolean(d.isScheduleCall);
                }
                if (d.hasReminder != null) {
                    m.hasReminder = Boolean(d.hasReminder);
                }
                if (d.reminderOffsetSec != null) {
                    if ($util.Long)
                        (m.reminderOffsetSec = $util.Long.fromValue(d.reminderOffsetSec)).unsigned = false;
                    else if (typeof d.reminderOffsetSec === "string")
                        m.reminderOffsetSec = parseInt(d.reminderOffsetSec, 10);
                    else if (typeof d.reminderOffsetSec === "number")
                        m.reminderOffsetSec = d.reminderOffsetSec;
                    else if (typeof d.reminderOffsetSec === "object")
                        m.reminderOffsetSec = new $util.LongBits(d.reminderOffsetSec.low >>> 0, d.reminderOffsetSec.high >>> 0).toNumber();
                }
                return m;
            };

            EventMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.isCanceled != null && m.hasOwnProperty("isCanceled")) {
                    d.isCanceled = m.isCanceled;
                    if (o.oneofs)
                        d._isCanceled = "isCanceled";
                }
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.description != null && m.hasOwnProperty("description")) {
                    d.description = m.description;
                    if (o.oneofs)
                        d._description = "description";
                }
                if (m.location != null && m.hasOwnProperty("location")) {
                    d.location = $root.proto.Message.LocationMessage.toObject(m.location, o);
                    if (o.oneofs)
                        d._location = "location";
                }
                if (m.joinLink != null && m.hasOwnProperty("joinLink")) {
                    d.joinLink = m.joinLink;
                    if (o.oneofs)
                        d._joinLink = "joinLink";
                }
                if (m.startTime != null && m.hasOwnProperty("startTime")) {
                    if (typeof m.startTime === "number")
                        d.startTime = o.longs === String ? String(m.startTime) : m.startTime;
                    else
                        d.startTime = o.longs === String ? longToString(m.startTime) : o.longs === Number ? longToNumber(m.startTime) : m.startTime;
                    if (o.oneofs)
                        d._startTime = "startTime";
                }
                if (m.endTime != null && m.hasOwnProperty("endTime")) {
                    if (typeof m.endTime === "number")
                        d.endTime = o.longs === String ? String(m.endTime) : m.endTime;
                    else
                        d.endTime = o.longs === String ? longToString(m.endTime) : o.longs === Number ? longToNumber(m.endTime) : m.endTime;
                    if (o.oneofs)
                        d._endTime = "endTime";
                }
                if (m.extraGuestsAllowed != null && m.hasOwnProperty("extraGuestsAllowed")) {
                    d.extraGuestsAllowed = m.extraGuestsAllowed;
                    if (o.oneofs)
                        d._extraGuestsAllowed = "extraGuestsAllowed";
                }
                if (m.isScheduleCall != null && m.hasOwnProperty("isScheduleCall")) {
                    d.isScheduleCall = m.isScheduleCall;
                    if (o.oneofs)
                        d._isScheduleCall = "isScheduleCall";
                }
                if (m.hasReminder != null && m.hasOwnProperty("hasReminder")) {
                    d.hasReminder = m.hasReminder;
                    if (o.oneofs)
                        d._hasReminder = "hasReminder";
                }
                if (m.reminderOffsetSec != null && m.hasOwnProperty("reminderOffsetSec")) {
                    if (typeof m.reminderOffsetSec === "number")
                        d.reminderOffsetSec = o.longs === String ? String(m.reminderOffsetSec) : m.reminderOffsetSec;
                    else
                        d.reminderOffsetSec = o.longs === String ? longToString(m.reminderOffsetSec) : o.longs === Number ? longToNumber(m.reminderOffsetSec) : m.reminderOffsetSec;
                    if (o.oneofs)
                        d._reminderOffsetSec = "reminderOffsetSec";
                }
                return d;
            };

            EventMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            EventMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.EventMessage";
            };

            return EventMessage;
        })();

        Message.EventResponseMessage = (function() {

            function EventResponseMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            EventResponseMessage.prototype.response = null;
            EventResponseMessage.prototype.timestampMs = null;
            EventResponseMessage.prototype.extraGuestCount = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventResponseMessage.prototype, "_response", {
                get: $util.oneOfGetter($oneOfFields = ["response"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventResponseMessage.prototype, "_timestampMs", {
                get: $util.oneOfGetter($oneOfFields = ["timestampMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventResponseMessage.prototype, "_extraGuestCount", {
                get: $util.oneOfGetter($oneOfFields = ["extraGuestCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            EventResponseMessage.create = function create(properties) {
                return new EventResponseMessage(properties);
            };

            EventResponseMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.response != null && Object.hasOwnProperty.call(m, "response"))
                    w.uint32(8).int32(m.response);
                if (m.timestampMs != null && Object.hasOwnProperty.call(m, "timestampMs"))
                    w.uint32(16).int64(m.timestampMs);
                if (m.extraGuestCount != null && Object.hasOwnProperty.call(m, "extraGuestCount"))
                    w.uint32(24).int32(m.extraGuestCount);
                return w;
            };

            EventResponseMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.EventResponseMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.response = r.int32();
                            break;
                        }
                    case 2: {
                            m.timestampMs = r.int64();
                            break;
                        }
                    case 3: {
                            m.extraGuestCount = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            EventResponseMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.EventResponseMessage)
                    return d;
                var m = new $root.proto.Message.EventResponseMessage();
                switch (d.response) {
                default:
                    if (typeof d.response === "number") {
                        m.response = d.response;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.response = 0;
                    break;
                case "GOING":
                case 1:
                    m.response = 1;
                    break;
                case "NOT_GOING":
                case 2:
                    m.response = 2;
                    break;
                case "MAYBE":
                case 3:
                    m.response = 3;
                    break;
                }
                if (d.timestampMs != null) {
                    if ($util.Long)
                        (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false;
                    else if (typeof d.timestampMs === "string")
                        m.timestampMs = parseInt(d.timestampMs, 10);
                    else if (typeof d.timestampMs === "number")
                        m.timestampMs = d.timestampMs;
                    else if (typeof d.timestampMs === "object")
                        m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber();
                }
                if (d.extraGuestCount != null) {
                    m.extraGuestCount = d.extraGuestCount | 0;
                }
                return m;
            };

            EventResponseMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.response != null && m.hasOwnProperty("response")) {
                    d.response = o.enums === String ? $root.proto.Message.EventResponseMessage.EventResponseType[m.response] === undefined ? m.response : $root.proto.Message.EventResponseMessage.EventResponseType[m.response] : m.response;
                    if (o.oneofs)
                        d._response = "response";
                }
                if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) {
                    if (typeof m.timestampMs === "number")
                        d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs;
                    else
                        d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs;
                    if (o.oneofs)
                        d._timestampMs = "timestampMs";
                }
                if (m.extraGuestCount != null && m.hasOwnProperty("extraGuestCount")) {
                    d.extraGuestCount = m.extraGuestCount;
                    if (o.oneofs)
                        d._extraGuestCount = "extraGuestCount";
                }
                return d;
            };

            EventResponseMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            EventResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.EventResponseMessage";
            };

            EventResponseMessage.EventResponseType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "GOING"] = 1;
                values[valuesById[2] = "NOT_GOING"] = 2;
                values[valuesById[3] = "MAYBE"] = 3;
                return values;
            })();

            return EventResponseMessage;
        })();

        Message.ExtendedTextMessage = (function() {

            function ExtendedTextMessage(p) {
                this.endCardTiles = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ExtendedTextMessage.prototype.text = null;
            ExtendedTextMessage.prototype.matchedText = null;
            ExtendedTextMessage.prototype.description = null;
            ExtendedTextMessage.prototype.title = null;
            ExtendedTextMessage.prototype.textArgb = null;
            ExtendedTextMessage.prototype.backgroundArgb = null;
            ExtendedTextMessage.prototype.font = null;
            ExtendedTextMessage.prototype.previewType = null;
            ExtendedTextMessage.prototype.jpegThumbnail = null;
            ExtendedTextMessage.prototype.contextInfo = null;
            ExtendedTextMessage.prototype.doNotPlayInline = null;
            ExtendedTextMessage.prototype.thumbnailDirectPath = null;
            ExtendedTextMessage.prototype.thumbnailSha256 = null;
            ExtendedTextMessage.prototype.thumbnailEncSha256 = null;
            ExtendedTextMessage.prototype.mediaKey = null;
            ExtendedTextMessage.prototype.mediaKeyTimestamp = null;
            ExtendedTextMessage.prototype.thumbnailHeight = null;
            ExtendedTextMessage.prototype.thumbnailWidth = null;
            ExtendedTextMessage.prototype.inviteLinkGroupType = null;
            ExtendedTextMessage.prototype.inviteLinkParentGroupSubjectV2 = null;
            ExtendedTextMessage.prototype.inviteLinkParentGroupThumbnailV2 = null;
            ExtendedTextMessage.prototype.inviteLinkGroupTypeV2 = null;
            ExtendedTextMessage.prototype.viewOnce = null;
            ExtendedTextMessage.prototype.videoHeight = null;
            ExtendedTextMessage.prototype.videoWidth = null;
            ExtendedTextMessage.prototype.faviconMMSMetadata = null;
            ExtendedTextMessage.prototype.linkPreviewMetadata = null;
            ExtendedTextMessage.prototype.paymentLinkMetadata = null;
            ExtendedTextMessage.prototype.endCardTiles = $util.emptyArray;
            ExtendedTextMessage.prototype.videoContentUrl = null;
            ExtendedTextMessage.prototype.musicMetadata = null;
            ExtendedTextMessage.prototype.paymentExtendedMetadata = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_text", {
                get: $util.oneOfGetter($oneOfFields = ["text"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_matchedText", {
                get: $util.oneOfGetter($oneOfFields = ["matchedText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_description", {
                get: $util.oneOfGetter($oneOfFields = ["description"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_textArgb", {
                get: $util.oneOfGetter($oneOfFields = ["textArgb"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_backgroundArgb", {
                get: $util.oneOfGetter($oneOfFields = ["backgroundArgb"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_font", {
                get: $util.oneOfGetter($oneOfFields = ["font"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_previewType", {
                get: $util.oneOfGetter($oneOfFields = ["previewType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_doNotPlayInline", {
                get: $util.oneOfGetter($oneOfFields = ["doNotPlayInline"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailDirectPath", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailHeight", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailHeight"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailWidth", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailWidth"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_inviteLinkGroupType", {
                get: $util.oneOfGetter($oneOfFields = ["inviteLinkGroupType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_inviteLinkParentGroupSubjectV2", {
                get: $util.oneOfGetter($oneOfFields = ["inviteLinkParentGroupSubjectV2"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_inviteLinkParentGroupThumbnailV2", {
                get: $util.oneOfGetter($oneOfFields = ["inviteLinkParentGroupThumbnailV2"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_inviteLinkGroupTypeV2", {
                get: $util.oneOfGetter($oneOfFields = ["inviteLinkGroupTypeV2"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_viewOnce", {
                get: $util.oneOfGetter($oneOfFields = ["viewOnce"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_videoHeight", {
                get: $util.oneOfGetter($oneOfFields = ["videoHeight"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_videoWidth", {
                get: $util.oneOfGetter($oneOfFields = ["videoWidth"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_faviconMMSMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["faviconMMSMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_linkPreviewMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["linkPreviewMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_paymentLinkMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["paymentLinkMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_videoContentUrl", {
                get: $util.oneOfGetter($oneOfFields = ["videoContentUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_musicMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["musicMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExtendedTextMessage.prototype, "_paymentExtendedMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["paymentExtendedMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ExtendedTextMessage.create = function create(properties) {
                return new ExtendedTextMessage(properties);
            };

            ExtendedTextMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                    w.uint32(10).string(m.text);
                if (m.matchedText != null && Object.hasOwnProperty.call(m, "matchedText"))
                    w.uint32(18).string(m.matchedText);
                if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                    w.uint32(42).string(m.description);
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(50).string(m.title);
                if (m.textArgb != null && Object.hasOwnProperty.call(m, "textArgb"))
                    w.uint32(61).fixed32(m.textArgb);
                if (m.backgroundArgb != null && Object.hasOwnProperty.call(m, "backgroundArgb"))
                    w.uint32(69).fixed32(m.backgroundArgb);
                if (m.font != null && Object.hasOwnProperty.call(m, "font"))
                    w.uint32(72).int32(m.font);
                if (m.previewType != null && Object.hasOwnProperty.call(m, "previewType"))
                    w.uint32(80).int32(m.previewType);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(130).bytes(m.jpegThumbnail);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                if (m.doNotPlayInline != null && Object.hasOwnProperty.call(m, "doNotPlayInline"))
                    w.uint32(144).bool(m.doNotPlayInline);
                if (m.thumbnailDirectPath != null && Object.hasOwnProperty.call(m, "thumbnailDirectPath"))
                    w.uint32(154).string(m.thumbnailDirectPath);
                if (m.thumbnailSha256 != null && Object.hasOwnProperty.call(m, "thumbnailSha256"))
                    w.uint32(162).bytes(m.thumbnailSha256);
                if (m.thumbnailEncSha256 != null && Object.hasOwnProperty.call(m, "thumbnailEncSha256"))
                    w.uint32(170).bytes(m.thumbnailEncSha256);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(178).bytes(m.mediaKey);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(184).int64(m.mediaKeyTimestamp);
                if (m.thumbnailHeight != null && Object.hasOwnProperty.call(m, "thumbnailHeight"))
                    w.uint32(192).uint32(m.thumbnailHeight);
                if (m.thumbnailWidth != null && Object.hasOwnProperty.call(m, "thumbnailWidth"))
                    w.uint32(200).uint32(m.thumbnailWidth);
                if (m.inviteLinkGroupType != null && Object.hasOwnProperty.call(m, "inviteLinkGroupType"))
                    w.uint32(208).int32(m.inviteLinkGroupType);
                if (m.inviteLinkParentGroupSubjectV2 != null && Object.hasOwnProperty.call(m, "inviteLinkParentGroupSubjectV2"))
                    w.uint32(218).string(m.inviteLinkParentGroupSubjectV2);
                if (m.inviteLinkParentGroupThumbnailV2 != null && Object.hasOwnProperty.call(m, "inviteLinkParentGroupThumbnailV2"))
                    w.uint32(226).bytes(m.inviteLinkParentGroupThumbnailV2);
                if (m.inviteLinkGroupTypeV2 != null && Object.hasOwnProperty.call(m, "inviteLinkGroupTypeV2"))
                    w.uint32(232).int32(m.inviteLinkGroupTypeV2);
                if (m.viewOnce != null && Object.hasOwnProperty.call(m, "viewOnce"))
                    w.uint32(240).bool(m.viewOnce);
                if (m.videoHeight != null && Object.hasOwnProperty.call(m, "videoHeight"))
                    w.uint32(248).uint32(m.videoHeight);
                if (m.videoWidth != null && Object.hasOwnProperty.call(m, "videoWidth"))
                    w.uint32(256).uint32(m.videoWidth);
                if (m.faviconMMSMetadata != null && Object.hasOwnProperty.call(m, "faviconMMSMetadata"))
                    $root.proto.Message.MMSThumbnailMetadata.encode(m.faviconMMSMetadata, w.uint32(266).fork()).ldelim();
                if (m.linkPreviewMetadata != null && Object.hasOwnProperty.call(m, "linkPreviewMetadata"))
                    $root.proto.Message.LinkPreviewMetadata.encode(m.linkPreviewMetadata, w.uint32(274).fork()).ldelim();
                if (m.paymentLinkMetadata != null && Object.hasOwnProperty.call(m, "paymentLinkMetadata"))
                    $root.proto.Message.PaymentLinkMetadata.encode(m.paymentLinkMetadata, w.uint32(282).fork()).ldelim();
                if (m.endCardTiles != null && m.endCardTiles.length) {
                    for (var i = 0; i < m.endCardTiles.length; ++i)
                        $root.proto.Message.VideoEndCard.encode(m.endCardTiles[i], w.uint32(290).fork()).ldelim();
                }
                if (m.videoContentUrl != null && Object.hasOwnProperty.call(m, "videoContentUrl"))
                    w.uint32(298).string(m.videoContentUrl);
                if (m.musicMetadata != null && Object.hasOwnProperty.call(m, "musicMetadata"))
                    $root.proto.EmbeddedMusic.encode(m.musicMetadata, w.uint32(306).fork()).ldelim();
                if (m.paymentExtendedMetadata != null && Object.hasOwnProperty.call(m, "paymentExtendedMetadata"))
                    $root.proto.Message.PaymentExtendedMetadata.encode(m.paymentExtendedMetadata, w.uint32(314).fork()).ldelim();
                return w;
            };

            ExtendedTextMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ExtendedTextMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.text = r.string();
                            break;
                        }
                    case 2: {
                            m.matchedText = r.string();
                            break;
                        }
                    case 5: {
                            m.description = r.string();
                            break;
                        }
                    case 6: {
                            m.title = r.string();
                            break;
                        }
                    case 7: {
                            m.textArgb = r.fixed32();
                            break;
                        }
                    case 8: {
                            m.backgroundArgb = r.fixed32();
                            break;
                        }
                    case 9: {
                            m.font = r.int32();
                            break;
                        }
                    case 10: {
                            m.previewType = r.int32();
                            break;
                        }
                    case 16: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 18: {
                            m.doNotPlayInline = r.bool();
                            break;
                        }
                    case 19: {
                            m.thumbnailDirectPath = r.string();
                            break;
                        }
                    case 20: {
                            m.thumbnailSha256 = r.bytes();
                            break;
                        }
                    case 21: {
                            m.thumbnailEncSha256 = r.bytes();
                            break;
                        }
                    case 22: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 23: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 24: {
                            m.thumbnailHeight = r.uint32();
                            break;
                        }
                    case 25: {
                            m.thumbnailWidth = r.uint32();
                            break;
                        }
                    case 26: {
                            m.inviteLinkGroupType = r.int32();
                            break;
                        }
                    case 27: {
                            m.inviteLinkParentGroupSubjectV2 = r.string();
                            break;
                        }
                    case 28: {
                            m.inviteLinkParentGroupThumbnailV2 = r.bytes();
                            break;
                        }
                    case 29: {
                            m.inviteLinkGroupTypeV2 = r.int32();
                            break;
                        }
                    case 30: {
                            m.viewOnce = r.bool();
                            break;
                        }
                    case 31: {
                            m.videoHeight = r.uint32();
                            break;
                        }
                    case 32: {
                            m.videoWidth = r.uint32();
                            break;
                        }
                    case 33: {
                            m.faviconMMSMetadata = $root.proto.Message.MMSThumbnailMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 34: {
                            m.linkPreviewMetadata = $root.proto.Message.LinkPreviewMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 35: {
                            m.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 36: {
                            if (!(m.endCardTiles && m.endCardTiles.length))
                                m.endCardTiles = [];
                            m.endCardTiles.push($root.proto.Message.VideoEndCard.decode(r, r.uint32()));
                            break;
                        }
                    case 37: {
                            m.videoContentUrl = r.string();
                            break;
                        }
                    case 38: {
                            m.musicMetadata = $root.proto.EmbeddedMusic.decode(r, r.uint32());
                            break;
                        }
                    case 39: {
                            m.paymentExtendedMetadata = $root.proto.Message.PaymentExtendedMetadata.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ExtendedTextMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ExtendedTextMessage)
                    return d;
                var m = new $root.proto.Message.ExtendedTextMessage();
                if (d.text != null) {
                    m.text = String(d.text);
                }
                if (d.matchedText != null) {
                    m.matchedText = String(d.matchedText);
                }
                if (d.description != null) {
                    m.description = String(d.description);
                }
                if (d.title != null) {
                    m.title = String(d.title);
                }
                if (d.textArgb != null) {
                    m.textArgb = d.textArgb >>> 0;
                }
                if (d.backgroundArgb != null) {
                    m.backgroundArgb = d.backgroundArgb >>> 0;
                }
                switch (d.font) {
                default:
                    if (typeof d.font === "number") {
                        m.font = d.font;
                        break;
                    }
                    break;
                case "SYSTEM":
                case 0:
                    m.font = 0;
                    break;
                case "SYSTEM_TEXT":
                case 1:
                    m.font = 1;
                    break;
                case "FB_SCRIPT":
                case 2:
                    m.font = 2;
                    break;
                case "SYSTEM_BOLD":
                case 6:
                    m.font = 6;
                    break;
                case "MORNINGBREEZE_REGULAR":
                case 7:
                    m.font = 7;
                    break;
                case "CALISTOGA_REGULAR":
                case 8:
                    m.font = 8;
                    break;
                case "EXO2_EXTRABOLD":
                case 9:
                    m.font = 9;
                    break;
                case "COURIERPRIME_BOLD":
                case 10:
                    m.font = 10;
                    break;
                }
                switch (d.previewType) {
                default:
                    if (typeof d.previewType === "number") {
                        m.previewType = d.previewType;
                        break;
                    }
                    break;
                case "NONE":
                case 0:
                    m.previewType = 0;
                    break;
                case "VIDEO":
                case 1:
                    m.previewType = 1;
                    break;
                case "PLACEHOLDER":
                case 4:
                    m.previewType = 4;
                    break;
                case "IMAGE":
                case 5:
                    m.previewType = 5;
                    break;
                case "PAYMENT_LINKS":
                case 6:
                    m.previewType = 6;
                    break;
                case "PROFILE":
                case 7:
                    m.previewType = 7;
                    break;
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ExtendedTextMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.doNotPlayInline != null) {
                    m.doNotPlayInline = Boolean(d.doNotPlayInline);
                }
                if (d.thumbnailDirectPath != null) {
                    m.thumbnailDirectPath = String(d.thumbnailDirectPath);
                }
                if (d.thumbnailSha256 != null) {
                    if (typeof d.thumbnailSha256 === "string")
                        $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0);
                    else if (d.thumbnailSha256.length >= 0)
                        m.thumbnailSha256 = d.thumbnailSha256;
                }
                if (d.thumbnailEncSha256 != null) {
                    if (typeof d.thumbnailEncSha256 === "string")
                        $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0);
                    else if (d.thumbnailEncSha256.length >= 0)
                        m.thumbnailEncSha256 = d.thumbnailEncSha256;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.thumbnailHeight != null) {
                    m.thumbnailHeight = d.thumbnailHeight >>> 0;
                }
                if (d.thumbnailWidth != null) {
                    m.thumbnailWidth = d.thumbnailWidth >>> 0;
                }
                switch (d.inviteLinkGroupType) {
                default:
                    if (typeof d.inviteLinkGroupType === "number") {
                        m.inviteLinkGroupType = d.inviteLinkGroupType;
                        break;
                    }
                    break;
                case "DEFAULT":
                case 0:
                    m.inviteLinkGroupType = 0;
                    break;
                case "PARENT":
                case 1:
                    m.inviteLinkGroupType = 1;
                    break;
                case "SUB":
                case 2:
                    m.inviteLinkGroupType = 2;
                    break;
                case "DEFAULT_SUB":
                case 3:
                    m.inviteLinkGroupType = 3;
                    break;
                }
                if (d.inviteLinkParentGroupSubjectV2 != null) {
                    m.inviteLinkParentGroupSubjectV2 = String(d.inviteLinkParentGroupSubjectV2);
                }
                if (d.inviteLinkParentGroupThumbnailV2 != null) {
                    if (typeof d.inviteLinkParentGroupThumbnailV2 === "string")
                        $util.base64.decode(d.inviteLinkParentGroupThumbnailV2, m.inviteLinkParentGroupThumbnailV2 = $util.newBuffer($util.base64.length(d.inviteLinkParentGroupThumbnailV2)), 0);
                    else if (d.inviteLinkParentGroupThumbnailV2.length >= 0)
                        m.inviteLinkParentGroupThumbnailV2 = d.inviteLinkParentGroupThumbnailV2;
                }
                switch (d.inviteLinkGroupTypeV2) {
                default:
                    if (typeof d.inviteLinkGroupTypeV2 === "number") {
                        m.inviteLinkGroupTypeV2 = d.inviteLinkGroupTypeV2;
                        break;
                    }
                    break;
                case "DEFAULT":
                case 0:
                    m.inviteLinkGroupTypeV2 = 0;
                    break;
                case "PARENT":
                case 1:
                    m.inviteLinkGroupTypeV2 = 1;
                    break;
                case "SUB":
                case 2:
                    m.inviteLinkGroupTypeV2 = 2;
                    break;
                case "DEFAULT_SUB":
                case 3:
                    m.inviteLinkGroupTypeV2 = 3;
                    break;
                }
                if (d.viewOnce != null) {
                    m.viewOnce = Boolean(d.viewOnce);
                }
                if (d.videoHeight != null) {
                    m.videoHeight = d.videoHeight >>> 0;
                }
                if (d.videoWidth != null) {
                    m.videoWidth = d.videoWidth >>> 0;
                }
                if (d.faviconMMSMetadata != null) {
                    if (typeof d.faviconMMSMetadata !== "object")
                        throw TypeError(".proto.Message.ExtendedTextMessage.faviconMMSMetadata: object expected");
                    m.faviconMMSMetadata = $root.proto.Message.MMSThumbnailMetadata.fromObject(d.faviconMMSMetadata);
                }
                if (d.linkPreviewMetadata != null) {
                    if (typeof d.linkPreviewMetadata !== "object")
                        throw TypeError(".proto.Message.ExtendedTextMessage.linkPreviewMetadata: object expected");
                    m.linkPreviewMetadata = $root.proto.Message.LinkPreviewMetadata.fromObject(d.linkPreviewMetadata);
                }
                if (d.paymentLinkMetadata != null) {
                    if (typeof d.paymentLinkMetadata !== "object")
                        throw TypeError(".proto.Message.ExtendedTextMessage.paymentLinkMetadata: object expected");
                    m.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.fromObject(d.paymentLinkMetadata);
                }
                if (d.endCardTiles) {
                    if (!Array.isArray(d.endCardTiles))
                        throw TypeError(".proto.Message.ExtendedTextMessage.endCardTiles: array expected");
                    m.endCardTiles = [];
                    for (var i = 0; i < d.endCardTiles.length; ++i) {
                        if (typeof d.endCardTiles[i] !== "object")
                            throw TypeError(".proto.Message.ExtendedTextMessage.endCardTiles: object expected");
                        m.endCardTiles[i] = $root.proto.Message.VideoEndCard.fromObject(d.endCardTiles[i]);
                    }
                }
                if (d.videoContentUrl != null) {
                    m.videoContentUrl = String(d.videoContentUrl);
                }
                if (d.musicMetadata != null) {
                    if (typeof d.musicMetadata !== "object")
                        throw TypeError(".proto.Message.ExtendedTextMessage.musicMetadata: object expected");
                    m.musicMetadata = $root.proto.EmbeddedMusic.fromObject(d.musicMetadata);
                }
                if (d.paymentExtendedMetadata != null) {
                    if (typeof d.paymentExtendedMetadata !== "object")
                        throw TypeError(".proto.Message.ExtendedTextMessage.paymentExtendedMetadata: object expected");
                    m.paymentExtendedMetadata = $root.proto.Message.PaymentExtendedMetadata.fromObject(d.paymentExtendedMetadata);
                }
                return m;
            };

            ExtendedTextMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.endCardTiles = [];
                }
                if (m.text != null && m.hasOwnProperty("text")) {
                    d.text = m.text;
                    if (o.oneofs)
                        d._text = "text";
                }
                if (m.matchedText != null && m.hasOwnProperty("matchedText")) {
                    d.matchedText = m.matchedText;
                    if (o.oneofs)
                        d._matchedText = "matchedText";
                }
                if (m.description != null && m.hasOwnProperty("description")) {
                    d.description = m.description;
                    if (o.oneofs)
                        d._description = "description";
                }
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.textArgb != null && m.hasOwnProperty("textArgb")) {
                    d.textArgb = m.textArgb;
                    if (o.oneofs)
                        d._textArgb = "textArgb";
                }
                if (m.backgroundArgb != null && m.hasOwnProperty("backgroundArgb")) {
                    d.backgroundArgb = m.backgroundArgb;
                    if (o.oneofs)
                        d._backgroundArgb = "backgroundArgb";
                }
                if (m.font != null && m.hasOwnProperty("font")) {
                    d.font = o.enums === String ? $root.proto.Message.ExtendedTextMessage.FontType[m.font] === undefined ? m.font : $root.proto.Message.ExtendedTextMessage.FontType[m.font] : m.font;
                    if (o.oneofs)
                        d._font = "font";
                }
                if (m.previewType != null && m.hasOwnProperty("previewType")) {
                    d.previewType = o.enums === String ? $root.proto.Message.ExtendedTextMessage.PreviewType[m.previewType] === undefined ? m.previewType : $root.proto.Message.ExtendedTextMessage.PreviewType[m.previewType] : m.previewType;
                    if (o.oneofs)
                        d._previewType = "previewType";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.doNotPlayInline != null && m.hasOwnProperty("doNotPlayInline")) {
                    d.doNotPlayInline = m.doNotPlayInline;
                    if (o.oneofs)
                        d._doNotPlayInline = "doNotPlayInline";
                }
                if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) {
                    d.thumbnailDirectPath = m.thumbnailDirectPath;
                    if (o.oneofs)
                        d._thumbnailDirectPath = "thumbnailDirectPath";
                }
                if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) {
                    d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256;
                    if (o.oneofs)
                        d._thumbnailSha256 = "thumbnailSha256";
                }
                if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) {
                    d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256;
                    if (o.oneofs)
                        d._thumbnailEncSha256 = "thumbnailEncSha256";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.thumbnailHeight != null && m.hasOwnProperty("thumbnailHeight")) {
                    d.thumbnailHeight = m.thumbnailHeight;
                    if (o.oneofs)
                        d._thumbnailHeight = "thumbnailHeight";
                }
                if (m.thumbnailWidth != null && m.hasOwnProperty("thumbnailWidth")) {
                    d.thumbnailWidth = m.thumbnailWidth;
                    if (o.oneofs)
                        d._thumbnailWidth = "thumbnailWidth";
                }
                if (m.inviteLinkGroupType != null && m.hasOwnProperty("inviteLinkGroupType")) {
                    d.inviteLinkGroupType = o.enums === String ? $root.proto.Message.ExtendedTextMessage.InviteLinkGroupType[m.inviteLinkGroupType] === undefined ? m.inviteLinkGroupType : $root.proto.Message.ExtendedTextMessage.InviteLinkGroupType[m.inviteLinkGroupType] : m.inviteLinkGroupType;
                    if (o.oneofs)
                        d._inviteLinkGroupType = "inviteLinkGroupType";
                }
                if (m.inviteLinkParentGroupSubjectV2 != null && m.hasOwnProperty("inviteLinkParentGroupSubjectV2")) {
                    d.inviteLinkParentGroupSubjectV2 = m.inviteLinkParentGroupSubjectV2;
                    if (o.oneofs)
                        d._inviteLinkParentGroupSubjectV2 = "inviteLinkParentGroupSubjectV2";
                }
                if (m.inviteLinkParentGroupThumbnailV2 != null && m.hasOwnProperty("inviteLinkParentGroupThumbnailV2")) {
                    d.inviteLinkParentGroupThumbnailV2 = o.bytes === String ? $util.base64.encode(m.inviteLinkParentGroupThumbnailV2, 0, m.inviteLinkParentGroupThumbnailV2.length) : o.bytes === Array ? Array.prototype.slice.call(m.inviteLinkParentGroupThumbnailV2) : m.inviteLinkParentGroupThumbnailV2;
                    if (o.oneofs)
                        d._inviteLinkParentGroupThumbnailV2 = "inviteLinkParentGroupThumbnailV2";
                }
                if (m.inviteLinkGroupTypeV2 != null && m.hasOwnProperty("inviteLinkGroupTypeV2")) {
                    d.inviteLinkGroupTypeV2 = o.enums === String ? $root.proto.Message.ExtendedTextMessage.InviteLinkGroupType[m.inviteLinkGroupTypeV2] === undefined ? m.inviteLinkGroupTypeV2 : $root.proto.Message.ExtendedTextMessage.InviteLinkGroupType[m.inviteLinkGroupTypeV2] : m.inviteLinkGroupTypeV2;
                    if (o.oneofs)
                        d._inviteLinkGroupTypeV2 = "inviteLinkGroupTypeV2";
                }
                if (m.viewOnce != null && m.hasOwnProperty("viewOnce")) {
                    d.viewOnce = m.viewOnce;
                    if (o.oneofs)
                        d._viewOnce = "viewOnce";
                }
                if (m.videoHeight != null && m.hasOwnProperty("videoHeight")) {
                    d.videoHeight = m.videoHeight;
                    if (o.oneofs)
                        d._videoHeight = "videoHeight";
                }
                if (m.videoWidth != null && m.hasOwnProperty("videoWidth")) {
                    d.videoWidth = m.videoWidth;
                    if (o.oneofs)
                        d._videoWidth = "videoWidth";
                }
                if (m.faviconMMSMetadata != null && m.hasOwnProperty("faviconMMSMetadata")) {
                    d.faviconMMSMetadata = $root.proto.Message.MMSThumbnailMetadata.toObject(m.faviconMMSMetadata, o);
                    if (o.oneofs)
                        d._faviconMMSMetadata = "faviconMMSMetadata";
                }
                if (m.linkPreviewMetadata != null && m.hasOwnProperty("linkPreviewMetadata")) {
                    d.linkPreviewMetadata = $root.proto.Message.LinkPreviewMetadata.toObject(m.linkPreviewMetadata, o);
                    if (o.oneofs)
                        d._linkPreviewMetadata = "linkPreviewMetadata";
                }
                if (m.paymentLinkMetadata != null && m.hasOwnProperty("paymentLinkMetadata")) {
                    d.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.toObject(m.paymentLinkMetadata, o);
                    if (o.oneofs)
                        d._paymentLinkMetadata = "paymentLinkMetadata";
                }
                if (m.endCardTiles && m.endCardTiles.length) {
                    d.endCardTiles = [];
                    for (var j = 0; j < m.endCardTiles.length; ++j) {
                        d.endCardTiles[j] = $root.proto.Message.VideoEndCard.toObject(m.endCardTiles[j], o);
                    }
                }
                if (m.videoContentUrl != null && m.hasOwnProperty("videoContentUrl")) {
                    d.videoContentUrl = m.videoContentUrl;
                    if (o.oneofs)
                        d._videoContentUrl = "videoContentUrl";
                }
                if (m.musicMetadata != null && m.hasOwnProperty("musicMetadata")) {
                    d.musicMetadata = $root.proto.EmbeddedMusic.toObject(m.musicMetadata, o);
                    if (o.oneofs)
                        d._musicMetadata = "musicMetadata";
                }
                if (m.paymentExtendedMetadata != null && m.hasOwnProperty("paymentExtendedMetadata")) {
                    d.paymentExtendedMetadata = $root.proto.Message.PaymentExtendedMetadata.toObject(m.paymentExtendedMetadata, o);
                    if (o.oneofs)
                        d._paymentExtendedMetadata = "paymentExtendedMetadata";
                }
                return d;
            };

            ExtendedTextMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ExtendedTextMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ExtendedTextMessage";
            };

            ExtendedTextMessage.FontType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "SYSTEM"] = 0;
                values[valuesById[1] = "SYSTEM_TEXT"] = 1;
                values[valuesById[2] = "FB_SCRIPT"] = 2;
                values[valuesById[6] = "SYSTEM_BOLD"] = 6;
                values[valuesById[7] = "MORNINGBREEZE_REGULAR"] = 7;
                values[valuesById[8] = "CALISTOGA_REGULAR"] = 8;
                values[valuesById[9] = "EXO2_EXTRABOLD"] = 9;
                values[valuesById[10] = "COURIERPRIME_BOLD"] = 10;
                return values;
            })();

            ExtendedTextMessage.InviteLinkGroupType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "DEFAULT"] = 0;
                values[valuesById[1] = "PARENT"] = 1;
                values[valuesById[2] = "SUB"] = 2;
                values[valuesById[3] = "DEFAULT_SUB"] = 3;
                return values;
            })();

            ExtendedTextMessage.PreviewType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "NONE"] = 0;
                values[valuesById[1] = "VIDEO"] = 1;
                values[valuesById[4] = "PLACEHOLDER"] = 4;
                values[valuesById[5] = "IMAGE"] = 5;
                values[valuesById[6] = "PAYMENT_LINKS"] = 6;
                values[valuesById[7] = "PROFILE"] = 7;
                return values;
            })();

            return ExtendedTextMessage;
        })();

        Message.FullHistorySyncOnDemandRequestMetadata = (function() {

            function FullHistorySyncOnDemandRequestMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            FullHistorySyncOnDemandRequestMetadata.prototype.requestId = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(FullHistorySyncOnDemandRequestMetadata.prototype, "_requestId", {
                get: $util.oneOfGetter($oneOfFields = ["requestId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            FullHistorySyncOnDemandRequestMetadata.create = function create(properties) {
                return new FullHistorySyncOnDemandRequestMetadata(properties);
            };

            FullHistorySyncOnDemandRequestMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.requestId != null && Object.hasOwnProperty.call(m, "requestId"))
                    w.uint32(10).string(m.requestId);
                return w;
            };

            FullHistorySyncOnDemandRequestMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.FullHistorySyncOnDemandRequestMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.requestId = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            FullHistorySyncOnDemandRequestMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.FullHistorySyncOnDemandRequestMetadata)
                    return d;
                var m = new $root.proto.Message.FullHistorySyncOnDemandRequestMetadata();
                if (d.requestId != null) {
                    m.requestId = String(d.requestId);
                }
                return m;
            };

            FullHistorySyncOnDemandRequestMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.requestId != null && m.hasOwnProperty("requestId")) {
                    d.requestId = m.requestId;
                    if (o.oneofs)
                        d._requestId = "requestId";
                }
                return d;
            };

            FullHistorySyncOnDemandRequestMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            FullHistorySyncOnDemandRequestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.FullHistorySyncOnDemandRequestMetadata";
            };

            return FullHistorySyncOnDemandRequestMetadata;
        })();

        Message.FutureProofMessage = (function() {

            function FutureProofMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            FutureProofMessage.prototype.message = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(FutureProofMessage.prototype, "_message", {
                get: $util.oneOfGetter($oneOfFields = ["message"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            FutureProofMessage.create = function create(properties) {
                return new FutureProofMessage(properties);
            };

            FutureProofMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                    $root.proto.Message.encode(m.message, w.uint32(10).fork()).ldelim();
                return w;
            };

            FutureProofMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.FutureProofMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.message = $root.proto.Message.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            FutureProofMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.FutureProofMessage)
                    return d;
                var m = new $root.proto.Message.FutureProofMessage();
                if (d.message != null) {
                    if (typeof d.message !== "object")
                        throw TypeError(".proto.Message.FutureProofMessage.message: object expected");
                    m.message = $root.proto.Message.fromObject(d.message);
                }
                return m;
            };

            FutureProofMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.message != null && m.hasOwnProperty("message")) {
                    d.message = $root.proto.Message.toObject(m.message, o);
                    if (o.oneofs)
                        d._message = "message";
                }
                return d;
            };

            FutureProofMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            FutureProofMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.FutureProofMessage";
            };

            return FutureProofMessage;
        })();

        Message.GroupInviteMessage = (function() {

            function GroupInviteMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            GroupInviteMessage.prototype.groupJid = null;
            GroupInviteMessage.prototype.inviteCode = null;
            GroupInviteMessage.prototype.inviteExpiration = null;
            GroupInviteMessage.prototype.groupName = null;
            GroupInviteMessage.prototype.jpegThumbnail = null;
            GroupInviteMessage.prototype.caption = null;
            GroupInviteMessage.prototype.contextInfo = null;
            GroupInviteMessage.prototype.groupType = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupInviteMessage.prototype, "_groupJid", {
                get: $util.oneOfGetter($oneOfFields = ["groupJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupInviteMessage.prototype, "_inviteCode", {
                get: $util.oneOfGetter($oneOfFields = ["inviteCode"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupInviteMessage.prototype, "_inviteExpiration", {
                get: $util.oneOfGetter($oneOfFields = ["inviteExpiration"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupInviteMessage.prototype, "_groupName", {
                get: $util.oneOfGetter($oneOfFields = ["groupName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupInviteMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupInviteMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupInviteMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupInviteMessage.prototype, "_groupType", {
                get: $util.oneOfGetter($oneOfFields = ["groupType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            GroupInviteMessage.create = function create(properties) {
                return new GroupInviteMessage(properties);
            };

            GroupInviteMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.groupJid != null && Object.hasOwnProperty.call(m, "groupJid"))
                    w.uint32(10).string(m.groupJid);
                if (m.inviteCode != null && Object.hasOwnProperty.call(m, "inviteCode"))
                    w.uint32(18).string(m.inviteCode);
                if (m.inviteExpiration != null && Object.hasOwnProperty.call(m, "inviteExpiration"))
                    w.uint32(24).int64(m.inviteExpiration);
                if (m.groupName != null && Object.hasOwnProperty.call(m, "groupName"))
                    w.uint32(34).string(m.groupName);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(42).bytes(m.jpegThumbnail);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(50).string(m.caption);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(58).fork()).ldelim();
                if (m.groupType != null && Object.hasOwnProperty.call(m, "groupType"))
                    w.uint32(64).int32(m.groupType);
                return w;
            };

            GroupInviteMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.GroupInviteMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.groupJid = r.string();
                            break;
                        }
                    case 2: {
                            m.inviteCode = r.string();
                            break;
                        }
                    case 3: {
                            m.inviteExpiration = r.int64();
                            break;
                        }
                    case 4: {
                            m.groupName = r.string();
                            break;
                        }
                    case 5: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 6: {
                            m.caption = r.string();
                            break;
                        }
                    case 7: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 8: {
                            m.groupType = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            GroupInviteMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.GroupInviteMessage)
                    return d;
                var m = new $root.proto.Message.GroupInviteMessage();
                if (d.groupJid != null) {
                    m.groupJid = String(d.groupJid);
                }
                if (d.inviteCode != null) {
                    m.inviteCode = String(d.inviteCode);
                }
                if (d.inviteExpiration != null) {
                    if ($util.Long)
                        (m.inviteExpiration = $util.Long.fromValue(d.inviteExpiration)).unsigned = false;
                    else if (typeof d.inviteExpiration === "string")
                        m.inviteExpiration = parseInt(d.inviteExpiration, 10);
                    else if (typeof d.inviteExpiration === "number")
                        m.inviteExpiration = d.inviteExpiration;
                    else if (typeof d.inviteExpiration === "object")
                        m.inviteExpiration = new $util.LongBits(d.inviteExpiration.low >>> 0, d.inviteExpiration.high >>> 0).toNumber();
                }
                if (d.groupName != null) {
                    m.groupName = String(d.groupName);
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.GroupInviteMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                switch (d.groupType) {
                default:
                    if (typeof d.groupType === "number") {
                        m.groupType = d.groupType;
                        break;
                    }
                    break;
                case "DEFAULT":
                case 0:
                    m.groupType = 0;
                    break;
                case "PARENT":
                case 1:
                    m.groupType = 1;
                    break;
                }
                return m;
            };

            GroupInviteMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.groupJid != null && m.hasOwnProperty("groupJid")) {
                    d.groupJid = m.groupJid;
                    if (o.oneofs)
                        d._groupJid = "groupJid";
                }
                if (m.inviteCode != null && m.hasOwnProperty("inviteCode")) {
                    d.inviteCode = m.inviteCode;
                    if (o.oneofs)
                        d._inviteCode = "inviteCode";
                }
                if (m.inviteExpiration != null && m.hasOwnProperty("inviteExpiration")) {
                    if (typeof m.inviteExpiration === "number")
                        d.inviteExpiration = o.longs === String ? String(m.inviteExpiration) : m.inviteExpiration;
                    else
                        d.inviteExpiration = o.longs === String ? longToString(m.inviteExpiration) : o.longs === Number ? longToNumber(m.inviteExpiration) : m.inviteExpiration;
                    if (o.oneofs)
                        d._inviteExpiration = "inviteExpiration";
                }
                if (m.groupName != null && m.hasOwnProperty("groupName")) {
                    d.groupName = m.groupName;
                    if (o.oneofs)
                        d._groupName = "groupName";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.groupType != null && m.hasOwnProperty("groupType")) {
                    d.groupType = o.enums === String ? $root.proto.Message.GroupInviteMessage.GroupType[m.groupType] === undefined ? m.groupType : $root.proto.Message.GroupInviteMessage.GroupType[m.groupType] : m.groupType;
                    if (o.oneofs)
                        d._groupType = "groupType";
                }
                return d;
            };

            GroupInviteMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            GroupInviteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.GroupInviteMessage";
            };

            GroupInviteMessage.GroupType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "DEFAULT"] = 0;
                values[valuesById[1] = "PARENT"] = 1;
                return values;
            })();

            return GroupInviteMessage;
        })();

        Message.HighlyStructuredMessage = (function() {

            function HighlyStructuredMessage(p) {
                this.params = [];
                this.localizableParams = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            HighlyStructuredMessage.prototype.namespace = null;
            HighlyStructuredMessage.prototype.elementName = null;
            HighlyStructuredMessage.prototype.params = $util.emptyArray;
            HighlyStructuredMessage.prototype.fallbackLg = null;
            HighlyStructuredMessage.prototype.fallbackLc = null;
            HighlyStructuredMessage.prototype.localizableParams = $util.emptyArray;
            HighlyStructuredMessage.prototype.deterministicLg = null;
            HighlyStructuredMessage.prototype.deterministicLc = null;
            HighlyStructuredMessage.prototype.hydratedHsm = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HighlyStructuredMessage.prototype, "_namespace", {
                get: $util.oneOfGetter($oneOfFields = ["namespace"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HighlyStructuredMessage.prototype, "_elementName", {
                get: $util.oneOfGetter($oneOfFields = ["elementName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HighlyStructuredMessage.prototype, "_fallbackLg", {
                get: $util.oneOfGetter($oneOfFields = ["fallbackLg"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HighlyStructuredMessage.prototype, "_fallbackLc", {
                get: $util.oneOfGetter($oneOfFields = ["fallbackLc"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HighlyStructuredMessage.prototype, "_deterministicLg", {
                get: $util.oneOfGetter($oneOfFields = ["deterministicLg"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HighlyStructuredMessage.prototype, "_deterministicLc", {
                get: $util.oneOfGetter($oneOfFields = ["deterministicLc"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HighlyStructuredMessage.prototype, "_hydratedHsm", {
                get: $util.oneOfGetter($oneOfFields = ["hydratedHsm"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            HighlyStructuredMessage.create = function create(properties) {
                return new HighlyStructuredMessage(properties);
            };

            HighlyStructuredMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.namespace != null && Object.hasOwnProperty.call(m, "namespace"))
                    w.uint32(10).string(m.namespace);
                if (m.elementName != null && Object.hasOwnProperty.call(m, "elementName"))
                    w.uint32(18).string(m.elementName);
                if (m.params != null && m.params.length) {
                    for (var i = 0; i < m.params.length; ++i)
                        w.uint32(26).string(m.params[i]);
                }
                if (m.fallbackLg != null && Object.hasOwnProperty.call(m, "fallbackLg"))
                    w.uint32(34).string(m.fallbackLg);
                if (m.fallbackLc != null && Object.hasOwnProperty.call(m, "fallbackLc"))
                    w.uint32(42).string(m.fallbackLc);
                if (m.localizableParams != null && m.localizableParams.length) {
                    for (var i = 0; i < m.localizableParams.length; ++i)
                        $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.encode(m.localizableParams[i], w.uint32(50).fork()).ldelim();
                }
                if (m.deterministicLg != null && Object.hasOwnProperty.call(m, "deterministicLg"))
                    w.uint32(58).string(m.deterministicLg);
                if (m.deterministicLc != null && Object.hasOwnProperty.call(m, "deterministicLc"))
                    w.uint32(66).string(m.deterministicLc);
                if (m.hydratedHsm != null && Object.hasOwnProperty.call(m, "hydratedHsm"))
                    $root.proto.Message.TemplateMessage.encode(m.hydratedHsm, w.uint32(74).fork()).ldelim();
                return w;
            };

            HighlyStructuredMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.HighlyStructuredMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.namespace = r.string();
                            break;
                        }
                    case 2: {
                            m.elementName = r.string();
                            break;
                        }
                    case 3: {
                            if (!(m.params && m.params.length))
                                m.params = [];
                            m.params.push(r.string());
                            break;
                        }
                    case 4: {
                            m.fallbackLg = r.string();
                            break;
                        }
                    case 5: {
                            m.fallbackLc = r.string();
                            break;
                        }
                    case 6: {
                            if (!(m.localizableParams && m.localizableParams.length))
                                m.localizableParams = [];
                            m.localizableParams.push($root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.decode(r, r.uint32()));
                            break;
                        }
                    case 7: {
                            m.deterministicLg = r.string();
                            break;
                        }
                    case 8: {
                            m.deterministicLc = r.string();
                            break;
                        }
                    case 9: {
                            m.hydratedHsm = $root.proto.Message.TemplateMessage.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            HighlyStructuredMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.HighlyStructuredMessage)
                    return d;
                var m = new $root.proto.Message.HighlyStructuredMessage();
                if (d.namespace != null) {
                    m.namespace = String(d.namespace);
                }
                if (d.elementName != null) {
                    m.elementName = String(d.elementName);
                }
                if (d.params) {
                    if (!Array.isArray(d.params))
                        throw TypeError(".proto.Message.HighlyStructuredMessage.params: array expected");
                    m.params = [];
                    for (var i = 0; i < d.params.length; ++i) {
                        m.params[i] = String(d.params[i]);
                    }
                }
                if (d.fallbackLg != null) {
                    m.fallbackLg = String(d.fallbackLg);
                }
                if (d.fallbackLc != null) {
                    m.fallbackLc = String(d.fallbackLc);
                }
                if (d.localizableParams) {
                    if (!Array.isArray(d.localizableParams))
                        throw TypeError(".proto.Message.HighlyStructuredMessage.localizableParams: array expected");
                    m.localizableParams = [];
                    for (var i = 0; i < d.localizableParams.length; ++i) {
                        if (typeof d.localizableParams[i] !== "object")
                            throw TypeError(".proto.Message.HighlyStructuredMessage.localizableParams: object expected");
                        m.localizableParams[i] = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.fromObject(d.localizableParams[i]);
                    }
                }
                if (d.deterministicLg != null) {
                    m.deterministicLg = String(d.deterministicLg);
                }
                if (d.deterministicLc != null) {
                    m.deterministicLc = String(d.deterministicLc);
                }
                if (d.hydratedHsm != null) {
                    if (typeof d.hydratedHsm !== "object")
                        throw TypeError(".proto.Message.HighlyStructuredMessage.hydratedHsm: object expected");
                    m.hydratedHsm = $root.proto.Message.TemplateMessage.fromObject(d.hydratedHsm);
                }
                return m;
            };

            HighlyStructuredMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.params = [];
                    d.localizableParams = [];
                }
                if (m.namespace != null && m.hasOwnProperty("namespace")) {
                    d.namespace = m.namespace;
                    if (o.oneofs)
                        d._namespace = "namespace";
                }
                if (m.elementName != null && m.hasOwnProperty("elementName")) {
                    d.elementName = m.elementName;
                    if (o.oneofs)
                        d._elementName = "elementName";
                }
                if (m.params && m.params.length) {
                    d.params = [];
                    for (var j = 0; j < m.params.length; ++j) {
                        d.params[j] = m.params[j];
                    }
                }
                if (m.fallbackLg != null && m.hasOwnProperty("fallbackLg")) {
                    d.fallbackLg = m.fallbackLg;
                    if (o.oneofs)
                        d._fallbackLg = "fallbackLg";
                }
                if (m.fallbackLc != null && m.hasOwnProperty("fallbackLc")) {
                    d.fallbackLc = m.fallbackLc;
                    if (o.oneofs)
                        d._fallbackLc = "fallbackLc";
                }
                if (m.localizableParams && m.localizableParams.length) {
                    d.localizableParams = [];
                    for (var j = 0; j < m.localizableParams.length; ++j) {
                        d.localizableParams[j] = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.toObject(m.localizableParams[j], o);
                    }
                }
                if (m.deterministicLg != null && m.hasOwnProperty("deterministicLg")) {
                    d.deterministicLg = m.deterministicLg;
                    if (o.oneofs)
                        d._deterministicLg = "deterministicLg";
                }
                if (m.deterministicLc != null && m.hasOwnProperty("deterministicLc")) {
                    d.deterministicLc = m.deterministicLc;
                    if (o.oneofs)
                        d._deterministicLc = "deterministicLc";
                }
                if (m.hydratedHsm != null && m.hasOwnProperty("hydratedHsm")) {
                    d.hydratedHsm = $root.proto.Message.TemplateMessage.toObject(m.hydratedHsm, o);
                    if (o.oneofs)
                        d._hydratedHsm = "hydratedHsm";
                }
                return d;
            };

            HighlyStructuredMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            HighlyStructuredMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.HighlyStructuredMessage";
            };

            HighlyStructuredMessage.HSMLocalizableParameter = (function() {

                function HSMLocalizableParameter(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                HSMLocalizableParameter.prototype["default"] = null;
                HSMLocalizableParameter.prototype.currency = null;
                HSMLocalizableParameter.prototype.dateTime = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HSMLocalizableParameter.prototype, "_default", {
                    get: $util.oneOfGetter($oneOfFields = ["default"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Object.defineProperty(HSMLocalizableParameter.prototype, "paramOneof", {
                    get: $util.oneOfGetter($oneOfFields = ["currency", "dateTime"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                HSMLocalizableParameter.create = function create(properties) {
                    return new HSMLocalizableParameter(properties);
                };

                HSMLocalizableParameter.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m["default"] != null && Object.hasOwnProperty.call(m, "default"))
                        w.uint32(10).string(m["default"]);
                    if (m.currency != null && Object.hasOwnProperty.call(m, "currency"))
                        $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.encode(m.currency, w.uint32(18).fork()).ldelim();
                    if (m.dateTime != null && Object.hasOwnProperty.call(m, "dateTime"))
                        $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.encode(m.dateTime, w.uint32(26).fork()).ldelim();
                    return w;
                };

                HSMLocalizableParameter.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m["default"] = r.string();
                                break;
                            }
                        case 2: {
                                m.currency = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.decode(r, r.uint32());
                                break;
                            }
                        case 3: {
                                m.dateTime = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                HSMLocalizableParameter.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter)
                        return d;
                    var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter();
                    if (d["default"] != null) {
                        m["default"] = String(d["default"]);
                    }
                    if (d.currency != null) {
                        if (typeof d.currency !== "object")
                            throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.currency: object expected");
                        m.currency = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.fromObject(d.currency);
                    }
                    if (d.dateTime != null) {
                        if (typeof d.dateTime !== "object")
                            throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.dateTime: object expected");
                        m.dateTime = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.fromObject(d.dateTime);
                    }
                    return m;
                };

                HSMLocalizableParameter.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m["default"] != null && m.hasOwnProperty("default")) {
                        d["default"] = m["default"];
                        if (o.oneofs)
                            d._default = "default";
                    }
                    if (m.currency != null && m.hasOwnProperty("currency")) {
                        d.currency = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.toObject(m.currency, o);
                        if (o.oneofs)
                            d.paramOneof = "currency";
                    }
                    if (m.dateTime != null && m.hasOwnProperty("dateTime")) {
                        d.dateTime = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.toObject(m.dateTime, o);
                        if (o.oneofs)
                            d.paramOneof = "dateTime";
                    }
                    return d;
                };

                HSMLocalizableParameter.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                HSMLocalizableParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter";
                };

                HSMLocalizableParameter.HSMCurrency = (function() {

                    function HSMCurrency(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    HSMCurrency.prototype.currencyCode = null;
                    HSMCurrency.prototype.amount1000 = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(HSMCurrency.prototype, "_currencyCode", {
                        get: $util.oneOfGetter($oneOfFields = ["currencyCode"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(HSMCurrency.prototype, "_amount1000", {
                        get: $util.oneOfGetter($oneOfFields = ["amount1000"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    HSMCurrency.create = function create(properties) {
                        return new HSMCurrency(properties);
                    };

                    HSMCurrency.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.currencyCode != null && Object.hasOwnProperty.call(m, "currencyCode"))
                            w.uint32(10).string(m.currencyCode);
                        if (m.amount1000 != null && Object.hasOwnProperty.call(m, "amount1000"))
                            w.uint32(16).int64(m.amount1000);
                        return w;
                    };

                    HSMCurrency.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.currencyCode = r.string();
                                    break;
                                }
                            case 2: {
                                    m.amount1000 = r.int64();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    HSMCurrency.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency)
                            return d;
                        var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency();
                        if (d.currencyCode != null) {
                            m.currencyCode = String(d.currencyCode);
                        }
                        if (d.amount1000 != null) {
                            if ($util.Long)
                                (m.amount1000 = $util.Long.fromValue(d.amount1000)).unsigned = false;
                            else if (typeof d.amount1000 === "string")
                                m.amount1000 = parseInt(d.amount1000, 10);
                            else if (typeof d.amount1000 === "number")
                                m.amount1000 = d.amount1000;
                            else if (typeof d.amount1000 === "object")
                                m.amount1000 = new $util.LongBits(d.amount1000.low >>> 0, d.amount1000.high >>> 0).toNumber();
                        }
                        return m;
                    };

                    HSMCurrency.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.currencyCode != null && m.hasOwnProperty("currencyCode")) {
                            d.currencyCode = m.currencyCode;
                            if (o.oneofs)
                                d._currencyCode = "currencyCode";
                        }
                        if (m.amount1000 != null && m.hasOwnProperty("amount1000")) {
                            if (typeof m.amount1000 === "number")
                                d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000;
                            else
                                d.amount1000 = o.longs === String ? longToString(m.amount1000) : o.longs === Number ? longToNumber(m.amount1000) : m.amount1000;
                            if (o.oneofs)
                                d._amount1000 = "amount1000";
                        }
                        return d;
                    };

                    HSMCurrency.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    HSMCurrency.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency";
                    };

                    return HSMCurrency;
                })();

                HSMLocalizableParameter.HSMDateTime = (function() {

                    function HSMDateTime(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    HSMDateTime.prototype.component = null;
                    HSMDateTime.prototype.unixEpoch = null;

                    let $oneOfFields;

                    Object.defineProperty(HSMDateTime.prototype, "datetimeOneof", {
                        get: $util.oneOfGetter($oneOfFields = ["component", "unixEpoch"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    HSMDateTime.create = function create(properties) {
                        return new HSMDateTime(properties);
                    };

                    HSMDateTime.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.component != null && Object.hasOwnProperty.call(m, "component"))
                            $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.encode(m.component, w.uint32(10).fork()).ldelim();
                        if (m.unixEpoch != null && Object.hasOwnProperty.call(m, "unixEpoch"))
                            $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.encode(m.unixEpoch, w.uint32(18).fork()).ldelim();
                        return w;
                    };

                    HSMDateTime.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.component = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.decode(r, r.uint32());
                                    break;
                                }
                            case 2: {
                                    m.unixEpoch = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.decode(r, r.uint32());
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    HSMDateTime.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime)
                            return d;
                        var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime();
                        if (d.component != null) {
                            if (typeof d.component !== "object")
                                throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component: object expected");
                            m.component = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.fromObject(d.component);
                        }
                        if (d.unixEpoch != null) {
                            if (typeof d.unixEpoch !== "object")
                                throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch: object expected");
                            m.unixEpoch = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.fromObject(d.unixEpoch);
                        }
                        return m;
                    };

                    HSMDateTime.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.component != null && m.hasOwnProperty("component")) {
                            d.component = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.toObject(m.component, o);
                            if (o.oneofs)
                                d.datetimeOneof = "component";
                        }
                        if (m.unixEpoch != null && m.hasOwnProperty("unixEpoch")) {
                            d.unixEpoch = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.toObject(m.unixEpoch, o);
                            if (o.oneofs)
                                d.datetimeOneof = "unixEpoch";
                        }
                        return d;
                    };

                    HSMDateTime.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    HSMDateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime";
                    };

                    HSMDateTime.HSMDateTimeComponent = (function() {

                        function HSMDateTimeComponent(p) {
                            if (p)
                                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                    if (p[ks[i]] != null)
                                        this[ks[i]] = p[ks[i]];
                        }

                        HSMDateTimeComponent.prototype.dayOfWeek = null;
                        HSMDateTimeComponent.prototype.year = null;
                        HSMDateTimeComponent.prototype.month = null;
                        HSMDateTimeComponent.prototype.dayOfMonth = null;
                        HSMDateTimeComponent.prototype.hour = null;
                        HSMDateTimeComponent.prototype.minute = null;
                        HSMDateTimeComponent.prototype.calendar = null;

                        let $oneOfFields;

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(HSMDateTimeComponent.prototype, "_dayOfWeek", {
                            get: $util.oneOfGetter($oneOfFields = ["dayOfWeek"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(HSMDateTimeComponent.prototype, "_year", {
                            get: $util.oneOfGetter($oneOfFields = ["year"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(HSMDateTimeComponent.prototype, "_month", {
                            get: $util.oneOfGetter($oneOfFields = ["month"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(HSMDateTimeComponent.prototype, "_dayOfMonth", {
                            get: $util.oneOfGetter($oneOfFields = ["dayOfMonth"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(HSMDateTimeComponent.prototype, "_hour", {
                            get: $util.oneOfGetter($oneOfFields = ["hour"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(HSMDateTimeComponent.prototype, "_minute", {
                            get: $util.oneOfGetter($oneOfFields = ["minute"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(HSMDateTimeComponent.prototype, "_calendar", {
                            get: $util.oneOfGetter($oneOfFields = ["calendar"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        HSMDateTimeComponent.create = function create(properties) {
                            return new HSMDateTimeComponent(properties);
                        };

                        HSMDateTimeComponent.encode = function encode(m, w) {
                            if (!w)
                                w = $Writer.create();
                            if (m.dayOfWeek != null && Object.hasOwnProperty.call(m, "dayOfWeek"))
                                w.uint32(8).int32(m.dayOfWeek);
                            if (m.year != null && Object.hasOwnProperty.call(m, "year"))
                                w.uint32(16).uint32(m.year);
                            if (m.month != null && Object.hasOwnProperty.call(m, "month"))
                                w.uint32(24).uint32(m.month);
                            if (m.dayOfMonth != null && Object.hasOwnProperty.call(m, "dayOfMonth"))
                                w.uint32(32).uint32(m.dayOfMonth);
                            if (m.hour != null && Object.hasOwnProperty.call(m, "hour"))
                                w.uint32(40).uint32(m.hour);
                            if (m.minute != null && Object.hasOwnProperty.call(m, "minute"))
                                w.uint32(48).uint32(m.minute);
                            if (m.calendar != null && Object.hasOwnProperty.call(m, "calendar"))
                                w.uint32(56).int32(m.calendar);
                            return w;
                        };

                        HSMDateTimeComponent.decode = function decode(r, l, e) {
                            if (!(r instanceof $Reader))
                                r = $Reader.create(r);
                            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent();
                            while (r.pos < c) {
                                var t = r.uint32();
                                if (t === e)
                                    break;
                                switch (t >>> 3) {
                                case 1: {
                                        m.dayOfWeek = r.int32();
                                        break;
                                    }
                                case 2: {
                                        m.year = r.uint32();
                                        break;
                                    }
                                case 3: {
                                        m.month = r.uint32();
                                        break;
                                    }
                                case 4: {
                                        m.dayOfMonth = r.uint32();
                                        break;
                                    }
                                case 5: {
                                        m.hour = r.uint32();
                                        break;
                                    }
                                case 6: {
                                        m.minute = r.uint32();
                                        break;
                                    }
                                case 7: {
                                        m.calendar = r.int32();
                                        break;
                                    }
                                default:
                                    r.skipType(t & 7);
                                    break;
                                }
                            }
                            return m;
                        };

                        HSMDateTimeComponent.fromObject = function fromObject(d) {
                            if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent)
                                return d;
                            var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent();
                            switch (d.dayOfWeek) {
                            default:
                                if (typeof d.dayOfWeek === "number") {
                                    m.dayOfWeek = d.dayOfWeek;
                                    break;
                                }
                                break;
                            case "MONDAY":
                            case 1:
                                m.dayOfWeek = 1;
                                break;
                            case "TUESDAY":
                            case 2:
                                m.dayOfWeek = 2;
                                break;
                            case "WEDNESDAY":
                            case 3:
                                m.dayOfWeek = 3;
                                break;
                            case "THURSDAY":
                            case 4:
                                m.dayOfWeek = 4;
                                break;
                            case "FRIDAY":
                            case 5:
                                m.dayOfWeek = 5;
                                break;
                            case "SATURDAY":
                            case 6:
                                m.dayOfWeek = 6;
                                break;
                            case "SUNDAY":
                            case 7:
                                m.dayOfWeek = 7;
                                break;
                            }
                            if (d.year != null) {
                                m.year = d.year >>> 0;
                            }
                            if (d.month != null) {
                                m.month = d.month >>> 0;
                            }
                            if (d.dayOfMonth != null) {
                                m.dayOfMonth = d.dayOfMonth >>> 0;
                            }
                            if (d.hour != null) {
                                m.hour = d.hour >>> 0;
                            }
                            if (d.minute != null) {
                                m.minute = d.minute >>> 0;
                            }
                            switch (d.calendar) {
                            default:
                                if (typeof d.calendar === "number") {
                                    m.calendar = d.calendar;
                                    break;
                                }
                                break;
                            case "GREGORIAN":
                            case 1:
                                m.calendar = 1;
                                break;
                            case "SOLAR_HIJRI":
                            case 2:
                                m.calendar = 2;
                                break;
                            }
                            return m;
                        };

                        HSMDateTimeComponent.toObject = function toObject(m, o) {
                            if (!o)
                                o = {};
                            var d = {};
                            if (m.dayOfWeek != null && m.hasOwnProperty("dayOfWeek")) {
                                d.dayOfWeek = o.enums === String ? $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[m.dayOfWeek] === undefined ? m.dayOfWeek : $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[m.dayOfWeek] : m.dayOfWeek;
                                if (o.oneofs)
                                    d._dayOfWeek = "dayOfWeek";
                            }
                            if (m.year != null && m.hasOwnProperty("year")) {
                                d.year = m.year;
                                if (o.oneofs)
                                    d._year = "year";
                            }
                            if (m.month != null && m.hasOwnProperty("month")) {
                                d.month = m.month;
                                if (o.oneofs)
                                    d._month = "month";
                            }
                            if (m.dayOfMonth != null && m.hasOwnProperty("dayOfMonth")) {
                                d.dayOfMonth = m.dayOfMonth;
                                if (o.oneofs)
                                    d._dayOfMonth = "dayOfMonth";
                            }
                            if (m.hour != null && m.hasOwnProperty("hour")) {
                                d.hour = m.hour;
                                if (o.oneofs)
                                    d._hour = "hour";
                            }
                            if (m.minute != null && m.hasOwnProperty("minute")) {
                                d.minute = m.minute;
                                if (o.oneofs)
                                    d._minute = "minute";
                            }
                            if (m.calendar != null && m.hasOwnProperty("calendar")) {
                                d.calendar = o.enums === String ? $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[m.calendar] === undefined ? m.calendar : $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[m.calendar] : m.calendar;
                                if (o.oneofs)
                                    d._calendar = "calendar";
                            }
                            return d;
                        };

                        HSMDateTimeComponent.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };

                        HSMDateTimeComponent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent";
                        };

                        HSMDateTimeComponent.CalendarType = (function() {
                            const valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[1] = "GREGORIAN"] = 1;
                            values[valuesById[2] = "SOLAR_HIJRI"] = 2;
                            return values;
                        })();

                        HSMDateTimeComponent.DayOfWeekType = (function() {
                            const valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[1] = "MONDAY"] = 1;
                            values[valuesById[2] = "TUESDAY"] = 2;
                            values[valuesById[3] = "WEDNESDAY"] = 3;
                            values[valuesById[4] = "THURSDAY"] = 4;
                            values[valuesById[5] = "FRIDAY"] = 5;
                            values[valuesById[6] = "SATURDAY"] = 6;
                            values[valuesById[7] = "SUNDAY"] = 7;
                            return values;
                        })();

                        return HSMDateTimeComponent;
                    })();

                    HSMDateTime.HSMDateTimeUnixEpoch = (function() {

                        function HSMDateTimeUnixEpoch(p) {
                            if (p)
                                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                    if (p[ks[i]] != null)
                                        this[ks[i]] = p[ks[i]];
                        }

                        HSMDateTimeUnixEpoch.prototype.timestamp = null;

                        let $oneOfFields;

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(HSMDateTimeUnixEpoch.prototype, "_timestamp", {
                            get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        HSMDateTimeUnixEpoch.create = function create(properties) {
                            return new HSMDateTimeUnixEpoch(properties);
                        };

                        HSMDateTimeUnixEpoch.encode = function encode(m, w) {
                            if (!w)
                                w = $Writer.create();
                            if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                                w.uint32(8).int64(m.timestamp);
                            return w;
                        };

                        HSMDateTimeUnixEpoch.decode = function decode(r, l, e) {
                            if (!(r instanceof $Reader))
                                r = $Reader.create(r);
                            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch();
                            while (r.pos < c) {
                                var t = r.uint32();
                                if (t === e)
                                    break;
                                switch (t >>> 3) {
                                case 1: {
                                        m.timestamp = r.int64();
                                        break;
                                    }
                                default:
                                    r.skipType(t & 7);
                                    break;
                                }
                            }
                            return m;
                        };

                        HSMDateTimeUnixEpoch.fromObject = function fromObject(d) {
                            if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch)
                                return d;
                            var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch();
                            if (d.timestamp != null) {
                                if ($util.Long)
                                    (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                                else if (typeof d.timestamp === "string")
                                    m.timestamp = parseInt(d.timestamp, 10);
                                else if (typeof d.timestamp === "number")
                                    m.timestamp = d.timestamp;
                                else if (typeof d.timestamp === "object")
                                    m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
                            }
                            return m;
                        };

                        HSMDateTimeUnixEpoch.toObject = function toObject(m, o) {
                            if (!o)
                                o = {};
                            var d = {};
                            if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                                if (typeof m.timestamp === "number")
                                    d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                                else
                                    d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                                if (o.oneofs)
                                    d._timestamp = "timestamp";
                            }
                            return d;
                        };

                        HSMDateTimeUnixEpoch.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };

                        HSMDateTimeUnixEpoch.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch";
                        };

                        return HSMDateTimeUnixEpoch;
                    })();

                    return HSMDateTime;
                })();

                return HSMLocalizableParameter;
            })();

            return HighlyStructuredMessage;
        })();

        Message.HistorySyncMessageAccessStatus = (function() {

            function HistorySyncMessageAccessStatus(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            HistorySyncMessageAccessStatus.prototype.completeAccessGranted = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncMessageAccessStatus.prototype, "_completeAccessGranted", {
                get: $util.oneOfGetter($oneOfFields = ["completeAccessGranted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            HistorySyncMessageAccessStatus.create = function create(properties) {
                return new HistorySyncMessageAccessStatus(properties);
            };

            HistorySyncMessageAccessStatus.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.completeAccessGranted != null && Object.hasOwnProperty.call(m, "completeAccessGranted"))
                    w.uint32(8).bool(m.completeAccessGranted);
                return w;
            };

            HistorySyncMessageAccessStatus.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.HistorySyncMessageAccessStatus();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.completeAccessGranted = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            HistorySyncMessageAccessStatus.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.HistorySyncMessageAccessStatus)
                    return d;
                var m = new $root.proto.Message.HistorySyncMessageAccessStatus();
                if (d.completeAccessGranted != null) {
                    m.completeAccessGranted = Boolean(d.completeAccessGranted);
                }
                return m;
            };

            HistorySyncMessageAccessStatus.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.completeAccessGranted != null && m.hasOwnProperty("completeAccessGranted")) {
                    d.completeAccessGranted = m.completeAccessGranted;
                    if (o.oneofs)
                        d._completeAccessGranted = "completeAccessGranted";
                }
                return d;
            };

            HistorySyncMessageAccessStatus.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            HistorySyncMessageAccessStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.HistorySyncMessageAccessStatus";
            };

            return HistorySyncMessageAccessStatus;
        })();

        Message.HistorySyncNotification = (function() {

            function HistorySyncNotification(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            HistorySyncNotification.prototype.fileSha256 = null;
            HistorySyncNotification.prototype.fileLength = null;
            HistorySyncNotification.prototype.mediaKey = null;
            HistorySyncNotification.prototype.fileEncSha256 = null;
            HistorySyncNotification.prototype.directPath = null;
            HistorySyncNotification.prototype.syncType = null;
            HistorySyncNotification.prototype.chunkOrder = null;
            HistorySyncNotification.prototype.originalMessageId = null;
            HistorySyncNotification.prototype.progress = null;
            HistorySyncNotification.prototype.oldestMsgInChunkTimestampSec = null;
            HistorySyncNotification.prototype.initialHistBootstrapInlinePayload = null;
            HistorySyncNotification.prototype.peerDataRequestSessionId = null;
            HistorySyncNotification.prototype.fullHistorySyncOnDemandRequestMetadata = null;
            HistorySyncNotification.prototype.encHandle = null;
            HistorySyncNotification.prototype.messageAccessStatus = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_fileLength", {
                get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_syncType", {
                get: $util.oneOfGetter($oneOfFields = ["syncType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_chunkOrder", {
                get: $util.oneOfGetter($oneOfFields = ["chunkOrder"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_originalMessageId", {
                get: $util.oneOfGetter($oneOfFields = ["originalMessageId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_progress", {
                get: $util.oneOfGetter($oneOfFields = ["progress"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_oldestMsgInChunkTimestampSec", {
                get: $util.oneOfGetter($oneOfFields = ["oldestMsgInChunkTimestampSec"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_initialHistBootstrapInlinePayload", {
                get: $util.oneOfGetter($oneOfFields = ["initialHistBootstrapInlinePayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_peerDataRequestSessionId", {
                get: $util.oneOfGetter($oneOfFields = ["peerDataRequestSessionId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_fullHistorySyncOnDemandRequestMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["fullHistorySyncOnDemandRequestMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_encHandle", {
                get: $util.oneOfGetter($oneOfFields = ["encHandle"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(HistorySyncNotification.prototype, "_messageAccessStatus", {
                get: $util.oneOfGetter($oneOfFields = ["messageAccessStatus"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            HistorySyncNotification.create = function create(properties) {
                return new HistorySyncNotification(properties);
            };

            HistorySyncNotification.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(10).bytes(m.fileSha256);
                if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                    w.uint32(16).uint64(m.fileLength);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(26).bytes(m.mediaKey);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(34).bytes(m.fileEncSha256);
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(42).string(m.directPath);
                if (m.syncType != null && Object.hasOwnProperty.call(m, "syncType"))
                    w.uint32(48).int32(m.syncType);
                if (m.chunkOrder != null && Object.hasOwnProperty.call(m, "chunkOrder"))
                    w.uint32(56).uint32(m.chunkOrder);
                if (m.originalMessageId != null && Object.hasOwnProperty.call(m, "originalMessageId"))
                    w.uint32(66).string(m.originalMessageId);
                if (m.progress != null && Object.hasOwnProperty.call(m, "progress"))
                    w.uint32(72).uint32(m.progress);
                if (m.oldestMsgInChunkTimestampSec != null && Object.hasOwnProperty.call(m, "oldestMsgInChunkTimestampSec"))
                    w.uint32(80).int64(m.oldestMsgInChunkTimestampSec);
                if (m.initialHistBootstrapInlinePayload != null && Object.hasOwnProperty.call(m, "initialHistBootstrapInlinePayload"))
                    w.uint32(90).bytes(m.initialHistBootstrapInlinePayload);
                if (m.peerDataRequestSessionId != null && Object.hasOwnProperty.call(m, "peerDataRequestSessionId"))
                    w.uint32(98).string(m.peerDataRequestSessionId);
                if (m.fullHistorySyncOnDemandRequestMetadata != null && Object.hasOwnProperty.call(m, "fullHistorySyncOnDemandRequestMetadata"))
                    $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.encode(m.fullHistorySyncOnDemandRequestMetadata, w.uint32(106).fork()).ldelim();
                if (m.encHandle != null && Object.hasOwnProperty.call(m, "encHandle"))
                    w.uint32(114).string(m.encHandle);
                if (m.messageAccessStatus != null && Object.hasOwnProperty.call(m, "messageAccessStatus"))
                    $root.proto.Message.HistorySyncMessageAccessStatus.encode(m.messageAccessStatus, w.uint32(122).fork()).ldelim();
                return w;
            };

            HistorySyncNotification.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.HistorySyncNotification();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 2: {
                            m.fileLength = r.uint64();
                            break;
                        }
                    case 3: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 4: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 5: {
                            m.directPath = r.string();
                            break;
                        }
                    case 6: {
                            m.syncType = r.int32();
                            break;
                        }
                    case 7: {
                            m.chunkOrder = r.uint32();
                            break;
                        }
                    case 8: {
                            m.originalMessageId = r.string();
                            break;
                        }
                    case 9: {
                            m.progress = r.uint32();
                            break;
                        }
                    case 10: {
                            m.oldestMsgInChunkTimestampSec = r.int64();
                            break;
                        }
                    case 11: {
                            m.initialHistBootstrapInlinePayload = r.bytes();
                            break;
                        }
                    case 12: {
                            m.peerDataRequestSessionId = r.string();
                            break;
                        }
                    case 13: {
                            m.fullHistorySyncOnDemandRequestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 14: {
                            m.encHandle = r.string();
                            break;
                        }
                    case 15: {
                            m.messageAccessStatus = $root.proto.Message.HistorySyncMessageAccessStatus.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            HistorySyncNotification.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.HistorySyncNotification)
                    return d;
                var m = new $root.proto.Message.HistorySyncNotification();
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.fileLength != null) {
                    if ($util.Long)
                        (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                    else if (typeof d.fileLength === "string")
                        m.fileLength = parseInt(d.fileLength, 10);
                    else if (typeof d.fileLength === "number")
                        m.fileLength = d.fileLength;
                    else if (typeof d.fileLength === "object")
                        m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                switch (d.syncType) {
                default:
                    if (typeof d.syncType === "number") {
                        m.syncType = d.syncType;
                        break;
                    }
                    break;
                case "INITIAL_BOOTSTRAP":
                case 0:
                    m.syncType = 0;
                    break;
                case "INITIAL_STATUS_V3":
                case 1:
                    m.syncType = 1;
                    break;
                case "FULL":
                case 2:
                    m.syncType = 2;
                    break;
                case "RECENT":
                case 3:
                    m.syncType = 3;
                    break;
                case "PUSH_NAME":
                case 4:
                    m.syncType = 4;
                    break;
                case "NON_BLOCKING_DATA":
                case 5:
                    m.syncType = 5;
                    break;
                case "ON_DEMAND":
                case 6:
                    m.syncType = 6;
                    break;
                case "NO_HISTORY":
                case 7:
                    m.syncType = 7;
                    break;
                case "MESSAGE_ACCESS_STATUS":
                case 8:
                    m.syncType = 8;
                    break;
                }
                if (d.chunkOrder != null) {
                    m.chunkOrder = d.chunkOrder >>> 0;
                }
                if (d.originalMessageId != null) {
                    m.originalMessageId = String(d.originalMessageId);
                }
                if (d.progress != null) {
                    m.progress = d.progress >>> 0;
                }
                if (d.oldestMsgInChunkTimestampSec != null) {
                    if ($util.Long)
                        (m.oldestMsgInChunkTimestampSec = $util.Long.fromValue(d.oldestMsgInChunkTimestampSec)).unsigned = false;
                    else if (typeof d.oldestMsgInChunkTimestampSec === "string")
                        m.oldestMsgInChunkTimestampSec = parseInt(d.oldestMsgInChunkTimestampSec, 10);
                    else if (typeof d.oldestMsgInChunkTimestampSec === "number")
                        m.oldestMsgInChunkTimestampSec = d.oldestMsgInChunkTimestampSec;
                    else if (typeof d.oldestMsgInChunkTimestampSec === "object")
                        m.oldestMsgInChunkTimestampSec = new $util.LongBits(d.oldestMsgInChunkTimestampSec.low >>> 0, d.oldestMsgInChunkTimestampSec.high >>> 0).toNumber();
                }
                if (d.initialHistBootstrapInlinePayload != null) {
                    if (typeof d.initialHistBootstrapInlinePayload === "string")
                        $util.base64.decode(d.initialHistBootstrapInlinePayload, m.initialHistBootstrapInlinePayload = $util.newBuffer($util.base64.length(d.initialHistBootstrapInlinePayload)), 0);
                    else if (d.initialHistBootstrapInlinePayload.length >= 0)
                        m.initialHistBootstrapInlinePayload = d.initialHistBootstrapInlinePayload;
                }
                if (d.peerDataRequestSessionId != null) {
                    m.peerDataRequestSessionId = String(d.peerDataRequestSessionId);
                }
                if (d.fullHistorySyncOnDemandRequestMetadata != null) {
                    if (typeof d.fullHistorySyncOnDemandRequestMetadata !== "object")
                        throw TypeError(".proto.Message.HistorySyncNotification.fullHistorySyncOnDemandRequestMetadata: object expected");
                    m.fullHistorySyncOnDemandRequestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(d.fullHistorySyncOnDemandRequestMetadata);
                }
                if (d.encHandle != null) {
                    m.encHandle = String(d.encHandle);
                }
                if (d.messageAccessStatus != null) {
                    if (typeof d.messageAccessStatus !== "object")
                        throw TypeError(".proto.Message.HistorySyncNotification.messageAccessStatus: object expected");
                    m.messageAccessStatus = $root.proto.Message.HistorySyncMessageAccessStatus.fromObject(d.messageAccessStatus);
                }
                return m;
            };

            HistorySyncNotification.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                    if (typeof m.fileLength === "number")
                        d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                    else
                        d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                    if (o.oneofs)
                        d._fileLength = "fileLength";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.syncType != null && m.hasOwnProperty("syncType")) {
                    d.syncType = o.enums === String ? $root.proto.Message.HistorySyncType[m.syncType] === undefined ? m.syncType : $root.proto.Message.HistorySyncType[m.syncType] : m.syncType;
                    if (o.oneofs)
                        d._syncType = "syncType";
                }
                if (m.chunkOrder != null && m.hasOwnProperty("chunkOrder")) {
                    d.chunkOrder = m.chunkOrder;
                    if (o.oneofs)
                        d._chunkOrder = "chunkOrder";
                }
                if (m.originalMessageId != null && m.hasOwnProperty("originalMessageId")) {
                    d.originalMessageId = m.originalMessageId;
                    if (o.oneofs)
                        d._originalMessageId = "originalMessageId";
                }
                if (m.progress != null && m.hasOwnProperty("progress")) {
                    d.progress = m.progress;
                    if (o.oneofs)
                        d._progress = "progress";
                }
                if (m.oldestMsgInChunkTimestampSec != null && m.hasOwnProperty("oldestMsgInChunkTimestampSec")) {
                    if (typeof m.oldestMsgInChunkTimestampSec === "number")
                        d.oldestMsgInChunkTimestampSec = o.longs === String ? String(m.oldestMsgInChunkTimestampSec) : m.oldestMsgInChunkTimestampSec;
                    else
                        d.oldestMsgInChunkTimestampSec = o.longs === String ? longToString(m.oldestMsgInChunkTimestampSec) : o.longs === Number ? longToNumber(m.oldestMsgInChunkTimestampSec) : m.oldestMsgInChunkTimestampSec;
                    if (o.oneofs)
                        d._oldestMsgInChunkTimestampSec = "oldestMsgInChunkTimestampSec";
                }
                if (m.initialHistBootstrapInlinePayload != null && m.hasOwnProperty("initialHistBootstrapInlinePayload")) {
                    d.initialHistBootstrapInlinePayload = o.bytes === String ? $util.base64.encode(m.initialHistBootstrapInlinePayload, 0, m.initialHistBootstrapInlinePayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.initialHistBootstrapInlinePayload) : m.initialHistBootstrapInlinePayload;
                    if (o.oneofs)
                        d._initialHistBootstrapInlinePayload = "initialHistBootstrapInlinePayload";
                }
                if (m.peerDataRequestSessionId != null && m.hasOwnProperty("peerDataRequestSessionId")) {
                    d.peerDataRequestSessionId = m.peerDataRequestSessionId;
                    if (o.oneofs)
                        d._peerDataRequestSessionId = "peerDataRequestSessionId";
                }
                if (m.fullHistorySyncOnDemandRequestMetadata != null && m.hasOwnProperty("fullHistorySyncOnDemandRequestMetadata")) {
                    d.fullHistorySyncOnDemandRequestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(m.fullHistorySyncOnDemandRequestMetadata, o);
                    if (o.oneofs)
                        d._fullHistorySyncOnDemandRequestMetadata = "fullHistorySyncOnDemandRequestMetadata";
                }
                if (m.encHandle != null && m.hasOwnProperty("encHandle")) {
                    d.encHandle = m.encHandle;
                    if (o.oneofs)
                        d._encHandle = "encHandle";
                }
                if (m.messageAccessStatus != null && m.hasOwnProperty("messageAccessStatus")) {
                    d.messageAccessStatus = $root.proto.Message.HistorySyncMessageAccessStatus.toObject(m.messageAccessStatus, o);
                    if (o.oneofs)
                        d._messageAccessStatus = "messageAccessStatus";
                }
                return d;
            };

            HistorySyncNotification.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            HistorySyncNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.HistorySyncNotification";
            };

            return HistorySyncNotification;
        })();

        Message.HistorySyncType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "INITIAL_BOOTSTRAP"] = 0;
            values[valuesById[1] = "INITIAL_STATUS_V3"] = 1;
            values[valuesById[2] = "FULL"] = 2;
            values[valuesById[3] = "RECENT"] = 3;
            values[valuesById[4] = "PUSH_NAME"] = 4;
            values[valuesById[5] = "NON_BLOCKING_DATA"] = 5;
            values[valuesById[6] = "ON_DEMAND"] = 6;
            values[valuesById[7] = "NO_HISTORY"] = 7;
            values[valuesById[8] = "MESSAGE_ACCESS_STATUS"] = 8;
            return values;
        })();

        Message.ImageMessage = (function() {

            function ImageMessage(p) {
                this.interactiveAnnotations = [];
                this.scanLengths = [];
                this.annotations = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ImageMessage.prototype.url = null;
            ImageMessage.prototype.mimetype = null;
            ImageMessage.prototype.caption = null;
            ImageMessage.prototype.fileSha256 = null;
            ImageMessage.prototype.fileLength = null;
            ImageMessage.prototype.height = null;
            ImageMessage.prototype.width = null;
            ImageMessage.prototype.mediaKey = null;
            ImageMessage.prototype.fileEncSha256 = null;
            ImageMessage.prototype.interactiveAnnotations = $util.emptyArray;
            ImageMessage.prototype.directPath = null;
            ImageMessage.prototype.mediaKeyTimestamp = null;
            ImageMessage.prototype.jpegThumbnail = null;
            ImageMessage.prototype.contextInfo = null;
            ImageMessage.prototype.firstScanSidecar = null;
            ImageMessage.prototype.firstScanLength = null;
            ImageMessage.prototype.experimentGroupId = null;
            ImageMessage.prototype.scansSidecar = null;
            ImageMessage.prototype.scanLengths = $util.emptyArray;
            ImageMessage.prototype.midQualityFileSha256 = null;
            ImageMessage.prototype.midQualityFileEncSha256 = null;
            ImageMessage.prototype.viewOnce = null;
            ImageMessage.prototype.thumbnailDirectPath = null;
            ImageMessage.prototype.thumbnailSha256 = null;
            ImageMessage.prototype.thumbnailEncSha256 = null;
            ImageMessage.prototype.staticUrl = null;
            ImageMessage.prototype.annotations = $util.emptyArray;
            ImageMessage.prototype.imageSourceType = null;
            ImageMessage.prototype.accessibilityLabel = null;
            ImageMessage.prototype.mediaKeyDomain = null;
            ImageMessage.prototype.qrUrl = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_mimetype", {
                get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_fileLength", {
                get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_height", {
                get: $util.oneOfGetter($oneOfFields = ["height"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_width", {
                get: $util.oneOfGetter($oneOfFields = ["width"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_firstScanSidecar", {
                get: $util.oneOfGetter($oneOfFields = ["firstScanSidecar"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_firstScanLength", {
                get: $util.oneOfGetter($oneOfFields = ["firstScanLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_experimentGroupId", {
                get: $util.oneOfGetter($oneOfFields = ["experimentGroupId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_scansSidecar", {
                get: $util.oneOfGetter($oneOfFields = ["scansSidecar"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_midQualityFileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["midQualityFileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_midQualityFileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["midQualityFileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_viewOnce", {
                get: $util.oneOfGetter($oneOfFields = ["viewOnce"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_thumbnailDirectPath", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_thumbnailSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_thumbnailEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_staticUrl", {
                get: $util.oneOfGetter($oneOfFields = ["staticUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_imageSourceType", {
                get: $util.oneOfGetter($oneOfFields = ["imageSourceType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_accessibilityLabel", {
                get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_mediaKeyDomain", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyDomain"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ImageMessage.prototype, "_qrUrl", {
                get: $util.oneOfGetter($oneOfFields = ["qrUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ImageMessage.create = function create(properties) {
                return new ImageMessage(properties);
            };

            ImageMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(10).string(m.url);
                if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                    w.uint32(18).string(m.mimetype);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(26).string(m.caption);
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(34).bytes(m.fileSha256);
                if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                    w.uint32(40).uint64(m.fileLength);
                if (m.height != null && Object.hasOwnProperty.call(m, "height"))
                    w.uint32(48).uint32(m.height);
                if (m.width != null && Object.hasOwnProperty.call(m, "width"))
                    w.uint32(56).uint32(m.width);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(66).bytes(m.mediaKey);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(74).bytes(m.fileEncSha256);
                if (m.interactiveAnnotations != null && m.interactiveAnnotations.length) {
                    for (var i = 0; i < m.interactiveAnnotations.length; ++i)
                        $root.proto.InteractiveAnnotation.encode(m.interactiveAnnotations[i], w.uint32(82).fork()).ldelim();
                }
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(90).string(m.directPath);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(96).int64(m.mediaKeyTimestamp);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(130).bytes(m.jpegThumbnail);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                if (m.firstScanSidecar != null && Object.hasOwnProperty.call(m, "firstScanSidecar"))
                    w.uint32(146).bytes(m.firstScanSidecar);
                if (m.firstScanLength != null && Object.hasOwnProperty.call(m, "firstScanLength"))
                    w.uint32(152).uint32(m.firstScanLength);
                if (m.experimentGroupId != null && Object.hasOwnProperty.call(m, "experimentGroupId"))
                    w.uint32(160).uint32(m.experimentGroupId);
                if (m.scansSidecar != null && Object.hasOwnProperty.call(m, "scansSidecar"))
                    w.uint32(170).bytes(m.scansSidecar);
                if (m.scanLengths != null && m.scanLengths.length) {
                    w.uint32(178).fork();
                    for (var i = 0; i < m.scanLengths.length; ++i)
                        w.uint32(m.scanLengths[i]);
                    w.ldelim();
                }
                if (m.midQualityFileSha256 != null && Object.hasOwnProperty.call(m, "midQualityFileSha256"))
                    w.uint32(186).bytes(m.midQualityFileSha256);
                if (m.midQualityFileEncSha256 != null && Object.hasOwnProperty.call(m, "midQualityFileEncSha256"))
                    w.uint32(194).bytes(m.midQualityFileEncSha256);
                if (m.viewOnce != null && Object.hasOwnProperty.call(m, "viewOnce"))
                    w.uint32(200).bool(m.viewOnce);
                if (m.thumbnailDirectPath != null && Object.hasOwnProperty.call(m, "thumbnailDirectPath"))
                    w.uint32(210).string(m.thumbnailDirectPath);
                if (m.thumbnailSha256 != null && Object.hasOwnProperty.call(m, "thumbnailSha256"))
                    w.uint32(218).bytes(m.thumbnailSha256);
                if (m.thumbnailEncSha256 != null && Object.hasOwnProperty.call(m, "thumbnailEncSha256"))
                    w.uint32(226).bytes(m.thumbnailEncSha256);
                if (m.staticUrl != null && Object.hasOwnProperty.call(m, "staticUrl"))
                    w.uint32(234).string(m.staticUrl);
                if (m.annotations != null && m.annotations.length) {
                    for (var i = 0; i < m.annotations.length; ++i)
                        $root.proto.InteractiveAnnotation.encode(m.annotations[i], w.uint32(242).fork()).ldelim();
                }
                if (m.imageSourceType != null && Object.hasOwnProperty.call(m, "imageSourceType"))
                    w.uint32(248).int32(m.imageSourceType);
                if (m.accessibilityLabel != null && Object.hasOwnProperty.call(m, "accessibilityLabel"))
                    w.uint32(258).string(m.accessibilityLabel);
                if (m.mediaKeyDomain != null && Object.hasOwnProperty.call(m, "mediaKeyDomain"))
                    w.uint32(264).int32(m.mediaKeyDomain);
                if (m.qrUrl != null && Object.hasOwnProperty.call(m, "qrUrl"))
                    w.uint32(274).string(m.qrUrl);
                return w;
            };

            ImageMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ImageMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.url = r.string();
                            break;
                        }
                    case 2: {
                            m.mimetype = r.string();
                            break;
                        }
                    case 3: {
                            m.caption = r.string();
                            break;
                        }
                    case 4: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 5: {
                            m.fileLength = r.uint64();
                            break;
                        }
                    case 6: {
                            m.height = r.uint32();
                            break;
                        }
                    case 7: {
                            m.width = r.uint32();
                            break;
                        }
                    case 8: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 9: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 10: {
                            if (!(m.interactiveAnnotations && m.interactiveAnnotations.length))
                                m.interactiveAnnotations = [];
                            m.interactiveAnnotations.push($root.proto.InteractiveAnnotation.decode(r, r.uint32()));
                            break;
                        }
                    case 11: {
                            m.directPath = r.string();
                            break;
                        }
                    case 12: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 16: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 18: {
                            m.firstScanSidecar = r.bytes();
                            break;
                        }
                    case 19: {
                            m.firstScanLength = r.uint32();
                            break;
                        }
                    case 20: {
                            m.experimentGroupId = r.uint32();
                            break;
                        }
                    case 21: {
                            m.scansSidecar = r.bytes();
                            break;
                        }
                    case 22: {
                            if (!(m.scanLengths && m.scanLengths.length))
                                m.scanLengths = [];
                            if ((t & 7) === 2) {
                                var c2 = r.uint32() + r.pos;
                                while (r.pos < c2)
                                    m.scanLengths.push(r.uint32());
                            } else
                                m.scanLengths.push(r.uint32());
                            break;
                        }
                    case 23: {
                            m.midQualityFileSha256 = r.bytes();
                            break;
                        }
                    case 24: {
                            m.midQualityFileEncSha256 = r.bytes();
                            break;
                        }
                    case 25: {
                            m.viewOnce = r.bool();
                            break;
                        }
                    case 26: {
                            m.thumbnailDirectPath = r.string();
                            break;
                        }
                    case 27: {
                            m.thumbnailSha256 = r.bytes();
                            break;
                        }
                    case 28: {
                            m.thumbnailEncSha256 = r.bytes();
                            break;
                        }
                    case 29: {
                            m.staticUrl = r.string();
                            break;
                        }
                    case 30: {
                            if (!(m.annotations && m.annotations.length))
                                m.annotations = [];
                            m.annotations.push($root.proto.InteractiveAnnotation.decode(r, r.uint32()));
                            break;
                        }
                    case 31: {
                            m.imageSourceType = r.int32();
                            break;
                        }
                    case 32: {
                            m.accessibilityLabel = r.string();
                            break;
                        }
                    case 33: {
                            m.mediaKeyDomain = r.int32();
                            break;
                        }
                    case 34: {
                            m.qrUrl = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ImageMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ImageMessage)
                    return d;
                var m = new $root.proto.Message.ImageMessage();
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.mimetype != null) {
                    m.mimetype = String(d.mimetype);
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.fileLength != null) {
                    if ($util.Long)
                        (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                    else if (typeof d.fileLength === "string")
                        m.fileLength = parseInt(d.fileLength, 10);
                    else if (typeof d.fileLength === "number")
                        m.fileLength = d.fileLength;
                    else if (typeof d.fileLength === "object")
                        m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
                }
                if (d.height != null) {
                    m.height = d.height >>> 0;
                }
                if (d.width != null) {
                    m.width = d.width >>> 0;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.interactiveAnnotations) {
                    if (!Array.isArray(d.interactiveAnnotations))
                        throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: array expected");
                    m.interactiveAnnotations = [];
                    for (var i = 0; i < d.interactiveAnnotations.length; ++i) {
                        if (typeof d.interactiveAnnotations[i] !== "object")
                            throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: object expected");
                        m.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(d.interactiveAnnotations[i]);
                    }
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ImageMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.firstScanSidecar != null) {
                    if (typeof d.firstScanSidecar === "string")
                        $util.base64.decode(d.firstScanSidecar, m.firstScanSidecar = $util.newBuffer($util.base64.length(d.firstScanSidecar)), 0);
                    else if (d.firstScanSidecar.length >= 0)
                        m.firstScanSidecar = d.firstScanSidecar;
                }
                if (d.firstScanLength != null) {
                    m.firstScanLength = d.firstScanLength >>> 0;
                }
                if (d.experimentGroupId != null) {
                    m.experimentGroupId = d.experimentGroupId >>> 0;
                }
                if (d.scansSidecar != null) {
                    if (typeof d.scansSidecar === "string")
                        $util.base64.decode(d.scansSidecar, m.scansSidecar = $util.newBuffer($util.base64.length(d.scansSidecar)), 0);
                    else if (d.scansSidecar.length >= 0)
                        m.scansSidecar = d.scansSidecar;
                }
                if (d.scanLengths) {
                    if (!Array.isArray(d.scanLengths))
                        throw TypeError(".proto.Message.ImageMessage.scanLengths: array expected");
                    m.scanLengths = [];
                    for (var i = 0; i < d.scanLengths.length; ++i) {
                        m.scanLengths[i] = d.scanLengths[i] >>> 0;
                    }
                }
                if (d.midQualityFileSha256 != null) {
                    if (typeof d.midQualityFileSha256 === "string")
                        $util.base64.decode(d.midQualityFileSha256, m.midQualityFileSha256 = $util.newBuffer($util.base64.length(d.midQualityFileSha256)), 0);
                    else if (d.midQualityFileSha256.length >= 0)
                        m.midQualityFileSha256 = d.midQualityFileSha256;
                }
                if (d.midQualityFileEncSha256 != null) {
                    if (typeof d.midQualityFileEncSha256 === "string")
                        $util.base64.decode(d.midQualityFileEncSha256, m.midQualityFileEncSha256 = $util.newBuffer($util.base64.length(d.midQualityFileEncSha256)), 0);
                    else if (d.midQualityFileEncSha256.length >= 0)
                        m.midQualityFileEncSha256 = d.midQualityFileEncSha256;
                }
                if (d.viewOnce != null) {
                    m.viewOnce = Boolean(d.viewOnce);
                }
                if (d.thumbnailDirectPath != null) {
                    m.thumbnailDirectPath = String(d.thumbnailDirectPath);
                }
                if (d.thumbnailSha256 != null) {
                    if (typeof d.thumbnailSha256 === "string")
                        $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0);
                    else if (d.thumbnailSha256.length >= 0)
                        m.thumbnailSha256 = d.thumbnailSha256;
                }
                if (d.thumbnailEncSha256 != null) {
                    if (typeof d.thumbnailEncSha256 === "string")
                        $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0);
                    else if (d.thumbnailEncSha256.length >= 0)
                        m.thumbnailEncSha256 = d.thumbnailEncSha256;
                }
                if (d.staticUrl != null) {
                    m.staticUrl = String(d.staticUrl);
                }
                if (d.annotations) {
                    if (!Array.isArray(d.annotations))
                        throw TypeError(".proto.Message.ImageMessage.annotations: array expected");
                    m.annotations = [];
                    for (var i = 0; i < d.annotations.length; ++i) {
                        if (typeof d.annotations[i] !== "object")
                            throw TypeError(".proto.Message.ImageMessage.annotations: object expected");
                        m.annotations[i] = $root.proto.InteractiveAnnotation.fromObject(d.annotations[i]);
                    }
                }
                switch (d.imageSourceType) {
                default:
                    if (typeof d.imageSourceType === "number") {
                        m.imageSourceType = d.imageSourceType;
                        break;
                    }
                    break;
                case "USER_IMAGE":
                case 0:
                    m.imageSourceType = 0;
                    break;
                case "AI_GENERATED":
                case 1:
                    m.imageSourceType = 1;
                    break;
                case "AI_MODIFIED":
                case 2:
                    m.imageSourceType = 2;
                    break;
                case "RASTERIZED_TEXT_STATUS":
                case 3:
                    m.imageSourceType = 3;
                    break;
                }
                if (d.accessibilityLabel != null) {
                    m.accessibilityLabel = String(d.accessibilityLabel);
                }
                switch (d.mediaKeyDomain) {
                default:
                    if (typeof d.mediaKeyDomain === "number") {
                        m.mediaKeyDomain = d.mediaKeyDomain;
                        break;
                    }
                    break;
                case "UNSET":
                case 0:
                    m.mediaKeyDomain = 0;
                    break;
                case "E2EE_CHAT":
                case 1:
                    m.mediaKeyDomain = 1;
                    break;
                case "STATUS":
                case 2:
                    m.mediaKeyDomain = 2;
                    break;
                case "CAPI":
                case 3:
                    m.mediaKeyDomain = 3;
                    break;
                case "BOT":
                case 4:
                    m.mediaKeyDomain = 4;
                    break;
                }
                if (d.qrUrl != null) {
                    m.qrUrl = String(d.qrUrl);
                }
                return m;
            };

            ImageMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.interactiveAnnotations = [];
                    d.scanLengths = [];
                    d.annotations = [];
                }
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                    d.mimetype = m.mimetype;
                    if (o.oneofs)
                        d._mimetype = "mimetype";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                    if (typeof m.fileLength === "number")
                        d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                    else
                        d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                    if (o.oneofs)
                        d._fileLength = "fileLength";
                }
                if (m.height != null && m.hasOwnProperty("height")) {
                    d.height = m.height;
                    if (o.oneofs)
                        d._height = "height";
                }
                if (m.width != null && m.hasOwnProperty("width")) {
                    d.width = m.width;
                    if (o.oneofs)
                        d._width = "width";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.interactiveAnnotations && m.interactiveAnnotations.length) {
                    d.interactiveAnnotations = [];
                    for (var j = 0; j < m.interactiveAnnotations.length; ++j) {
                        d.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(m.interactiveAnnotations[j], o);
                    }
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.firstScanSidecar != null && m.hasOwnProperty("firstScanSidecar")) {
                    d.firstScanSidecar = o.bytes === String ? $util.base64.encode(m.firstScanSidecar, 0, m.firstScanSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.firstScanSidecar) : m.firstScanSidecar;
                    if (o.oneofs)
                        d._firstScanSidecar = "firstScanSidecar";
                }
                if (m.firstScanLength != null && m.hasOwnProperty("firstScanLength")) {
                    d.firstScanLength = m.firstScanLength;
                    if (o.oneofs)
                        d._firstScanLength = "firstScanLength";
                }
                if (m.experimentGroupId != null && m.hasOwnProperty("experimentGroupId")) {
                    d.experimentGroupId = m.experimentGroupId;
                    if (o.oneofs)
                        d._experimentGroupId = "experimentGroupId";
                }
                if (m.scansSidecar != null && m.hasOwnProperty("scansSidecar")) {
                    d.scansSidecar = o.bytes === String ? $util.base64.encode(m.scansSidecar, 0, m.scansSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.scansSidecar) : m.scansSidecar;
                    if (o.oneofs)
                        d._scansSidecar = "scansSidecar";
                }
                if (m.scanLengths && m.scanLengths.length) {
                    d.scanLengths = [];
                    for (var j = 0; j < m.scanLengths.length; ++j) {
                        d.scanLengths[j] = m.scanLengths[j];
                    }
                }
                if (m.midQualityFileSha256 != null && m.hasOwnProperty("midQualityFileSha256")) {
                    d.midQualityFileSha256 = o.bytes === String ? $util.base64.encode(m.midQualityFileSha256, 0, m.midQualityFileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.midQualityFileSha256) : m.midQualityFileSha256;
                    if (o.oneofs)
                        d._midQualityFileSha256 = "midQualityFileSha256";
                }
                if (m.midQualityFileEncSha256 != null && m.hasOwnProperty("midQualityFileEncSha256")) {
                    d.midQualityFileEncSha256 = o.bytes === String ? $util.base64.encode(m.midQualityFileEncSha256, 0, m.midQualityFileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.midQualityFileEncSha256) : m.midQualityFileEncSha256;
                    if (o.oneofs)
                        d._midQualityFileEncSha256 = "midQualityFileEncSha256";
                }
                if (m.viewOnce != null && m.hasOwnProperty("viewOnce")) {
                    d.viewOnce = m.viewOnce;
                    if (o.oneofs)
                        d._viewOnce = "viewOnce";
                }
                if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) {
                    d.thumbnailDirectPath = m.thumbnailDirectPath;
                    if (o.oneofs)
                        d._thumbnailDirectPath = "thumbnailDirectPath";
                }
                if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) {
                    d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256;
                    if (o.oneofs)
                        d._thumbnailSha256 = "thumbnailSha256";
                }
                if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) {
                    d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256;
                    if (o.oneofs)
                        d._thumbnailEncSha256 = "thumbnailEncSha256";
                }
                if (m.staticUrl != null && m.hasOwnProperty("staticUrl")) {
                    d.staticUrl = m.staticUrl;
                    if (o.oneofs)
                        d._staticUrl = "staticUrl";
                }
                if (m.annotations && m.annotations.length) {
                    d.annotations = [];
                    for (var j = 0; j < m.annotations.length; ++j) {
                        d.annotations[j] = $root.proto.InteractiveAnnotation.toObject(m.annotations[j], o);
                    }
                }
                if (m.imageSourceType != null && m.hasOwnProperty("imageSourceType")) {
                    d.imageSourceType = o.enums === String ? $root.proto.Message.ImageMessage.ImageSourceType[m.imageSourceType] === undefined ? m.imageSourceType : $root.proto.Message.ImageMessage.ImageSourceType[m.imageSourceType] : m.imageSourceType;
                    if (o.oneofs)
                        d._imageSourceType = "imageSourceType";
                }
                if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) {
                    d.accessibilityLabel = m.accessibilityLabel;
                    if (o.oneofs)
                        d._accessibilityLabel = "accessibilityLabel";
                }
                if (m.mediaKeyDomain != null && m.hasOwnProperty("mediaKeyDomain")) {
                    d.mediaKeyDomain = o.enums === String ? $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] === undefined ? m.mediaKeyDomain : $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] : m.mediaKeyDomain;
                    if (o.oneofs)
                        d._mediaKeyDomain = "mediaKeyDomain";
                }
                if (m.qrUrl != null && m.hasOwnProperty("qrUrl")) {
                    d.qrUrl = m.qrUrl;
                    if (o.oneofs)
                        d._qrUrl = "qrUrl";
                }
                return d;
            };

            ImageMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ImageMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ImageMessage";
            };

            ImageMessage.ImageSourceType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "USER_IMAGE"] = 0;
                values[valuesById[1] = "AI_GENERATED"] = 1;
                values[valuesById[2] = "AI_MODIFIED"] = 2;
                values[valuesById[3] = "RASTERIZED_TEXT_STATUS"] = 3;
                return values;
            })();

            return ImageMessage;
        })();

        Message.InitialSecurityNotificationSettingSync = (function() {

            function InitialSecurityNotificationSettingSync(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InitialSecurityNotificationSettingSync.prototype.securityNotificationEnabled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InitialSecurityNotificationSettingSync.prototype, "_securityNotificationEnabled", {
                get: $util.oneOfGetter($oneOfFields = ["securityNotificationEnabled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            InitialSecurityNotificationSettingSync.create = function create(properties) {
                return new InitialSecurityNotificationSettingSync(properties);
            };

            InitialSecurityNotificationSettingSync.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.securityNotificationEnabled != null && Object.hasOwnProperty.call(m, "securityNotificationEnabled"))
                    w.uint32(8).bool(m.securityNotificationEnabled);
                return w;
            };

            InitialSecurityNotificationSettingSync.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InitialSecurityNotificationSettingSync();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.securityNotificationEnabled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InitialSecurityNotificationSettingSync.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.InitialSecurityNotificationSettingSync)
                    return d;
                var m = new $root.proto.Message.InitialSecurityNotificationSettingSync();
                if (d.securityNotificationEnabled != null) {
                    m.securityNotificationEnabled = Boolean(d.securityNotificationEnabled);
                }
                return m;
            };

            InitialSecurityNotificationSettingSync.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.securityNotificationEnabled != null && m.hasOwnProperty("securityNotificationEnabled")) {
                    d.securityNotificationEnabled = m.securityNotificationEnabled;
                    if (o.oneofs)
                        d._securityNotificationEnabled = "securityNotificationEnabled";
                }
                return d;
            };

            InitialSecurityNotificationSettingSync.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InitialSecurityNotificationSettingSync.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.InitialSecurityNotificationSettingSync";
            };

            return InitialSecurityNotificationSettingSync;
        })();

        Message.InteractiveMessage = (function() {

            function InteractiveMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InteractiveMessage.prototype.header = null;
            InteractiveMessage.prototype.body = null;
            InteractiveMessage.prototype.footer = null;
            InteractiveMessage.prototype.contextInfo = null;
            InteractiveMessage.prototype.urlTrackingMap = null;
            InteractiveMessage.prototype.shopStorefrontMessage = null;
            InteractiveMessage.prototype.collectionMessage = null;
            InteractiveMessage.prototype.nativeFlowMessage = null;
            InteractiveMessage.prototype.carouselMessage = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteractiveMessage.prototype, "_header", {
                get: $util.oneOfGetter($oneOfFields = ["header"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteractiveMessage.prototype, "_body", {
                get: $util.oneOfGetter($oneOfFields = ["body"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteractiveMessage.prototype, "_footer", {
                get: $util.oneOfGetter($oneOfFields = ["footer"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteractiveMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteractiveMessage.prototype, "_urlTrackingMap", {
                get: $util.oneOfGetter($oneOfFields = ["urlTrackingMap"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Object.defineProperty(InteractiveMessage.prototype, "interactiveMessage", {
                get: $util.oneOfGetter($oneOfFields = ["shopStorefrontMessage", "collectionMessage", "nativeFlowMessage", "carouselMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            InteractiveMessage.create = function create(properties) {
                return new InteractiveMessage(properties);
            };

            InteractiveMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.header != null && Object.hasOwnProperty.call(m, "header"))
                    $root.proto.Message.InteractiveMessage.Header.encode(m.header, w.uint32(10).fork()).ldelim();
                if (m.body != null && Object.hasOwnProperty.call(m, "body"))
                    $root.proto.Message.InteractiveMessage.Body.encode(m.body, w.uint32(18).fork()).ldelim();
                if (m.footer != null && Object.hasOwnProperty.call(m, "footer"))
                    $root.proto.Message.InteractiveMessage.Footer.encode(m.footer, w.uint32(26).fork()).ldelim();
                if (m.shopStorefrontMessage != null && Object.hasOwnProperty.call(m, "shopStorefrontMessage"))
                    $root.proto.Message.InteractiveMessage.ShopMessage.encode(m.shopStorefrontMessage, w.uint32(34).fork()).ldelim();
                if (m.collectionMessage != null && Object.hasOwnProperty.call(m, "collectionMessage"))
                    $root.proto.Message.InteractiveMessage.CollectionMessage.encode(m.collectionMessage, w.uint32(42).fork()).ldelim();
                if (m.nativeFlowMessage != null && Object.hasOwnProperty.call(m, "nativeFlowMessage"))
                    $root.proto.Message.InteractiveMessage.NativeFlowMessage.encode(m.nativeFlowMessage, w.uint32(50).fork()).ldelim();
                if (m.carouselMessage != null && Object.hasOwnProperty.call(m, "carouselMessage"))
                    $root.proto.Message.InteractiveMessage.CarouselMessage.encode(m.carouselMessage, w.uint32(58).fork()).ldelim();
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(122).fork()).ldelim();
                if (m.urlTrackingMap != null && Object.hasOwnProperty.call(m, "urlTrackingMap"))
                    $root.proto.UrlTrackingMap.encode(m.urlTrackingMap, w.uint32(130).fork()).ldelim();
                return w;
            };

            InteractiveMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.header = $root.proto.Message.InteractiveMessage.Header.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.body = $root.proto.Message.InteractiveMessage.Body.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.footer = $root.proto.Message.InteractiveMessage.Footer.decode(r, r.uint32());
                            break;
                        }
                    case 15: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 16: {
                            m.urlTrackingMap = $root.proto.UrlTrackingMap.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.shopStorefrontMessage = $root.proto.Message.InteractiveMessage.ShopMessage.decode(r, r.uint32());
                            break;
                        }
                    case 5: {
                            m.collectionMessage = $root.proto.Message.InteractiveMessage.CollectionMessage.decode(r, r.uint32());
                            break;
                        }
                    case 6: {
                            m.nativeFlowMessage = $root.proto.Message.InteractiveMessage.NativeFlowMessage.decode(r, r.uint32());
                            break;
                        }
                    case 7: {
                            m.carouselMessage = $root.proto.Message.InteractiveMessage.CarouselMessage.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InteractiveMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.InteractiveMessage)
                    return d;
                var m = new $root.proto.Message.InteractiveMessage();
                if (d.header != null) {
                    if (typeof d.header !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.header: object expected");
                    m.header = $root.proto.Message.InteractiveMessage.Header.fromObject(d.header);
                }
                if (d.body != null) {
                    if (typeof d.body !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.body: object expected");
                    m.body = $root.proto.Message.InteractiveMessage.Body.fromObject(d.body);
                }
                if (d.footer != null) {
                    if (typeof d.footer !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.footer: object expected");
                    m.footer = $root.proto.Message.InteractiveMessage.Footer.fromObject(d.footer);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.urlTrackingMap != null) {
                    if (typeof d.urlTrackingMap !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.urlTrackingMap: object expected");
                    m.urlTrackingMap = $root.proto.UrlTrackingMap.fromObject(d.urlTrackingMap);
                }
                if (d.shopStorefrontMessage != null) {
                    if (typeof d.shopStorefrontMessage !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.shopStorefrontMessage: object expected");
                    m.shopStorefrontMessage = $root.proto.Message.InteractiveMessage.ShopMessage.fromObject(d.shopStorefrontMessage);
                }
                if (d.collectionMessage != null) {
                    if (typeof d.collectionMessage !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.collectionMessage: object expected");
                    m.collectionMessage = $root.proto.Message.InteractiveMessage.CollectionMessage.fromObject(d.collectionMessage);
                }
                if (d.nativeFlowMessage != null) {
                    if (typeof d.nativeFlowMessage !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.nativeFlowMessage: object expected");
                    m.nativeFlowMessage = $root.proto.Message.InteractiveMessage.NativeFlowMessage.fromObject(d.nativeFlowMessage);
                }
                if (d.carouselMessage != null) {
                    if (typeof d.carouselMessage !== "object")
                        throw TypeError(".proto.Message.InteractiveMessage.carouselMessage: object expected");
                    m.carouselMessage = $root.proto.Message.InteractiveMessage.CarouselMessage.fromObject(d.carouselMessage);
                }
                return m;
            };

            InteractiveMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.header != null && m.hasOwnProperty("header")) {
                    d.header = $root.proto.Message.InteractiveMessage.Header.toObject(m.header, o);
                    if (o.oneofs)
                        d._header = "header";
                }
                if (m.body != null && m.hasOwnProperty("body")) {
                    d.body = $root.proto.Message.InteractiveMessage.Body.toObject(m.body, o);
                    if (o.oneofs)
                        d._body = "body";
                }
                if (m.footer != null && m.hasOwnProperty("footer")) {
                    d.footer = $root.proto.Message.InteractiveMessage.Footer.toObject(m.footer, o);
                    if (o.oneofs)
                        d._footer = "footer";
                }
                if (m.shopStorefrontMessage != null && m.hasOwnProperty("shopStorefrontMessage")) {
                    d.shopStorefrontMessage = $root.proto.Message.InteractiveMessage.ShopMessage.toObject(m.shopStorefrontMessage, o);
                    if (o.oneofs)
                        d.interactiveMessage = "shopStorefrontMessage";
                }
                if (m.collectionMessage != null && m.hasOwnProperty("collectionMessage")) {
                    d.collectionMessage = $root.proto.Message.InteractiveMessage.CollectionMessage.toObject(m.collectionMessage, o);
                    if (o.oneofs)
                        d.interactiveMessage = "collectionMessage";
                }
                if (m.nativeFlowMessage != null && m.hasOwnProperty("nativeFlowMessage")) {
                    d.nativeFlowMessage = $root.proto.Message.InteractiveMessage.NativeFlowMessage.toObject(m.nativeFlowMessage, o);
                    if (o.oneofs)
                        d.interactiveMessage = "nativeFlowMessage";
                }
                if (m.carouselMessage != null && m.hasOwnProperty("carouselMessage")) {
                    d.carouselMessage = $root.proto.Message.InteractiveMessage.CarouselMessage.toObject(m.carouselMessage, o);
                    if (o.oneofs)
                        d.interactiveMessage = "carouselMessage";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.urlTrackingMap != null && m.hasOwnProperty("urlTrackingMap")) {
                    d.urlTrackingMap = $root.proto.UrlTrackingMap.toObject(m.urlTrackingMap, o);
                    if (o.oneofs)
                        d._urlTrackingMap = "urlTrackingMap";
                }
                return d;
            };

            InteractiveMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InteractiveMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.InteractiveMessage";
            };

            InteractiveMessage.Body = (function() {

                function Body(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Body.prototype.text = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Body.prototype, "_text", {
                    get: $util.oneOfGetter($oneOfFields = ["text"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Body.create = function create(properties) {
                    return new Body(properties);
                };

                Body.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                        w.uint32(10).string(m.text);
                    return w;
                };

                Body.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage.Body();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.text = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Body.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveMessage.Body)
                        return d;
                    var m = new $root.proto.Message.InteractiveMessage.Body();
                    if (d.text != null) {
                        m.text = String(d.text);
                    }
                    return m;
                };

                Body.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.text != null && m.hasOwnProperty("text")) {
                        d.text = m.text;
                        if (o.oneofs)
                            d._text = "text";
                    }
                    return d;
                };

                Body.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveMessage.Body";
                };

                return Body;
            })();

            InteractiveMessage.CarouselMessage = (function() {

                function CarouselMessage(p) {
                    this.cards = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                CarouselMessage.prototype.cards = $util.emptyArray;
                CarouselMessage.prototype.messageVersion = null;
                CarouselMessage.prototype.carouselCardType = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CarouselMessage.prototype, "_messageVersion", {
                    get: $util.oneOfGetter($oneOfFields = ["messageVersion"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CarouselMessage.prototype, "_carouselCardType", {
                    get: $util.oneOfGetter($oneOfFields = ["carouselCardType"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                CarouselMessage.create = function create(properties) {
                    return new CarouselMessage(properties);
                };

                CarouselMessage.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.cards != null && m.cards.length) {
                        for (var i = 0; i < m.cards.length; ++i)
                            $root.proto.Message.InteractiveMessage.encode(m.cards[i], w.uint32(10).fork()).ldelim();
                    }
                    if (m.messageVersion != null && Object.hasOwnProperty.call(m, "messageVersion"))
                        w.uint32(16).int32(m.messageVersion);
                    if (m.carouselCardType != null && Object.hasOwnProperty.call(m, "carouselCardType"))
                        w.uint32(24).int32(m.carouselCardType);
                    return w;
                };

                CarouselMessage.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage.CarouselMessage();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                if (!(m.cards && m.cards.length))
                                    m.cards = [];
                                m.cards.push($root.proto.Message.InteractiveMessage.decode(r, r.uint32()));
                                break;
                            }
                        case 2: {
                                m.messageVersion = r.int32();
                                break;
                            }
                        case 3: {
                                m.carouselCardType = r.int32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                CarouselMessage.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveMessage.CarouselMessage)
                        return d;
                    var m = new $root.proto.Message.InteractiveMessage.CarouselMessage();
                    if (d.cards) {
                        if (!Array.isArray(d.cards))
                            throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: array expected");
                        m.cards = [];
                        for (var i = 0; i < d.cards.length; ++i) {
                            if (typeof d.cards[i] !== "object")
                                throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: object expected");
                            m.cards[i] = $root.proto.Message.InteractiveMessage.fromObject(d.cards[i]);
                        }
                    }
                    if (d.messageVersion != null) {
                        m.messageVersion = d.messageVersion | 0;
                    }
                    switch (d.carouselCardType) {
                    default:
                        if (typeof d.carouselCardType === "number") {
                            m.carouselCardType = d.carouselCardType;
                            break;
                        }
                        break;
                    case "UNKNOWN":
                    case 0:
                        m.carouselCardType = 0;
                        break;
                    case "HSCROLL_CARDS":
                    case 1:
                        m.carouselCardType = 1;
                        break;
                    case "ALBUM_IMAGE":
                    case 2:
                        m.carouselCardType = 2;
                        break;
                    }
                    return m;
                };

                CarouselMessage.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.cards = [];
                    }
                    if (m.cards && m.cards.length) {
                        d.cards = [];
                        for (var j = 0; j < m.cards.length; ++j) {
                            d.cards[j] = $root.proto.Message.InteractiveMessage.toObject(m.cards[j], o);
                        }
                    }
                    if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) {
                        d.messageVersion = m.messageVersion;
                        if (o.oneofs)
                            d._messageVersion = "messageVersion";
                    }
                    if (m.carouselCardType != null && m.hasOwnProperty("carouselCardType")) {
                        d.carouselCardType = o.enums === String ? $root.proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType[m.carouselCardType] === undefined ? m.carouselCardType : $root.proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType[m.carouselCardType] : m.carouselCardType;
                        if (o.oneofs)
                            d._carouselCardType = "carouselCardType";
                    }
                    return d;
                };

                CarouselMessage.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                CarouselMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveMessage.CarouselMessage";
                };

                CarouselMessage.CarouselCardType = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "UNKNOWN"] = 0;
                    values[valuesById[1] = "HSCROLL_CARDS"] = 1;
                    values[valuesById[2] = "ALBUM_IMAGE"] = 2;
                    return values;
                })();

                return CarouselMessage;
            })();

            InteractiveMessage.CollectionMessage = (function() {

                function CollectionMessage(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                CollectionMessage.prototype.bizJid = null;
                CollectionMessage.prototype.id = null;
                CollectionMessage.prototype.messageVersion = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CollectionMessage.prototype, "_bizJid", {
                    get: $util.oneOfGetter($oneOfFields = ["bizJid"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CollectionMessage.prototype, "_id", {
                    get: $util.oneOfGetter($oneOfFields = ["id"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CollectionMessage.prototype, "_messageVersion", {
                    get: $util.oneOfGetter($oneOfFields = ["messageVersion"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                CollectionMessage.create = function create(properties) {
                    return new CollectionMessage(properties);
                };

                CollectionMessage.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.bizJid != null && Object.hasOwnProperty.call(m, "bizJid"))
                        w.uint32(10).string(m.bizJid);
                    if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                        w.uint32(18).string(m.id);
                    if (m.messageVersion != null && Object.hasOwnProperty.call(m, "messageVersion"))
                        w.uint32(24).int32(m.messageVersion);
                    return w;
                };

                CollectionMessage.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage.CollectionMessage();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.bizJid = r.string();
                                break;
                            }
                        case 2: {
                                m.id = r.string();
                                break;
                            }
                        case 3: {
                                m.messageVersion = r.int32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                CollectionMessage.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveMessage.CollectionMessage)
                        return d;
                    var m = new $root.proto.Message.InteractiveMessage.CollectionMessage();
                    if (d.bizJid != null) {
                        m.bizJid = String(d.bizJid);
                    }
                    if (d.id != null) {
                        m.id = String(d.id);
                    }
                    if (d.messageVersion != null) {
                        m.messageVersion = d.messageVersion | 0;
                    }
                    return m;
                };

                CollectionMessage.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.bizJid != null && m.hasOwnProperty("bizJid")) {
                        d.bizJid = m.bizJid;
                        if (o.oneofs)
                            d._bizJid = "bizJid";
                    }
                    if (m.id != null && m.hasOwnProperty("id")) {
                        d.id = m.id;
                        if (o.oneofs)
                            d._id = "id";
                    }
                    if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) {
                        d.messageVersion = m.messageVersion;
                        if (o.oneofs)
                            d._messageVersion = "messageVersion";
                    }
                    return d;
                };

                CollectionMessage.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                CollectionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveMessage.CollectionMessage";
                };

                return CollectionMessage;
            })();

            InteractiveMessage.Footer = (function() {

                function Footer(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Footer.prototype.text = null;
                Footer.prototype.hasMediaAttachment = null;
                Footer.prototype.audioMessage = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Footer.prototype, "_text", {
                    get: $util.oneOfGetter($oneOfFields = ["text"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Footer.prototype, "_hasMediaAttachment", {
                    get: $util.oneOfGetter($oneOfFields = ["hasMediaAttachment"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Object.defineProperty(Footer.prototype, "media", {
                    get: $util.oneOfGetter($oneOfFields = ["audioMessage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Footer.create = function create(properties) {
                    return new Footer(properties);
                };

                Footer.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                        w.uint32(10).string(m.text);
                    if (m.audioMessage != null && Object.hasOwnProperty.call(m, "audioMessage"))
                        $root.proto.Message.AudioMessage.encode(m.audioMessage, w.uint32(18).fork()).ldelim();
                    if (m.hasMediaAttachment != null && Object.hasOwnProperty.call(m, "hasMediaAttachment"))
                        w.uint32(24).bool(m.hasMediaAttachment);
                    return w;
                };

                Footer.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage.Footer();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.text = r.string();
                                break;
                            }
                        case 3: {
                                m.hasMediaAttachment = r.bool();
                                break;
                            }
                        case 2: {
                                m.audioMessage = $root.proto.Message.AudioMessage.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Footer.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveMessage.Footer)
                        return d;
                    var m = new $root.proto.Message.InteractiveMessage.Footer();
                    if (d.text != null) {
                        m.text = String(d.text);
                    }
                    if (d.hasMediaAttachment != null) {
                        m.hasMediaAttachment = Boolean(d.hasMediaAttachment);
                    }
                    if (d.audioMessage != null) {
                        if (typeof d.audioMessage !== "object")
                            throw TypeError(".proto.Message.InteractiveMessage.Footer.audioMessage: object expected");
                        m.audioMessage = $root.proto.Message.AudioMessage.fromObject(d.audioMessage);
                    }
                    return m;
                };

                Footer.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.text != null && m.hasOwnProperty("text")) {
                        d.text = m.text;
                        if (o.oneofs)
                            d._text = "text";
                    }
                    if (m.audioMessage != null && m.hasOwnProperty("audioMessage")) {
                        d.audioMessage = $root.proto.Message.AudioMessage.toObject(m.audioMessage, o);
                        if (o.oneofs)
                            d.media = "audioMessage";
                    }
                    if (m.hasMediaAttachment != null && m.hasOwnProperty("hasMediaAttachment")) {
                        d.hasMediaAttachment = m.hasMediaAttachment;
                        if (o.oneofs)
                            d._hasMediaAttachment = "hasMediaAttachment";
                    }
                    return d;
                };

                Footer.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Footer.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveMessage.Footer";
                };

                return Footer;
            })();

            InteractiveMessage.Header = (function() {

                function Header(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Header.prototype.title = null;
                Header.prototype.subtitle = null;
                Header.prototype.hasMediaAttachment = null;
                Header.prototype.documentMessage = null;
                Header.prototype.imageMessage = null;
                Header.prototype.jpegThumbnail = null;
                Header.prototype.videoMessage = null;
                Header.prototype.locationMessage = null;
                Header.prototype.productMessage = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Header.prototype, "_title", {
                    get: $util.oneOfGetter($oneOfFields = ["title"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Header.prototype, "_subtitle", {
                    get: $util.oneOfGetter($oneOfFields = ["subtitle"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Header.prototype, "_hasMediaAttachment", {
                    get: $util.oneOfGetter($oneOfFields = ["hasMediaAttachment"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Object.defineProperty(Header.prototype, "media", {
                    get: $util.oneOfGetter($oneOfFields = ["documentMessage", "imageMessage", "jpegThumbnail", "videoMessage", "locationMessage", "productMessage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Header.create = function create(properties) {
                    return new Header(properties);
                };

                Header.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                        w.uint32(10).string(m.title);
                    if (m.subtitle != null && Object.hasOwnProperty.call(m, "subtitle"))
                        w.uint32(18).string(m.subtitle);
                    if (m.documentMessage != null && Object.hasOwnProperty.call(m, "documentMessage"))
                        $root.proto.Message.DocumentMessage.encode(m.documentMessage, w.uint32(26).fork()).ldelim();
                    if (m.imageMessage != null && Object.hasOwnProperty.call(m, "imageMessage"))
                        $root.proto.Message.ImageMessage.encode(m.imageMessage, w.uint32(34).fork()).ldelim();
                    if (m.hasMediaAttachment != null && Object.hasOwnProperty.call(m, "hasMediaAttachment"))
                        w.uint32(40).bool(m.hasMediaAttachment);
                    if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                        w.uint32(50).bytes(m.jpegThumbnail);
                    if (m.videoMessage != null && Object.hasOwnProperty.call(m, "videoMessage"))
                        $root.proto.Message.VideoMessage.encode(m.videoMessage, w.uint32(58).fork()).ldelim();
                    if (m.locationMessage != null && Object.hasOwnProperty.call(m, "locationMessage"))
                        $root.proto.Message.LocationMessage.encode(m.locationMessage, w.uint32(66).fork()).ldelim();
                    if (m.productMessage != null && Object.hasOwnProperty.call(m, "productMessage"))
                        $root.proto.Message.ProductMessage.encode(m.productMessage, w.uint32(74).fork()).ldelim();
                    return w;
                };

                Header.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage.Header();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.title = r.string();
                                break;
                            }
                        case 2: {
                                m.subtitle = r.string();
                                break;
                            }
                        case 5: {
                                m.hasMediaAttachment = r.bool();
                                break;
                            }
                        case 3: {
                                m.documentMessage = $root.proto.Message.DocumentMessage.decode(r, r.uint32());
                                break;
                            }
                        case 4: {
                                m.imageMessage = $root.proto.Message.ImageMessage.decode(r, r.uint32());
                                break;
                            }
                        case 6: {
                                m.jpegThumbnail = r.bytes();
                                break;
                            }
                        case 7: {
                                m.videoMessage = $root.proto.Message.VideoMessage.decode(r, r.uint32());
                                break;
                            }
                        case 8: {
                                m.locationMessage = $root.proto.Message.LocationMessage.decode(r, r.uint32());
                                break;
                            }
                        case 9: {
                                m.productMessage = $root.proto.Message.ProductMessage.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Header.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveMessage.Header)
                        return d;
                    var m = new $root.proto.Message.InteractiveMessage.Header();
                    if (d.title != null) {
                        m.title = String(d.title);
                    }
                    if (d.subtitle != null) {
                        m.subtitle = String(d.subtitle);
                    }
                    if (d.hasMediaAttachment != null) {
                        m.hasMediaAttachment = Boolean(d.hasMediaAttachment);
                    }
                    if (d.documentMessage != null) {
                        if (typeof d.documentMessage !== "object")
                            throw TypeError(".proto.Message.InteractiveMessage.Header.documentMessage: object expected");
                        m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage);
                    }
                    if (d.imageMessage != null) {
                        if (typeof d.imageMessage !== "object")
                            throw TypeError(".proto.Message.InteractiveMessage.Header.imageMessage: object expected");
                        m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage);
                    }
                    if (d.jpegThumbnail != null) {
                        if (typeof d.jpegThumbnail === "string")
                            $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                        else if (d.jpegThumbnail.length >= 0)
                            m.jpegThumbnail = d.jpegThumbnail;
                    }
                    if (d.videoMessage != null) {
                        if (typeof d.videoMessage !== "object")
                            throw TypeError(".proto.Message.InteractiveMessage.Header.videoMessage: object expected");
                        m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage);
                    }
                    if (d.locationMessage != null) {
                        if (typeof d.locationMessage !== "object")
                            throw TypeError(".proto.Message.InteractiveMessage.Header.locationMessage: object expected");
                        m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage);
                    }
                    if (d.productMessage != null) {
                        if (typeof d.productMessage !== "object")
                            throw TypeError(".proto.Message.InteractiveMessage.Header.productMessage: object expected");
                        m.productMessage = $root.proto.Message.ProductMessage.fromObject(d.productMessage);
                    }
                    return m;
                };

                Header.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.title != null && m.hasOwnProperty("title")) {
                        d.title = m.title;
                        if (o.oneofs)
                            d._title = "title";
                    }
                    if (m.subtitle != null && m.hasOwnProperty("subtitle")) {
                        d.subtitle = m.subtitle;
                        if (o.oneofs)
                            d._subtitle = "subtitle";
                    }
                    if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) {
                        d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o);
                        if (o.oneofs)
                            d.media = "documentMessage";
                    }
                    if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) {
                        d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o);
                        if (o.oneofs)
                            d.media = "imageMessage";
                    }
                    if (m.hasMediaAttachment != null && m.hasOwnProperty("hasMediaAttachment")) {
                        d.hasMediaAttachment = m.hasMediaAttachment;
                        if (o.oneofs)
                            d._hasMediaAttachment = "hasMediaAttachment";
                    }
                    if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                        d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                        if (o.oneofs)
                            d.media = "jpegThumbnail";
                    }
                    if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) {
                        d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o);
                        if (o.oneofs)
                            d.media = "videoMessage";
                    }
                    if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) {
                        d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o);
                        if (o.oneofs)
                            d.media = "locationMessage";
                    }
                    if (m.productMessage != null && m.hasOwnProperty("productMessage")) {
                        d.productMessage = $root.proto.Message.ProductMessage.toObject(m.productMessage, o);
                        if (o.oneofs)
                            d.media = "productMessage";
                    }
                    return d;
                };

                Header.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Header.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveMessage.Header";
                };

                return Header;
            })();

            InteractiveMessage.NativeFlowMessage = (function() {

                function NativeFlowMessage(p) {
                    this.buttons = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                NativeFlowMessage.prototype.buttons = $util.emptyArray;
                NativeFlowMessage.prototype.messageParamsJson = null;
                NativeFlowMessage.prototype.messageVersion = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(NativeFlowMessage.prototype, "_messageParamsJson", {
                    get: $util.oneOfGetter($oneOfFields = ["messageParamsJson"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(NativeFlowMessage.prototype, "_messageVersion", {
                    get: $util.oneOfGetter($oneOfFields = ["messageVersion"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                NativeFlowMessage.create = function create(properties) {
                    return new NativeFlowMessage(properties);
                };

                NativeFlowMessage.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.buttons != null && m.buttons.length) {
                        for (var i = 0; i < m.buttons.length; ++i)
                            $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.encode(m.buttons[i], w.uint32(10).fork()).ldelim();
                    }
                    if (m.messageParamsJson != null && Object.hasOwnProperty.call(m, "messageParamsJson"))
                        w.uint32(18).string(m.messageParamsJson);
                    if (m.messageVersion != null && Object.hasOwnProperty.call(m, "messageVersion"))
                        w.uint32(24).int32(m.messageVersion);
                    return w;
                };

                NativeFlowMessage.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage.NativeFlowMessage();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                if (!(m.buttons && m.buttons.length))
                                    m.buttons = [];
                                m.buttons.push($root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.decode(r, r.uint32()));
                                break;
                            }
                        case 2: {
                                m.messageParamsJson = r.string();
                                break;
                            }
                        case 3: {
                                m.messageVersion = r.int32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                NativeFlowMessage.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveMessage.NativeFlowMessage)
                        return d;
                    var m = new $root.proto.Message.InteractiveMessage.NativeFlowMessage();
                    if (d.buttons) {
                        if (!Array.isArray(d.buttons))
                            throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: array expected");
                        m.buttons = [];
                        for (var i = 0; i < d.buttons.length; ++i) {
                            if (typeof d.buttons[i] !== "object")
                                throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: object expected");
                            m.buttons[i] = $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.fromObject(d.buttons[i]);
                        }
                    }
                    if (d.messageParamsJson != null) {
                        m.messageParamsJson = String(d.messageParamsJson);
                    }
                    if (d.messageVersion != null) {
                        m.messageVersion = d.messageVersion | 0;
                    }
                    return m;
                };

                NativeFlowMessage.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.buttons = [];
                    }
                    if (m.buttons && m.buttons.length) {
                        d.buttons = [];
                        for (var j = 0; j < m.buttons.length; ++j) {
                            d.buttons[j] = $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.toObject(m.buttons[j], o);
                        }
                    }
                    if (m.messageParamsJson != null && m.hasOwnProperty("messageParamsJson")) {
                        d.messageParamsJson = m.messageParamsJson;
                        if (o.oneofs)
                            d._messageParamsJson = "messageParamsJson";
                    }
                    if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) {
                        d.messageVersion = m.messageVersion;
                        if (o.oneofs)
                            d._messageVersion = "messageVersion";
                    }
                    return d;
                };

                NativeFlowMessage.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                NativeFlowMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveMessage.NativeFlowMessage";
                };

                NativeFlowMessage.NativeFlowButton = (function() {

                    function NativeFlowButton(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    NativeFlowButton.prototype.name = null;
                    NativeFlowButton.prototype.buttonParamsJson = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(NativeFlowButton.prototype, "_name", {
                        get: $util.oneOfGetter($oneOfFields = ["name"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(NativeFlowButton.prototype, "_buttonParamsJson", {
                        get: $util.oneOfGetter($oneOfFields = ["buttonParamsJson"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    NativeFlowButton.create = function create(properties) {
                        return new NativeFlowButton(properties);
                    };

                    NativeFlowButton.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                            w.uint32(10).string(m.name);
                        if (m.buttonParamsJson != null && Object.hasOwnProperty.call(m, "buttonParamsJson"))
                            w.uint32(18).string(m.buttonParamsJson);
                        return w;
                    };

                    NativeFlowButton.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.name = r.string();
                                    break;
                                }
                            case 2: {
                                    m.buttonParamsJson = r.string();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    NativeFlowButton.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton)
                            return d;
                        var m = new $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton();
                        if (d.name != null) {
                            m.name = String(d.name);
                        }
                        if (d.buttonParamsJson != null) {
                            m.buttonParamsJson = String(d.buttonParamsJson);
                        }
                        return m;
                    };

                    NativeFlowButton.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.name != null && m.hasOwnProperty("name")) {
                            d.name = m.name;
                            if (o.oneofs)
                                d._name = "name";
                        }
                        if (m.buttonParamsJson != null && m.hasOwnProperty("buttonParamsJson")) {
                            d.buttonParamsJson = m.buttonParamsJson;
                            if (o.oneofs)
                                d._buttonParamsJson = "buttonParamsJson";
                        }
                        return d;
                    };

                    NativeFlowButton.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    NativeFlowButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton";
                    };

                    return NativeFlowButton;
                })();

                return NativeFlowMessage;
            })();

            InteractiveMessage.ShopMessage = (function() {

                function ShopMessage(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                ShopMessage.prototype.id = null;
                ShopMessage.prototype.surface = null;
                ShopMessage.prototype.messageVersion = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ShopMessage.prototype, "_id", {
                    get: $util.oneOfGetter($oneOfFields = ["id"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ShopMessage.prototype, "_surface", {
                    get: $util.oneOfGetter($oneOfFields = ["surface"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ShopMessage.prototype, "_messageVersion", {
                    get: $util.oneOfGetter($oneOfFields = ["messageVersion"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                ShopMessage.create = function create(properties) {
                    return new ShopMessage(properties);
                };

                ShopMessage.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                        w.uint32(10).string(m.id);
                    if (m.surface != null && Object.hasOwnProperty.call(m, "surface"))
                        w.uint32(16).int32(m.surface);
                    if (m.messageVersion != null && Object.hasOwnProperty.call(m, "messageVersion"))
                        w.uint32(24).int32(m.messageVersion);
                    return w;
                };

                ShopMessage.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveMessage.ShopMessage();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.id = r.string();
                                break;
                            }
                        case 2: {
                                m.surface = r.int32();
                                break;
                            }
                        case 3: {
                                m.messageVersion = r.int32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                ShopMessage.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveMessage.ShopMessage)
                        return d;
                    var m = new $root.proto.Message.InteractiveMessage.ShopMessage();
                    if (d.id != null) {
                        m.id = String(d.id);
                    }
                    switch (d.surface) {
                    default:
                        if (typeof d.surface === "number") {
                            m.surface = d.surface;
                            break;
                        }
                        break;
                    case "UNKNOWN_SURFACE":
                    case 0:
                        m.surface = 0;
                        break;
                    case "FB":
                    case 1:
                        m.surface = 1;
                        break;
                    case "IG":
                    case 2:
                        m.surface = 2;
                        break;
                    case "WA":
                    case 3:
                        m.surface = 3;
                        break;
                    }
                    if (d.messageVersion != null) {
                        m.messageVersion = d.messageVersion | 0;
                    }
                    return m;
                };

                ShopMessage.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.id != null && m.hasOwnProperty("id")) {
                        d.id = m.id;
                        if (o.oneofs)
                            d._id = "id";
                    }
                    if (m.surface != null && m.hasOwnProperty("surface")) {
                        d.surface = o.enums === String ? $root.proto.Message.InteractiveMessage.ShopMessage.Surface[m.surface] === undefined ? m.surface : $root.proto.Message.InteractiveMessage.ShopMessage.Surface[m.surface] : m.surface;
                        if (o.oneofs)
                            d._surface = "surface";
                    }
                    if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) {
                        d.messageVersion = m.messageVersion;
                        if (o.oneofs)
                            d._messageVersion = "messageVersion";
                    }
                    return d;
                };

                ShopMessage.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                ShopMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveMessage.ShopMessage";
                };

                ShopMessage.Surface = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "UNKNOWN_SURFACE"] = 0;
                    values[valuesById[1] = "FB"] = 1;
                    values[valuesById[2] = "IG"] = 2;
                    values[valuesById[3] = "WA"] = 3;
                    return values;
                })();

                return ShopMessage;
            })();

            return InteractiveMessage;
        })();

        Message.InteractiveResponseMessage = (function() {

            function InteractiveResponseMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InteractiveResponseMessage.prototype.body = null;
            InteractiveResponseMessage.prototype.contextInfo = null;
            InteractiveResponseMessage.prototype.nativeFlowResponseMessage = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteractiveResponseMessage.prototype, "_body", {
                get: $util.oneOfGetter($oneOfFields = ["body"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InteractiveResponseMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Object.defineProperty(InteractiveResponseMessage.prototype, "interactiveResponseMessage", {
                get: $util.oneOfGetter($oneOfFields = ["nativeFlowResponseMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            InteractiveResponseMessage.create = function create(properties) {
                return new InteractiveResponseMessage(properties);
            };

            InteractiveResponseMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.body != null && Object.hasOwnProperty.call(m, "body"))
                    $root.proto.Message.InteractiveResponseMessage.Body.encode(m.body, w.uint32(10).fork()).ldelim();
                if (m.nativeFlowResponseMessage != null && Object.hasOwnProperty.call(m, "nativeFlowResponseMessage"))
                    $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.encode(m.nativeFlowResponseMessage, w.uint32(18).fork()).ldelim();
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(122).fork()).ldelim();
                return w;
            };

            InteractiveResponseMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveResponseMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.body = $root.proto.Message.InteractiveResponseMessage.Body.decode(r, r.uint32());
                            break;
                        }
                    case 15: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.nativeFlowResponseMessage = $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InteractiveResponseMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.InteractiveResponseMessage)
                    return d;
                var m = new $root.proto.Message.InteractiveResponseMessage();
                if (d.body != null) {
                    if (typeof d.body !== "object")
                        throw TypeError(".proto.Message.InteractiveResponseMessage.body: object expected");
                    m.body = $root.proto.Message.InteractiveResponseMessage.Body.fromObject(d.body);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.InteractiveResponseMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.nativeFlowResponseMessage != null) {
                    if (typeof d.nativeFlowResponseMessage !== "object")
                        throw TypeError(".proto.Message.InteractiveResponseMessage.nativeFlowResponseMessage: object expected");
                    m.nativeFlowResponseMessage = $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.fromObject(d.nativeFlowResponseMessage);
                }
                return m;
            };

            InteractiveResponseMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.body != null && m.hasOwnProperty("body")) {
                    d.body = $root.proto.Message.InteractiveResponseMessage.Body.toObject(m.body, o);
                    if (o.oneofs)
                        d._body = "body";
                }
                if (m.nativeFlowResponseMessage != null && m.hasOwnProperty("nativeFlowResponseMessage")) {
                    d.nativeFlowResponseMessage = $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.toObject(m.nativeFlowResponseMessage, o);
                    if (o.oneofs)
                        d.interactiveResponseMessage = "nativeFlowResponseMessage";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            InteractiveResponseMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InteractiveResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.InteractiveResponseMessage";
            };

            InteractiveResponseMessage.Body = (function() {

                function Body(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Body.prototype.text = null;
                Body.prototype.format = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Body.prototype, "_text", {
                    get: $util.oneOfGetter($oneOfFields = ["text"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Body.prototype, "_format", {
                    get: $util.oneOfGetter($oneOfFields = ["format"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Body.create = function create(properties) {
                    return new Body(properties);
                };

                Body.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                        w.uint32(10).string(m.text);
                    if (m.format != null && Object.hasOwnProperty.call(m, "format"))
                        w.uint32(16).int32(m.format);
                    return w;
                };

                Body.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveResponseMessage.Body();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.text = r.string();
                                break;
                            }
                        case 2: {
                                m.format = r.int32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Body.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveResponseMessage.Body)
                        return d;
                    var m = new $root.proto.Message.InteractiveResponseMessage.Body();
                    if (d.text != null) {
                        m.text = String(d.text);
                    }
                    switch (d.format) {
                    default:
                        if (typeof d.format === "number") {
                            m.format = d.format;
                            break;
                        }
                        break;
                    case "DEFAULT":
                    case 0:
                        m.format = 0;
                        break;
                    case "EXTENSIONS_1":
                    case 1:
                        m.format = 1;
                        break;
                    }
                    return m;
                };

                Body.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.text != null && m.hasOwnProperty("text")) {
                        d.text = m.text;
                        if (o.oneofs)
                            d._text = "text";
                    }
                    if (m.format != null && m.hasOwnProperty("format")) {
                        d.format = o.enums === String ? $root.proto.Message.InteractiveResponseMessage.Body.Format[m.format] === undefined ? m.format : $root.proto.Message.InteractiveResponseMessage.Body.Format[m.format] : m.format;
                        if (o.oneofs)
                            d._format = "format";
                    }
                    return d;
                };

                Body.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveResponseMessage.Body";
                };

                Body.Format = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "DEFAULT"] = 0;
                    values[valuesById[1] = "EXTENSIONS_1"] = 1;
                    return values;
                })();

                return Body;
            })();

            InteractiveResponseMessage.NativeFlowResponseMessage = (function() {

                function NativeFlowResponseMessage(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                NativeFlowResponseMessage.prototype.name = null;
                NativeFlowResponseMessage.prototype.paramsJson = null;
                NativeFlowResponseMessage.prototype.version = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(NativeFlowResponseMessage.prototype, "_name", {
                    get: $util.oneOfGetter($oneOfFields = ["name"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(NativeFlowResponseMessage.prototype, "_paramsJson", {
                    get: $util.oneOfGetter($oneOfFields = ["paramsJson"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(NativeFlowResponseMessage.prototype, "_version", {
                    get: $util.oneOfGetter($oneOfFields = ["version"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                NativeFlowResponseMessage.create = function create(properties) {
                    return new NativeFlowResponseMessage(properties);
                };

                NativeFlowResponseMessage.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                        w.uint32(10).string(m.name);
                    if (m.paramsJson != null && Object.hasOwnProperty.call(m, "paramsJson"))
                        w.uint32(18).string(m.paramsJson);
                    if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                        w.uint32(24).int32(m.version);
                    return w;
                };

                NativeFlowResponseMessage.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.name = r.string();
                                break;
                            }
                        case 2: {
                                m.paramsJson = r.string();
                                break;
                            }
                        case 3: {
                                m.version = r.int32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                NativeFlowResponseMessage.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage)
                        return d;
                    var m = new $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage();
                    if (d.name != null) {
                        m.name = String(d.name);
                    }
                    if (d.paramsJson != null) {
                        m.paramsJson = String(d.paramsJson);
                    }
                    if (d.version != null) {
                        m.version = d.version | 0;
                    }
                    return m;
                };

                NativeFlowResponseMessage.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.name != null && m.hasOwnProperty("name")) {
                        d.name = m.name;
                        if (o.oneofs)
                            d._name = "name";
                    }
                    if (m.paramsJson != null && m.hasOwnProperty("paramsJson")) {
                        d.paramsJson = m.paramsJson;
                        if (o.oneofs)
                            d._paramsJson = "paramsJson";
                    }
                    if (m.version != null && m.hasOwnProperty("version")) {
                        d.version = m.version;
                        if (o.oneofs)
                            d._version = "version";
                    }
                    return d;
                };

                NativeFlowResponseMessage.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                NativeFlowResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage";
                };

                return NativeFlowResponseMessage;
            })();

            return InteractiveResponseMessage;
        })();

        Message.InvoiceMessage = (function() {

            function InvoiceMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InvoiceMessage.prototype.note = null;
            InvoiceMessage.prototype.token = null;
            InvoiceMessage.prototype.attachmentType = null;
            InvoiceMessage.prototype.attachmentMimetype = null;
            InvoiceMessage.prototype.attachmentMediaKey = null;
            InvoiceMessage.prototype.attachmentMediaKeyTimestamp = null;
            InvoiceMessage.prototype.attachmentFileSha256 = null;
            InvoiceMessage.prototype.attachmentFileEncSha256 = null;
            InvoiceMessage.prototype.attachmentDirectPath = null;
            InvoiceMessage.prototype.attachmentJpegThumbnail = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_note", {
                get: $util.oneOfGetter($oneOfFields = ["note"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_token", {
                get: $util.oneOfGetter($oneOfFields = ["token"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_attachmentType", {
                get: $util.oneOfGetter($oneOfFields = ["attachmentType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_attachmentMimetype", {
                get: $util.oneOfGetter($oneOfFields = ["attachmentMimetype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_attachmentMediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["attachmentMediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_attachmentMediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["attachmentMediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_attachmentFileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["attachmentFileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_attachmentFileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["attachmentFileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_attachmentDirectPath", {
                get: $util.oneOfGetter($oneOfFields = ["attachmentDirectPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(InvoiceMessage.prototype, "_attachmentJpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["attachmentJpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            InvoiceMessage.create = function create(properties) {
                return new InvoiceMessage(properties);
            };

            InvoiceMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.note != null && Object.hasOwnProperty.call(m, "note"))
                    w.uint32(10).string(m.note);
                if (m.token != null && Object.hasOwnProperty.call(m, "token"))
                    w.uint32(18).string(m.token);
                if (m.attachmentType != null && Object.hasOwnProperty.call(m, "attachmentType"))
                    w.uint32(24).int32(m.attachmentType);
                if (m.attachmentMimetype != null && Object.hasOwnProperty.call(m, "attachmentMimetype"))
                    w.uint32(34).string(m.attachmentMimetype);
                if (m.attachmentMediaKey != null && Object.hasOwnProperty.call(m, "attachmentMediaKey"))
                    w.uint32(42).bytes(m.attachmentMediaKey);
                if (m.attachmentMediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "attachmentMediaKeyTimestamp"))
                    w.uint32(48).int64(m.attachmentMediaKeyTimestamp);
                if (m.attachmentFileSha256 != null && Object.hasOwnProperty.call(m, "attachmentFileSha256"))
                    w.uint32(58).bytes(m.attachmentFileSha256);
                if (m.attachmentFileEncSha256 != null && Object.hasOwnProperty.call(m, "attachmentFileEncSha256"))
                    w.uint32(66).bytes(m.attachmentFileEncSha256);
                if (m.attachmentDirectPath != null && Object.hasOwnProperty.call(m, "attachmentDirectPath"))
                    w.uint32(74).string(m.attachmentDirectPath);
                if (m.attachmentJpegThumbnail != null && Object.hasOwnProperty.call(m, "attachmentJpegThumbnail"))
                    w.uint32(82).bytes(m.attachmentJpegThumbnail);
                return w;
            };

            InvoiceMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.InvoiceMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.note = r.string();
                            break;
                        }
                    case 2: {
                            m.token = r.string();
                            break;
                        }
                    case 3: {
                            m.attachmentType = r.int32();
                            break;
                        }
                    case 4: {
                            m.attachmentMimetype = r.string();
                            break;
                        }
                    case 5: {
                            m.attachmentMediaKey = r.bytes();
                            break;
                        }
                    case 6: {
                            m.attachmentMediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 7: {
                            m.attachmentFileSha256 = r.bytes();
                            break;
                        }
                    case 8: {
                            m.attachmentFileEncSha256 = r.bytes();
                            break;
                        }
                    case 9: {
                            m.attachmentDirectPath = r.string();
                            break;
                        }
                    case 10: {
                            m.attachmentJpegThumbnail = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InvoiceMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.InvoiceMessage)
                    return d;
                var m = new $root.proto.Message.InvoiceMessage();
                if (d.note != null) {
                    m.note = String(d.note);
                }
                if (d.token != null) {
                    m.token = String(d.token);
                }
                switch (d.attachmentType) {
                default:
                    if (typeof d.attachmentType === "number") {
                        m.attachmentType = d.attachmentType;
                        break;
                    }
                    break;
                case "IMAGE":
                case 0:
                    m.attachmentType = 0;
                    break;
                case "PDF":
                case 1:
                    m.attachmentType = 1;
                    break;
                }
                if (d.attachmentMimetype != null) {
                    m.attachmentMimetype = String(d.attachmentMimetype);
                }
                if (d.attachmentMediaKey != null) {
                    if (typeof d.attachmentMediaKey === "string")
                        $util.base64.decode(d.attachmentMediaKey, m.attachmentMediaKey = $util.newBuffer($util.base64.length(d.attachmentMediaKey)), 0);
                    else if (d.attachmentMediaKey.length >= 0)
                        m.attachmentMediaKey = d.attachmentMediaKey;
                }
                if (d.attachmentMediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.attachmentMediaKeyTimestamp = $util.Long.fromValue(d.attachmentMediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.attachmentMediaKeyTimestamp === "string")
                        m.attachmentMediaKeyTimestamp = parseInt(d.attachmentMediaKeyTimestamp, 10);
                    else if (typeof d.attachmentMediaKeyTimestamp === "number")
                        m.attachmentMediaKeyTimestamp = d.attachmentMediaKeyTimestamp;
                    else if (typeof d.attachmentMediaKeyTimestamp === "object")
                        m.attachmentMediaKeyTimestamp = new $util.LongBits(d.attachmentMediaKeyTimestamp.low >>> 0, d.attachmentMediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.attachmentFileSha256 != null) {
                    if (typeof d.attachmentFileSha256 === "string")
                        $util.base64.decode(d.attachmentFileSha256, m.attachmentFileSha256 = $util.newBuffer($util.base64.length(d.attachmentFileSha256)), 0);
                    else if (d.attachmentFileSha256.length >= 0)
                        m.attachmentFileSha256 = d.attachmentFileSha256;
                }
                if (d.attachmentFileEncSha256 != null) {
                    if (typeof d.attachmentFileEncSha256 === "string")
                        $util.base64.decode(d.attachmentFileEncSha256, m.attachmentFileEncSha256 = $util.newBuffer($util.base64.length(d.attachmentFileEncSha256)), 0);
                    else if (d.attachmentFileEncSha256.length >= 0)
                        m.attachmentFileEncSha256 = d.attachmentFileEncSha256;
                }
                if (d.attachmentDirectPath != null) {
                    m.attachmentDirectPath = String(d.attachmentDirectPath);
                }
                if (d.attachmentJpegThumbnail != null) {
                    if (typeof d.attachmentJpegThumbnail === "string")
                        $util.base64.decode(d.attachmentJpegThumbnail, m.attachmentJpegThumbnail = $util.newBuffer($util.base64.length(d.attachmentJpegThumbnail)), 0);
                    else if (d.attachmentJpegThumbnail.length >= 0)
                        m.attachmentJpegThumbnail = d.attachmentJpegThumbnail;
                }
                return m;
            };

            InvoiceMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.note != null && m.hasOwnProperty("note")) {
                    d.note = m.note;
                    if (o.oneofs)
                        d._note = "note";
                }
                if (m.token != null && m.hasOwnProperty("token")) {
                    d.token = m.token;
                    if (o.oneofs)
                        d._token = "token";
                }
                if (m.attachmentType != null && m.hasOwnProperty("attachmentType")) {
                    d.attachmentType = o.enums === String ? $root.proto.Message.InvoiceMessage.AttachmentType[m.attachmentType] === undefined ? m.attachmentType : $root.proto.Message.InvoiceMessage.AttachmentType[m.attachmentType] : m.attachmentType;
                    if (o.oneofs)
                        d._attachmentType = "attachmentType";
                }
                if (m.attachmentMimetype != null && m.hasOwnProperty("attachmentMimetype")) {
                    d.attachmentMimetype = m.attachmentMimetype;
                    if (o.oneofs)
                        d._attachmentMimetype = "attachmentMimetype";
                }
                if (m.attachmentMediaKey != null && m.hasOwnProperty("attachmentMediaKey")) {
                    d.attachmentMediaKey = o.bytes === String ? $util.base64.encode(m.attachmentMediaKey, 0, m.attachmentMediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.attachmentMediaKey) : m.attachmentMediaKey;
                    if (o.oneofs)
                        d._attachmentMediaKey = "attachmentMediaKey";
                }
                if (m.attachmentMediaKeyTimestamp != null && m.hasOwnProperty("attachmentMediaKeyTimestamp")) {
                    if (typeof m.attachmentMediaKeyTimestamp === "number")
                        d.attachmentMediaKeyTimestamp = o.longs === String ? String(m.attachmentMediaKeyTimestamp) : m.attachmentMediaKeyTimestamp;
                    else
                        d.attachmentMediaKeyTimestamp = o.longs === String ? longToString(m.attachmentMediaKeyTimestamp) : o.longs === Number ? longToNumber(m.attachmentMediaKeyTimestamp) : m.attachmentMediaKeyTimestamp;
                    if (o.oneofs)
                        d._attachmentMediaKeyTimestamp = "attachmentMediaKeyTimestamp";
                }
                if (m.attachmentFileSha256 != null && m.hasOwnProperty("attachmentFileSha256")) {
                    d.attachmentFileSha256 = o.bytes === String ? $util.base64.encode(m.attachmentFileSha256, 0, m.attachmentFileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.attachmentFileSha256) : m.attachmentFileSha256;
                    if (o.oneofs)
                        d._attachmentFileSha256 = "attachmentFileSha256";
                }
                if (m.attachmentFileEncSha256 != null && m.hasOwnProperty("attachmentFileEncSha256")) {
                    d.attachmentFileEncSha256 = o.bytes === String ? $util.base64.encode(m.attachmentFileEncSha256, 0, m.attachmentFileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.attachmentFileEncSha256) : m.attachmentFileEncSha256;
                    if (o.oneofs)
                        d._attachmentFileEncSha256 = "attachmentFileEncSha256";
                }
                if (m.attachmentDirectPath != null && m.hasOwnProperty("attachmentDirectPath")) {
                    d.attachmentDirectPath = m.attachmentDirectPath;
                    if (o.oneofs)
                        d._attachmentDirectPath = "attachmentDirectPath";
                }
                if (m.attachmentJpegThumbnail != null && m.hasOwnProperty("attachmentJpegThumbnail")) {
                    d.attachmentJpegThumbnail = o.bytes === String ? $util.base64.encode(m.attachmentJpegThumbnail, 0, m.attachmentJpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.attachmentJpegThumbnail) : m.attachmentJpegThumbnail;
                    if (o.oneofs)
                        d._attachmentJpegThumbnail = "attachmentJpegThumbnail";
                }
                return d;
            };

            InvoiceMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InvoiceMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.InvoiceMessage";
            };

            InvoiceMessage.AttachmentType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "IMAGE"] = 0;
                values[valuesById[1] = "PDF"] = 1;
                return values;
            })();

            return InvoiceMessage;
        })();

        Message.KeepInChatMessage = (function() {

            function KeepInChatMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            KeepInChatMessage.prototype.key = null;
            KeepInChatMessage.prototype.keepType = null;
            KeepInChatMessage.prototype.timestampMs = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(KeepInChatMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(KeepInChatMessage.prototype, "_keepType", {
                get: $util.oneOfGetter($oneOfFields = ["keepType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(KeepInChatMessage.prototype, "_timestampMs", {
                get: $util.oneOfGetter($oneOfFields = ["timestampMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            KeepInChatMessage.create = function create(properties) {
                return new KeepInChatMessage(properties);
            };

            KeepInChatMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.keepType != null && Object.hasOwnProperty.call(m, "keepType"))
                    w.uint32(16).int32(m.keepType);
                if (m.timestampMs != null && Object.hasOwnProperty.call(m, "timestampMs"))
                    w.uint32(24).int64(m.timestampMs);
                return w;
            };

            KeepInChatMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.KeepInChatMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.keepType = r.int32();
                            break;
                        }
                    case 3: {
                            m.timestampMs = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            KeepInChatMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.KeepInChatMessage)
                    return d;
                var m = new $root.proto.Message.KeepInChatMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.KeepInChatMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                switch (d.keepType) {
                default:
                    if (typeof d.keepType === "number") {
                        m.keepType = d.keepType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.keepType = 0;
                    break;
                case "KEEP_FOR_ALL":
                case 1:
                    m.keepType = 1;
                    break;
                case "UNDO_KEEP_FOR_ALL":
                case 2:
                    m.keepType = 2;
                    break;
                }
                if (d.timestampMs != null) {
                    if ($util.Long)
                        (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false;
                    else if (typeof d.timestampMs === "string")
                        m.timestampMs = parseInt(d.timestampMs, 10);
                    else if (typeof d.timestampMs === "number")
                        m.timestampMs = d.timestampMs;
                    else if (typeof d.timestampMs === "object")
                        m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber();
                }
                return m;
            };

            KeepInChatMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.keepType != null && m.hasOwnProperty("keepType")) {
                    d.keepType = o.enums === String ? $root.proto.KeepType[m.keepType] === undefined ? m.keepType : $root.proto.KeepType[m.keepType] : m.keepType;
                    if (o.oneofs)
                        d._keepType = "keepType";
                }
                if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) {
                    if (typeof m.timestampMs === "number")
                        d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs;
                    else
                        d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs;
                    if (o.oneofs)
                        d._timestampMs = "timestampMs";
                }
                return d;
            };

            KeepInChatMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            KeepInChatMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.KeepInChatMessage";
            };

            return KeepInChatMessage;
        })();

        Message.LinkPreviewMetadata = (function() {

            function LinkPreviewMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LinkPreviewMetadata.prototype.paymentLinkMetadata = null;
            LinkPreviewMetadata.prototype.urlMetadata = null;
            LinkPreviewMetadata.prototype.fbExperimentId = null;
            LinkPreviewMetadata.prototype.linkMediaDuration = null;
            LinkPreviewMetadata.prototype.socialMediaPostType = null;
            LinkPreviewMetadata.prototype.linkInlineVideoMuted = null;
            LinkPreviewMetadata.prototype.videoContentUrl = null;
            LinkPreviewMetadata.prototype.musicMetadata = null;
            LinkPreviewMetadata.prototype.videoContentCaption = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_paymentLinkMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["paymentLinkMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_urlMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["urlMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_fbExperimentId", {
                get: $util.oneOfGetter($oneOfFields = ["fbExperimentId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_linkMediaDuration", {
                get: $util.oneOfGetter($oneOfFields = ["linkMediaDuration"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_socialMediaPostType", {
                get: $util.oneOfGetter($oneOfFields = ["socialMediaPostType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_linkInlineVideoMuted", {
                get: $util.oneOfGetter($oneOfFields = ["linkInlineVideoMuted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_videoContentUrl", {
                get: $util.oneOfGetter($oneOfFields = ["videoContentUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_musicMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["musicMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LinkPreviewMetadata.prototype, "_videoContentCaption", {
                get: $util.oneOfGetter($oneOfFields = ["videoContentCaption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LinkPreviewMetadata.create = function create(properties) {
                return new LinkPreviewMetadata(properties);
            };

            LinkPreviewMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.paymentLinkMetadata != null && Object.hasOwnProperty.call(m, "paymentLinkMetadata"))
                    $root.proto.Message.PaymentLinkMetadata.encode(m.paymentLinkMetadata, w.uint32(10).fork()).ldelim();
                if (m.urlMetadata != null && Object.hasOwnProperty.call(m, "urlMetadata"))
                    $root.proto.Message.URLMetadata.encode(m.urlMetadata, w.uint32(18).fork()).ldelim();
                if (m.fbExperimentId != null && Object.hasOwnProperty.call(m, "fbExperimentId"))
                    w.uint32(24).uint32(m.fbExperimentId);
                if (m.linkMediaDuration != null && Object.hasOwnProperty.call(m, "linkMediaDuration"))
                    w.uint32(32).uint32(m.linkMediaDuration);
                if (m.socialMediaPostType != null && Object.hasOwnProperty.call(m, "socialMediaPostType"))
                    w.uint32(40).int32(m.socialMediaPostType);
                if (m.linkInlineVideoMuted != null && Object.hasOwnProperty.call(m, "linkInlineVideoMuted"))
                    w.uint32(48).bool(m.linkInlineVideoMuted);
                if (m.videoContentUrl != null && Object.hasOwnProperty.call(m, "videoContentUrl"))
                    w.uint32(58).string(m.videoContentUrl);
                if (m.musicMetadata != null && Object.hasOwnProperty.call(m, "musicMetadata"))
                    $root.proto.EmbeddedMusic.encode(m.musicMetadata, w.uint32(66).fork()).ldelim();
                if (m.videoContentCaption != null && Object.hasOwnProperty.call(m, "videoContentCaption"))
                    w.uint32(74).string(m.videoContentCaption);
                return w;
            };

            LinkPreviewMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.LinkPreviewMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.urlMetadata = $root.proto.Message.URLMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.fbExperimentId = r.uint32();
                            break;
                        }
                    case 4: {
                            m.linkMediaDuration = r.uint32();
                            break;
                        }
                    case 5: {
                            m.socialMediaPostType = r.int32();
                            break;
                        }
                    case 6: {
                            m.linkInlineVideoMuted = r.bool();
                            break;
                        }
                    case 7: {
                            m.videoContentUrl = r.string();
                            break;
                        }
                    case 8: {
                            m.musicMetadata = $root.proto.EmbeddedMusic.decode(r, r.uint32());
                            break;
                        }
                    case 9: {
                            m.videoContentCaption = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LinkPreviewMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.LinkPreviewMetadata)
                    return d;
                var m = new $root.proto.Message.LinkPreviewMetadata();
                if (d.paymentLinkMetadata != null) {
                    if (typeof d.paymentLinkMetadata !== "object")
                        throw TypeError(".proto.Message.LinkPreviewMetadata.paymentLinkMetadata: object expected");
                    m.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.fromObject(d.paymentLinkMetadata);
                }
                if (d.urlMetadata != null) {
                    if (typeof d.urlMetadata !== "object")
                        throw TypeError(".proto.Message.LinkPreviewMetadata.urlMetadata: object expected");
                    m.urlMetadata = $root.proto.Message.URLMetadata.fromObject(d.urlMetadata);
                }
                if (d.fbExperimentId != null) {
                    m.fbExperimentId = d.fbExperimentId >>> 0;
                }
                if (d.linkMediaDuration != null) {
                    m.linkMediaDuration = d.linkMediaDuration >>> 0;
                }
                switch (d.socialMediaPostType) {
                default:
                    if (typeof d.socialMediaPostType === "number") {
                        m.socialMediaPostType = d.socialMediaPostType;
                        break;
                    }
                    break;
                case "NONE":
                case 0:
                    m.socialMediaPostType = 0;
                    break;
                case "REEL":
                case 1:
                    m.socialMediaPostType = 1;
                    break;
                case "LIVE_VIDEO":
                case 2:
                    m.socialMediaPostType = 2;
                    break;
                case "LONG_VIDEO":
                case 3:
                    m.socialMediaPostType = 3;
                    break;
                case "SINGLE_IMAGE":
                case 4:
                    m.socialMediaPostType = 4;
                    break;
                case "CAROUSEL":
                case 5:
                    m.socialMediaPostType = 5;
                    break;
                }
                if (d.linkInlineVideoMuted != null) {
                    m.linkInlineVideoMuted = Boolean(d.linkInlineVideoMuted);
                }
                if (d.videoContentUrl != null) {
                    m.videoContentUrl = String(d.videoContentUrl);
                }
                if (d.musicMetadata != null) {
                    if (typeof d.musicMetadata !== "object")
                        throw TypeError(".proto.Message.LinkPreviewMetadata.musicMetadata: object expected");
                    m.musicMetadata = $root.proto.EmbeddedMusic.fromObject(d.musicMetadata);
                }
                if (d.videoContentCaption != null) {
                    m.videoContentCaption = String(d.videoContentCaption);
                }
                return m;
            };

            LinkPreviewMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.paymentLinkMetadata != null && m.hasOwnProperty("paymentLinkMetadata")) {
                    d.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.toObject(m.paymentLinkMetadata, o);
                    if (o.oneofs)
                        d._paymentLinkMetadata = "paymentLinkMetadata";
                }
                if (m.urlMetadata != null && m.hasOwnProperty("urlMetadata")) {
                    d.urlMetadata = $root.proto.Message.URLMetadata.toObject(m.urlMetadata, o);
                    if (o.oneofs)
                        d._urlMetadata = "urlMetadata";
                }
                if (m.fbExperimentId != null && m.hasOwnProperty("fbExperimentId")) {
                    d.fbExperimentId = m.fbExperimentId;
                    if (o.oneofs)
                        d._fbExperimentId = "fbExperimentId";
                }
                if (m.linkMediaDuration != null && m.hasOwnProperty("linkMediaDuration")) {
                    d.linkMediaDuration = m.linkMediaDuration;
                    if (o.oneofs)
                        d._linkMediaDuration = "linkMediaDuration";
                }
                if (m.socialMediaPostType != null && m.hasOwnProperty("socialMediaPostType")) {
                    d.socialMediaPostType = o.enums === String ? $root.proto.Message.LinkPreviewMetadata.SocialMediaPostType[m.socialMediaPostType] === undefined ? m.socialMediaPostType : $root.proto.Message.LinkPreviewMetadata.SocialMediaPostType[m.socialMediaPostType] : m.socialMediaPostType;
                    if (o.oneofs)
                        d._socialMediaPostType = "socialMediaPostType";
                }
                if (m.linkInlineVideoMuted != null && m.hasOwnProperty("linkInlineVideoMuted")) {
                    d.linkInlineVideoMuted = m.linkInlineVideoMuted;
                    if (o.oneofs)
                        d._linkInlineVideoMuted = "linkInlineVideoMuted";
                }
                if (m.videoContentUrl != null && m.hasOwnProperty("videoContentUrl")) {
                    d.videoContentUrl = m.videoContentUrl;
                    if (o.oneofs)
                        d._videoContentUrl = "videoContentUrl";
                }
                if (m.musicMetadata != null && m.hasOwnProperty("musicMetadata")) {
                    d.musicMetadata = $root.proto.EmbeddedMusic.toObject(m.musicMetadata, o);
                    if (o.oneofs)
                        d._musicMetadata = "musicMetadata";
                }
                if (m.videoContentCaption != null && m.hasOwnProperty("videoContentCaption")) {
                    d.videoContentCaption = m.videoContentCaption;
                    if (o.oneofs)
                        d._videoContentCaption = "videoContentCaption";
                }
                return d;
            };

            LinkPreviewMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LinkPreviewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.LinkPreviewMetadata";
            };

            LinkPreviewMetadata.SocialMediaPostType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "NONE"] = 0;
                values[valuesById[1] = "REEL"] = 1;
                values[valuesById[2] = "LIVE_VIDEO"] = 2;
                values[valuesById[3] = "LONG_VIDEO"] = 3;
                values[valuesById[4] = "SINGLE_IMAGE"] = 4;
                values[valuesById[5] = "CAROUSEL"] = 5;
                return values;
            })();

            return LinkPreviewMetadata;
        })();

        Message.ListMessage = (function() {

            function ListMessage(p) {
                this.sections = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ListMessage.prototype.title = null;
            ListMessage.prototype.description = null;
            ListMessage.prototype.buttonText = null;
            ListMessage.prototype.listType = null;
            ListMessage.prototype.sections = $util.emptyArray;
            ListMessage.prototype.productListInfo = null;
            ListMessage.prototype.footerText = null;
            ListMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListMessage.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListMessage.prototype, "_description", {
                get: $util.oneOfGetter($oneOfFields = ["description"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListMessage.prototype, "_buttonText", {
                get: $util.oneOfGetter($oneOfFields = ["buttonText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListMessage.prototype, "_listType", {
                get: $util.oneOfGetter($oneOfFields = ["listType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListMessage.prototype, "_productListInfo", {
                get: $util.oneOfGetter($oneOfFields = ["productListInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListMessage.prototype, "_footerText", {
                get: $util.oneOfGetter($oneOfFields = ["footerText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ListMessage.create = function create(properties) {
                return new ListMessage(properties);
            };

            ListMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(10).string(m.title);
                if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                    w.uint32(18).string(m.description);
                if (m.buttonText != null && Object.hasOwnProperty.call(m, "buttonText"))
                    w.uint32(26).string(m.buttonText);
                if (m.listType != null && Object.hasOwnProperty.call(m, "listType"))
                    w.uint32(32).int32(m.listType);
                if (m.sections != null && m.sections.length) {
                    for (var i = 0; i < m.sections.length; ++i)
                        $root.proto.Message.ListMessage.Section.encode(m.sections[i], w.uint32(42).fork()).ldelim();
                }
                if (m.productListInfo != null && Object.hasOwnProperty.call(m, "productListInfo"))
                    $root.proto.Message.ListMessage.ProductListInfo.encode(m.productListInfo, w.uint32(50).fork()).ldelim();
                if (m.footerText != null && Object.hasOwnProperty.call(m, "footerText"))
                    w.uint32(58).string(m.footerText);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(66).fork()).ldelim();
                return w;
            };

            ListMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.title = r.string();
                            break;
                        }
                    case 2: {
                            m.description = r.string();
                            break;
                        }
                    case 3: {
                            m.buttonText = r.string();
                            break;
                        }
                    case 4: {
                            m.listType = r.int32();
                            break;
                        }
                    case 5: {
                            if (!(m.sections && m.sections.length))
                                m.sections = [];
                            m.sections.push($root.proto.Message.ListMessage.Section.decode(r, r.uint32()));
                            break;
                        }
                    case 6: {
                            m.productListInfo = $root.proto.Message.ListMessage.ProductListInfo.decode(r, r.uint32());
                            break;
                        }
                    case 7: {
                            m.footerText = r.string();
                            break;
                        }
                    case 8: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ListMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ListMessage)
                    return d;
                var m = new $root.proto.Message.ListMessage();
                if (d.title != null) {
                    m.title = String(d.title);
                }
                if (d.description != null) {
                    m.description = String(d.description);
                }
                if (d.buttonText != null) {
                    m.buttonText = String(d.buttonText);
                }
                switch (d.listType) {
                default:
                    if (typeof d.listType === "number") {
                        m.listType = d.listType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.listType = 0;
                    break;
                case "SINGLE_SELECT":
                case 1:
                    m.listType = 1;
                    break;
                case "PRODUCT_LIST":
                case 2:
                    m.listType = 2;
                    break;
                }
                if (d.sections) {
                    if (!Array.isArray(d.sections))
                        throw TypeError(".proto.Message.ListMessage.sections: array expected");
                    m.sections = [];
                    for (var i = 0; i < d.sections.length; ++i) {
                        if (typeof d.sections[i] !== "object")
                            throw TypeError(".proto.Message.ListMessage.sections: object expected");
                        m.sections[i] = $root.proto.Message.ListMessage.Section.fromObject(d.sections[i]);
                    }
                }
                if (d.productListInfo != null) {
                    if (typeof d.productListInfo !== "object")
                        throw TypeError(".proto.Message.ListMessage.productListInfo: object expected");
                    m.productListInfo = $root.proto.Message.ListMessage.ProductListInfo.fromObject(d.productListInfo);
                }
                if (d.footerText != null) {
                    m.footerText = String(d.footerText);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ListMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            ListMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.sections = [];
                }
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.description != null && m.hasOwnProperty("description")) {
                    d.description = m.description;
                    if (o.oneofs)
                        d._description = "description";
                }
                if (m.buttonText != null && m.hasOwnProperty("buttonText")) {
                    d.buttonText = m.buttonText;
                    if (o.oneofs)
                        d._buttonText = "buttonText";
                }
                if (m.listType != null && m.hasOwnProperty("listType")) {
                    d.listType = o.enums === String ? $root.proto.Message.ListMessage.ListType[m.listType] === undefined ? m.listType : $root.proto.Message.ListMessage.ListType[m.listType] : m.listType;
                    if (o.oneofs)
                        d._listType = "listType";
                }
                if (m.sections && m.sections.length) {
                    d.sections = [];
                    for (var j = 0; j < m.sections.length; ++j) {
                        d.sections[j] = $root.proto.Message.ListMessage.Section.toObject(m.sections[j], o);
                    }
                }
                if (m.productListInfo != null && m.hasOwnProperty("productListInfo")) {
                    d.productListInfo = $root.proto.Message.ListMessage.ProductListInfo.toObject(m.productListInfo, o);
                    if (o.oneofs)
                        d._productListInfo = "productListInfo";
                }
                if (m.footerText != null && m.hasOwnProperty("footerText")) {
                    d.footerText = m.footerText;
                    if (o.oneofs)
                        d._footerText = "footerText";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            ListMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ListMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ListMessage";
            };

            ListMessage.ListType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "SINGLE_SELECT"] = 1;
                values[valuesById[2] = "PRODUCT_LIST"] = 2;
                return values;
            })();

            ListMessage.Product = (function() {

                function Product(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Product.prototype.productId = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Product.prototype, "_productId", {
                    get: $util.oneOfGetter($oneOfFields = ["productId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Product.create = function create(properties) {
                    return new Product(properties);
                };

                Product.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.productId != null && Object.hasOwnProperty.call(m, "productId"))
                        w.uint32(10).string(m.productId);
                    return w;
                };

                Product.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListMessage.Product();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.productId = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Product.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ListMessage.Product)
                        return d;
                    var m = new $root.proto.Message.ListMessage.Product();
                    if (d.productId != null) {
                        m.productId = String(d.productId);
                    }
                    return m;
                };

                Product.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.productId != null && m.hasOwnProperty("productId")) {
                        d.productId = m.productId;
                        if (o.oneofs)
                            d._productId = "productId";
                    }
                    return d;
                };

                Product.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Product.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ListMessage.Product";
                };

                return Product;
            })();

            ListMessage.ProductListHeaderImage = (function() {

                function ProductListHeaderImage(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                ProductListHeaderImage.prototype.productId = null;
                ProductListHeaderImage.prototype.jpegThumbnail = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductListHeaderImage.prototype, "_productId", {
                    get: $util.oneOfGetter($oneOfFields = ["productId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductListHeaderImage.prototype, "_jpegThumbnail", {
                    get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                ProductListHeaderImage.create = function create(properties) {
                    return new ProductListHeaderImage(properties);
                };

                ProductListHeaderImage.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.productId != null && Object.hasOwnProperty.call(m, "productId"))
                        w.uint32(10).string(m.productId);
                    if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                        w.uint32(18).bytes(m.jpegThumbnail);
                    return w;
                };

                ProductListHeaderImage.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListMessage.ProductListHeaderImage();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.productId = r.string();
                                break;
                            }
                        case 2: {
                                m.jpegThumbnail = r.bytes();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                ProductListHeaderImage.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ListMessage.ProductListHeaderImage)
                        return d;
                    var m = new $root.proto.Message.ListMessage.ProductListHeaderImage();
                    if (d.productId != null) {
                        m.productId = String(d.productId);
                    }
                    if (d.jpegThumbnail != null) {
                        if (typeof d.jpegThumbnail === "string")
                            $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                        else if (d.jpegThumbnail.length >= 0)
                            m.jpegThumbnail = d.jpegThumbnail;
                    }
                    return m;
                };

                ProductListHeaderImage.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.productId != null && m.hasOwnProperty("productId")) {
                        d.productId = m.productId;
                        if (o.oneofs)
                            d._productId = "productId";
                    }
                    if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                        d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                        if (o.oneofs)
                            d._jpegThumbnail = "jpegThumbnail";
                    }
                    return d;
                };

                ProductListHeaderImage.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                ProductListHeaderImage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ListMessage.ProductListHeaderImage";
                };

                return ProductListHeaderImage;
            })();

            ListMessage.ProductListInfo = (function() {

                function ProductListInfo(p) {
                    this.productSections = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                ProductListInfo.prototype.productSections = $util.emptyArray;
                ProductListInfo.prototype.headerImage = null;
                ProductListInfo.prototype.businessOwnerJid = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductListInfo.prototype, "_headerImage", {
                    get: $util.oneOfGetter($oneOfFields = ["headerImage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductListInfo.prototype, "_businessOwnerJid", {
                    get: $util.oneOfGetter($oneOfFields = ["businessOwnerJid"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                ProductListInfo.create = function create(properties) {
                    return new ProductListInfo(properties);
                };

                ProductListInfo.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.productSections != null && m.productSections.length) {
                        for (var i = 0; i < m.productSections.length; ++i)
                            $root.proto.Message.ListMessage.ProductSection.encode(m.productSections[i], w.uint32(10).fork()).ldelim();
                    }
                    if (m.headerImage != null && Object.hasOwnProperty.call(m, "headerImage"))
                        $root.proto.Message.ListMessage.ProductListHeaderImage.encode(m.headerImage, w.uint32(18).fork()).ldelim();
                    if (m.businessOwnerJid != null && Object.hasOwnProperty.call(m, "businessOwnerJid"))
                        w.uint32(26).string(m.businessOwnerJid);
                    return w;
                };

                ProductListInfo.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListMessage.ProductListInfo();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                if (!(m.productSections && m.productSections.length))
                                    m.productSections = [];
                                m.productSections.push($root.proto.Message.ListMessage.ProductSection.decode(r, r.uint32()));
                                break;
                            }
                        case 2: {
                                m.headerImage = $root.proto.Message.ListMessage.ProductListHeaderImage.decode(r, r.uint32());
                                break;
                            }
                        case 3: {
                                m.businessOwnerJid = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                ProductListInfo.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ListMessage.ProductListInfo)
                        return d;
                    var m = new $root.proto.Message.ListMessage.ProductListInfo();
                    if (d.productSections) {
                        if (!Array.isArray(d.productSections))
                            throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: array expected");
                        m.productSections = [];
                        for (var i = 0; i < d.productSections.length; ++i) {
                            if (typeof d.productSections[i] !== "object")
                                throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: object expected");
                            m.productSections[i] = $root.proto.Message.ListMessage.ProductSection.fromObject(d.productSections[i]);
                        }
                    }
                    if (d.headerImage != null) {
                        if (typeof d.headerImage !== "object")
                            throw TypeError(".proto.Message.ListMessage.ProductListInfo.headerImage: object expected");
                        m.headerImage = $root.proto.Message.ListMessage.ProductListHeaderImage.fromObject(d.headerImage);
                    }
                    if (d.businessOwnerJid != null) {
                        m.businessOwnerJid = String(d.businessOwnerJid);
                    }
                    return m;
                };

                ProductListInfo.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.productSections = [];
                    }
                    if (m.productSections && m.productSections.length) {
                        d.productSections = [];
                        for (var j = 0; j < m.productSections.length; ++j) {
                            d.productSections[j] = $root.proto.Message.ListMessage.ProductSection.toObject(m.productSections[j], o);
                        }
                    }
                    if (m.headerImage != null && m.hasOwnProperty("headerImage")) {
                        d.headerImage = $root.proto.Message.ListMessage.ProductListHeaderImage.toObject(m.headerImage, o);
                        if (o.oneofs)
                            d._headerImage = "headerImage";
                    }
                    if (m.businessOwnerJid != null && m.hasOwnProperty("businessOwnerJid")) {
                        d.businessOwnerJid = m.businessOwnerJid;
                        if (o.oneofs)
                            d._businessOwnerJid = "businessOwnerJid";
                    }
                    return d;
                };

                ProductListInfo.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                ProductListInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ListMessage.ProductListInfo";
                };

                return ProductListInfo;
            })();

            ListMessage.ProductSection = (function() {

                function ProductSection(p) {
                    this.products = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                ProductSection.prototype.title = null;
                ProductSection.prototype.products = $util.emptyArray;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSection.prototype, "_title", {
                    get: $util.oneOfGetter($oneOfFields = ["title"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                ProductSection.create = function create(properties) {
                    return new ProductSection(properties);
                };

                ProductSection.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                        w.uint32(10).string(m.title);
                    if (m.products != null && m.products.length) {
                        for (var i = 0; i < m.products.length; ++i)
                            $root.proto.Message.ListMessage.Product.encode(m.products[i], w.uint32(18).fork()).ldelim();
                    }
                    return w;
                };

                ProductSection.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListMessage.ProductSection();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.title = r.string();
                                break;
                            }
                        case 2: {
                                if (!(m.products && m.products.length))
                                    m.products = [];
                                m.products.push($root.proto.Message.ListMessage.Product.decode(r, r.uint32()));
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                ProductSection.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ListMessage.ProductSection)
                        return d;
                    var m = new $root.proto.Message.ListMessage.ProductSection();
                    if (d.title != null) {
                        m.title = String(d.title);
                    }
                    if (d.products) {
                        if (!Array.isArray(d.products))
                            throw TypeError(".proto.Message.ListMessage.ProductSection.products: array expected");
                        m.products = [];
                        for (var i = 0; i < d.products.length; ++i) {
                            if (typeof d.products[i] !== "object")
                                throw TypeError(".proto.Message.ListMessage.ProductSection.products: object expected");
                            m.products[i] = $root.proto.Message.ListMessage.Product.fromObject(d.products[i]);
                        }
                    }
                    return m;
                };

                ProductSection.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.products = [];
                    }
                    if (m.title != null && m.hasOwnProperty("title")) {
                        d.title = m.title;
                        if (o.oneofs)
                            d._title = "title";
                    }
                    if (m.products && m.products.length) {
                        d.products = [];
                        for (var j = 0; j < m.products.length; ++j) {
                            d.products[j] = $root.proto.Message.ListMessage.Product.toObject(m.products[j], o);
                        }
                    }
                    return d;
                };

                ProductSection.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                ProductSection.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ListMessage.ProductSection";
                };

                return ProductSection;
            })();

            ListMessage.Row = (function() {

                function Row(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Row.prototype.title = null;
                Row.prototype.description = null;
                Row.prototype.rowId = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Row.prototype, "_title", {
                    get: $util.oneOfGetter($oneOfFields = ["title"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Row.prototype, "_description", {
                    get: $util.oneOfGetter($oneOfFields = ["description"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Row.prototype, "_rowId", {
                    get: $util.oneOfGetter($oneOfFields = ["rowId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Row.create = function create(properties) {
                    return new Row(properties);
                };

                Row.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                        w.uint32(10).string(m.title);
                    if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                        w.uint32(18).string(m.description);
                    if (m.rowId != null && Object.hasOwnProperty.call(m, "rowId"))
                        w.uint32(26).string(m.rowId);
                    return w;
                };

                Row.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListMessage.Row();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.title = r.string();
                                break;
                            }
                        case 2: {
                                m.description = r.string();
                                break;
                            }
                        case 3: {
                                m.rowId = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Row.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ListMessage.Row)
                        return d;
                    var m = new $root.proto.Message.ListMessage.Row();
                    if (d.title != null) {
                        m.title = String(d.title);
                    }
                    if (d.description != null) {
                        m.description = String(d.description);
                    }
                    if (d.rowId != null) {
                        m.rowId = String(d.rowId);
                    }
                    return m;
                };

                Row.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.title != null && m.hasOwnProperty("title")) {
                        d.title = m.title;
                        if (o.oneofs)
                            d._title = "title";
                    }
                    if (m.description != null && m.hasOwnProperty("description")) {
                        d.description = m.description;
                        if (o.oneofs)
                            d._description = "description";
                    }
                    if (m.rowId != null && m.hasOwnProperty("rowId")) {
                        d.rowId = m.rowId;
                        if (o.oneofs)
                            d._rowId = "rowId";
                    }
                    return d;
                };

                Row.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ListMessage.Row";
                };

                return Row;
            })();

            ListMessage.Section = (function() {

                function Section(p) {
                    this.rows = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Section.prototype.title = null;
                Section.prototype.rows = $util.emptyArray;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Section.prototype, "_title", {
                    get: $util.oneOfGetter($oneOfFields = ["title"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Section.create = function create(properties) {
                    return new Section(properties);
                };

                Section.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                        w.uint32(10).string(m.title);
                    if (m.rows != null && m.rows.length) {
                        for (var i = 0; i < m.rows.length; ++i)
                            $root.proto.Message.ListMessage.Row.encode(m.rows[i], w.uint32(18).fork()).ldelim();
                    }
                    return w;
                };

                Section.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListMessage.Section();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.title = r.string();
                                break;
                            }
                        case 2: {
                                if (!(m.rows && m.rows.length))
                                    m.rows = [];
                                m.rows.push($root.proto.Message.ListMessage.Row.decode(r, r.uint32()));
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Section.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ListMessage.Section)
                        return d;
                    var m = new $root.proto.Message.ListMessage.Section();
                    if (d.title != null) {
                        m.title = String(d.title);
                    }
                    if (d.rows) {
                        if (!Array.isArray(d.rows))
                            throw TypeError(".proto.Message.ListMessage.Section.rows: array expected");
                        m.rows = [];
                        for (var i = 0; i < d.rows.length; ++i) {
                            if (typeof d.rows[i] !== "object")
                                throw TypeError(".proto.Message.ListMessage.Section.rows: object expected");
                            m.rows[i] = $root.proto.Message.ListMessage.Row.fromObject(d.rows[i]);
                        }
                    }
                    return m;
                };

                Section.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.rows = [];
                    }
                    if (m.title != null && m.hasOwnProperty("title")) {
                        d.title = m.title;
                        if (o.oneofs)
                            d._title = "title";
                    }
                    if (m.rows && m.rows.length) {
                        d.rows = [];
                        for (var j = 0; j < m.rows.length; ++j) {
                            d.rows[j] = $root.proto.Message.ListMessage.Row.toObject(m.rows[j], o);
                        }
                    }
                    return d;
                };

                Section.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Section.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ListMessage.Section";
                };

                return Section;
            })();

            return ListMessage;
        })();

        Message.ListResponseMessage = (function() {

            function ListResponseMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ListResponseMessage.prototype.title = null;
            ListResponseMessage.prototype.listType = null;
            ListResponseMessage.prototype.singleSelectReply = null;
            ListResponseMessage.prototype.contextInfo = null;
            ListResponseMessage.prototype.description = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListResponseMessage.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListResponseMessage.prototype, "_listType", {
                get: $util.oneOfGetter($oneOfFields = ["listType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListResponseMessage.prototype, "_singleSelectReply", {
                get: $util.oneOfGetter($oneOfFields = ["singleSelectReply"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListResponseMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ListResponseMessage.prototype, "_description", {
                get: $util.oneOfGetter($oneOfFields = ["description"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ListResponseMessage.create = function create(properties) {
                return new ListResponseMessage(properties);
            };

            ListResponseMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(10).string(m.title);
                if (m.listType != null && Object.hasOwnProperty.call(m, "listType"))
                    w.uint32(16).int32(m.listType);
                if (m.singleSelectReply != null && Object.hasOwnProperty.call(m, "singleSelectReply"))
                    $root.proto.Message.ListResponseMessage.SingleSelectReply.encode(m.singleSelectReply, w.uint32(26).fork()).ldelim();
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(34).fork()).ldelim();
                if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                    w.uint32(42).string(m.description);
                return w;
            };

            ListResponseMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListResponseMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.title = r.string();
                            break;
                        }
                    case 2: {
                            m.listType = r.int32();
                            break;
                        }
                    case 3: {
                            m.singleSelectReply = $root.proto.Message.ListResponseMessage.SingleSelectReply.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 5: {
                            m.description = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ListResponseMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ListResponseMessage)
                    return d;
                var m = new $root.proto.Message.ListResponseMessage();
                if (d.title != null) {
                    m.title = String(d.title);
                }
                switch (d.listType) {
                default:
                    if (typeof d.listType === "number") {
                        m.listType = d.listType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.listType = 0;
                    break;
                case "SINGLE_SELECT":
                case 1:
                    m.listType = 1;
                    break;
                }
                if (d.singleSelectReply != null) {
                    if (typeof d.singleSelectReply !== "object")
                        throw TypeError(".proto.Message.ListResponseMessage.singleSelectReply: object expected");
                    m.singleSelectReply = $root.proto.Message.ListResponseMessage.SingleSelectReply.fromObject(d.singleSelectReply);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ListResponseMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.description != null) {
                    m.description = String(d.description);
                }
                return m;
            };

            ListResponseMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.listType != null && m.hasOwnProperty("listType")) {
                    d.listType = o.enums === String ? $root.proto.Message.ListResponseMessage.ListType[m.listType] === undefined ? m.listType : $root.proto.Message.ListResponseMessage.ListType[m.listType] : m.listType;
                    if (o.oneofs)
                        d._listType = "listType";
                }
                if (m.singleSelectReply != null && m.hasOwnProperty("singleSelectReply")) {
                    d.singleSelectReply = $root.proto.Message.ListResponseMessage.SingleSelectReply.toObject(m.singleSelectReply, o);
                    if (o.oneofs)
                        d._singleSelectReply = "singleSelectReply";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.description != null && m.hasOwnProperty("description")) {
                    d.description = m.description;
                    if (o.oneofs)
                        d._description = "description";
                }
                return d;
            };

            ListResponseMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ListResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ListResponseMessage";
            };

            ListResponseMessage.ListType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "SINGLE_SELECT"] = 1;
                return values;
            })();

            ListResponseMessage.SingleSelectReply = (function() {

                function SingleSelectReply(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                SingleSelectReply.prototype.selectedRowId = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SingleSelectReply.prototype, "_selectedRowId", {
                    get: $util.oneOfGetter($oneOfFields = ["selectedRowId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                SingleSelectReply.create = function create(properties) {
                    return new SingleSelectReply(properties);
                };

                SingleSelectReply.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.selectedRowId != null && Object.hasOwnProperty.call(m, "selectedRowId"))
                        w.uint32(10).string(m.selectedRowId);
                    return w;
                };

                SingleSelectReply.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ListResponseMessage.SingleSelectReply();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.selectedRowId = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                SingleSelectReply.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ListResponseMessage.SingleSelectReply)
                        return d;
                    var m = new $root.proto.Message.ListResponseMessage.SingleSelectReply();
                    if (d.selectedRowId != null) {
                        m.selectedRowId = String(d.selectedRowId);
                    }
                    return m;
                };

                SingleSelectReply.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.selectedRowId != null && m.hasOwnProperty("selectedRowId")) {
                        d.selectedRowId = m.selectedRowId;
                        if (o.oneofs)
                            d._selectedRowId = "selectedRowId";
                    }
                    return d;
                };

                SingleSelectReply.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                SingleSelectReply.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ListResponseMessage.SingleSelectReply";
                };

                return SingleSelectReply;
            })();

            return ListResponseMessage;
        })();

        Message.LiveLocationMessage = (function() {

            function LiveLocationMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LiveLocationMessage.prototype.degreesLatitude = null;
            LiveLocationMessage.prototype.degreesLongitude = null;
            LiveLocationMessage.prototype.accuracyInMeters = null;
            LiveLocationMessage.prototype.speedInMps = null;
            LiveLocationMessage.prototype.degreesClockwiseFromMagneticNorth = null;
            LiveLocationMessage.prototype.caption = null;
            LiveLocationMessage.prototype.sequenceNumber = null;
            LiveLocationMessage.prototype.timeOffset = null;
            LiveLocationMessage.prototype.jpegThumbnail = null;
            LiveLocationMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_degreesLatitude", {
                get: $util.oneOfGetter($oneOfFields = ["degreesLatitude"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_degreesLongitude", {
                get: $util.oneOfGetter($oneOfFields = ["degreesLongitude"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_accuracyInMeters", {
                get: $util.oneOfGetter($oneOfFields = ["accuracyInMeters"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_speedInMps", {
                get: $util.oneOfGetter($oneOfFields = ["speedInMps"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_degreesClockwiseFromMagneticNorth", {
                get: $util.oneOfGetter($oneOfFields = ["degreesClockwiseFromMagneticNorth"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_sequenceNumber", {
                get: $util.oneOfGetter($oneOfFields = ["sequenceNumber"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_timeOffset", {
                get: $util.oneOfGetter($oneOfFields = ["timeOffset"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LiveLocationMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LiveLocationMessage.create = function create(properties) {
                return new LiveLocationMessage(properties);
            };

            LiveLocationMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.degreesLatitude != null && Object.hasOwnProperty.call(m, "degreesLatitude"))
                    w.uint32(9).double(m.degreesLatitude);
                if (m.degreesLongitude != null && Object.hasOwnProperty.call(m, "degreesLongitude"))
                    w.uint32(17).double(m.degreesLongitude);
                if (m.accuracyInMeters != null && Object.hasOwnProperty.call(m, "accuracyInMeters"))
                    w.uint32(24).uint32(m.accuracyInMeters);
                if (m.speedInMps != null && Object.hasOwnProperty.call(m, "speedInMps"))
                    w.uint32(37).float(m.speedInMps);
                if (m.degreesClockwiseFromMagneticNorth != null && Object.hasOwnProperty.call(m, "degreesClockwiseFromMagneticNorth"))
                    w.uint32(40).uint32(m.degreesClockwiseFromMagneticNorth);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(50).string(m.caption);
                if (m.sequenceNumber != null && Object.hasOwnProperty.call(m, "sequenceNumber"))
                    w.uint32(56).int64(m.sequenceNumber);
                if (m.timeOffset != null && Object.hasOwnProperty.call(m, "timeOffset"))
                    w.uint32(64).uint32(m.timeOffset);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(130).bytes(m.jpegThumbnail);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                return w;
            };

            LiveLocationMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.LiveLocationMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.degreesLatitude = r.double();
                            break;
                        }
                    case 2: {
                            m.degreesLongitude = r.double();
                            break;
                        }
                    case 3: {
                            m.accuracyInMeters = r.uint32();
                            break;
                        }
                    case 4: {
                            m.speedInMps = r.float();
                            break;
                        }
                    case 5: {
                            m.degreesClockwiseFromMagneticNorth = r.uint32();
                            break;
                        }
                    case 6: {
                            m.caption = r.string();
                            break;
                        }
                    case 7: {
                            m.sequenceNumber = r.int64();
                            break;
                        }
                    case 8: {
                            m.timeOffset = r.uint32();
                            break;
                        }
                    case 16: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LiveLocationMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.LiveLocationMessage)
                    return d;
                var m = new $root.proto.Message.LiveLocationMessage();
                if (d.degreesLatitude != null) {
                    m.degreesLatitude = Number(d.degreesLatitude);
                }
                if (d.degreesLongitude != null) {
                    m.degreesLongitude = Number(d.degreesLongitude);
                }
                if (d.accuracyInMeters != null) {
                    m.accuracyInMeters = d.accuracyInMeters >>> 0;
                }
                if (d.speedInMps != null) {
                    m.speedInMps = Number(d.speedInMps);
                }
                if (d.degreesClockwiseFromMagneticNorth != null) {
                    m.degreesClockwiseFromMagneticNorth = d.degreesClockwiseFromMagneticNorth >>> 0;
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.sequenceNumber != null) {
                    if ($util.Long)
                        (m.sequenceNumber = $util.Long.fromValue(d.sequenceNumber)).unsigned = false;
                    else if (typeof d.sequenceNumber === "string")
                        m.sequenceNumber = parseInt(d.sequenceNumber, 10);
                    else if (typeof d.sequenceNumber === "number")
                        m.sequenceNumber = d.sequenceNumber;
                    else if (typeof d.sequenceNumber === "object")
                        m.sequenceNumber = new $util.LongBits(d.sequenceNumber.low >>> 0, d.sequenceNumber.high >>> 0).toNumber();
                }
                if (d.timeOffset != null) {
                    m.timeOffset = d.timeOffset >>> 0;
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.LiveLocationMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            LiveLocationMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.degreesLatitude != null && m.hasOwnProperty("degreesLatitude")) {
                    d.degreesLatitude = o.json && !isFinite(m.degreesLatitude) ? String(m.degreesLatitude) : m.degreesLatitude;
                    if (o.oneofs)
                        d._degreesLatitude = "degreesLatitude";
                }
                if (m.degreesLongitude != null && m.hasOwnProperty("degreesLongitude")) {
                    d.degreesLongitude = o.json && !isFinite(m.degreesLongitude) ? String(m.degreesLongitude) : m.degreesLongitude;
                    if (o.oneofs)
                        d._degreesLongitude = "degreesLongitude";
                }
                if (m.accuracyInMeters != null && m.hasOwnProperty("accuracyInMeters")) {
                    d.accuracyInMeters = m.accuracyInMeters;
                    if (o.oneofs)
                        d._accuracyInMeters = "accuracyInMeters";
                }
                if (m.speedInMps != null && m.hasOwnProperty("speedInMps")) {
                    d.speedInMps = o.json && !isFinite(m.speedInMps) ? String(m.speedInMps) : m.speedInMps;
                    if (o.oneofs)
                        d._speedInMps = "speedInMps";
                }
                if (m.degreesClockwiseFromMagneticNorth != null && m.hasOwnProperty("degreesClockwiseFromMagneticNorth")) {
                    d.degreesClockwiseFromMagneticNorth = m.degreesClockwiseFromMagneticNorth;
                    if (o.oneofs)
                        d._degreesClockwiseFromMagneticNorth = "degreesClockwiseFromMagneticNorth";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                if (m.sequenceNumber != null && m.hasOwnProperty("sequenceNumber")) {
                    if (typeof m.sequenceNumber === "number")
                        d.sequenceNumber = o.longs === String ? String(m.sequenceNumber) : m.sequenceNumber;
                    else
                        d.sequenceNumber = o.longs === String ? longToString(m.sequenceNumber) : o.longs === Number ? longToNumber(m.sequenceNumber) : m.sequenceNumber;
                    if (o.oneofs)
                        d._sequenceNumber = "sequenceNumber";
                }
                if (m.timeOffset != null && m.hasOwnProperty("timeOffset")) {
                    d.timeOffset = m.timeOffset;
                    if (o.oneofs)
                        d._timeOffset = "timeOffset";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            LiveLocationMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LiveLocationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.LiveLocationMessage";
            };

            return LiveLocationMessage;
        })();

        Message.LocationMessage = (function() {

            function LocationMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LocationMessage.prototype.degreesLatitude = null;
            LocationMessage.prototype.degreesLongitude = null;
            LocationMessage.prototype.name = null;
            LocationMessage.prototype.address = null;
            LocationMessage.prototype.url = null;
            LocationMessage.prototype.isLive = null;
            LocationMessage.prototype.accuracyInMeters = null;
            LocationMessage.prototype.speedInMps = null;
            LocationMessage.prototype.degreesClockwiseFromMagneticNorth = null;
            LocationMessage.prototype.comment = null;
            LocationMessage.prototype.jpegThumbnail = null;
            LocationMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_degreesLatitude", {
                get: $util.oneOfGetter($oneOfFields = ["degreesLatitude"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_degreesLongitude", {
                get: $util.oneOfGetter($oneOfFields = ["degreesLongitude"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_address", {
                get: $util.oneOfGetter($oneOfFields = ["address"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_isLive", {
                get: $util.oneOfGetter($oneOfFields = ["isLive"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_accuracyInMeters", {
                get: $util.oneOfGetter($oneOfFields = ["accuracyInMeters"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_speedInMps", {
                get: $util.oneOfGetter($oneOfFields = ["speedInMps"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_degreesClockwiseFromMagneticNorth", {
                get: $util.oneOfGetter($oneOfFields = ["degreesClockwiseFromMagneticNorth"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_comment", {
                get: $util.oneOfGetter($oneOfFields = ["comment"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocationMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LocationMessage.create = function create(properties) {
                return new LocationMessage(properties);
            };

            LocationMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.degreesLatitude != null && Object.hasOwnProperty.call(m, "degreesLatitude"))
                    w.uint32(9).double(m.degreesLatitude);
                if (m.degreesLongitude != null && Object.hasOwnProperty.call(m, "degreesLongitude"))
                    w.uint32(17).double(m.degreesLongitude);
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(26).string(m.name);
                if (m.address != null && Object.hasOwnProperty.call(m, "address"))
                    w.uint32(34).string(m.address);
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(42).string(m.url);
                if (m.isLive != null && Object.hasOwnProperty.call(m, "isLive"))
                    w.uint32(48).bool(m.isLive);
                if (m.accuracyInMeters != null && Object.hasOwnProperty.call(m, "accuracyInMeters"))
                    w.uint32(56).uint32(m.accuracyInMeters);
                if (m.speedInMps != null && Object.hasOwnProperty.call(m, "speedInMps"))
                    w.uint32(69).float(m.speedInMps);
                if (m.degreesClockwiseFromMagneticNorth != null && Object.hasOwnProperty.call(m, "degreesClockwiseFromMagneticNorth"))
                    w.uint32(72).uint32(m.degreesClockwiseFromMagneticNorth);
                if (m.comment != null && Object.hasOwnProperty.call(m, "comment"))
                    w.uint32(90).string(m.comment);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(130).bytes(m.jpegThumbnail);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                return w;
            };

            LocationMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.LocationMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.degreesLatitude = r.double();
                            break;
                        }
                    case 2: {
                            m.degreesLongitude = r.double();
                            break;
                        }
                    case 3: {
                            m.name = r.string();
                            break;
                        }
                    case 4: {
                            m.address = r.string();
                            break;
                        }
                    case 5: {
                            m.url = r.string();
                            break;
                        }
                    case 6: {
                            m.isLive = r.bool();
                            break;
                        }
                    case 7: {
                            m.accuracyInMeters = r.uint32();
                            break;
                        }
                    case 8: {
                            m.speedInMps = r.float();
                            break;
                        }
                    case 9: {
                            m.degreesClockwiseFromMagneticNorth = r.uint32();
                            break;
                        }
                    case 11: {
                            m.comment = r.string();
                            break;
                        }
                    case 16: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LocationMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.LocationMessage)
                    return d;
                var m = new $root.proto.Message.LocationMessage();
                if (d.degreesLatitude != null) {
                    m.degreesLatitude = Number(d.degreesLatitude);
                }
                if (d.degreesLongitude != null) {
                    m.degreesLongitude = Number(d.degreesLongitude);
                }
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.address != null) {
                    m.address = String(d.address);
                }
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.isLive != null) {
                    m.isLive = Boolean(d.isLive);
                }
                if (d.accuracyInMeters != null) {
                    m.accuracyInMeters = d.accuracyInMeters >>> 0;
                }
                if (d.speedInMps != null) {
                    m.speedInMps = Number(d.speedInMps);
                }
                if (d.degreesClockwiseFromMagneticNorth != null) {
                    m.degreesClockwiseFromMagneticNorth = d.degreesClockwiseFromMagneticNorth >>> 0;
                }
                if (d.comment != null) {
                    m.comment = String(d.comment);
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.LocationMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            LocationMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.degreesLatitude != null && m.hasOwnProperty("degreesLatitude")) {
                    d.degreesLatitude = o.json && !isFinite(m.degreesLatitude) ? String(m.degreesLatitude) : m.degreesLatitude;
                    if (o.oneofs)
                        d._degreesLatitude = "degreesLatitude";
                }
                if (m.degreesLongitude != null && m.hasOwnProperty("degreesLongitude")) {
                    d.degreesLongitude = o.json && !isFinite(m.degreesLongitude) ? String(m.degreesLongitude) : m.degreesLongitude;
                    if (o.oneofs)
                        d._degreesLongitude = "degreesLongitude";
                }
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.address != null && m.hasOwnProperty("address")) {
                    d.address = m.address;
                    if (o.oneofs)
                        d._address = "address";
                }
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.isLive != null && m.hasOwnProperty("isLive")) {
                    d.isLive = m.isLive;
                    if (o.oneofs)
                        d._isLive = "isLive";
                }
                if (m.accuracyInMeters != null && m.hasOwnProperty("accuracyInMeters")) {
                    d.accuracyInMeters = m.accuracyInMeters;
                    if (o.oneofs)
                        d._accuracyInMeters = "accuracyInMeters";
                }
                if (m.speedInMps != null && m.hasOwnProperty("speedInMps")) {
                    d.speedInMps = o.json && !isFinite(m.speedInMps) ? String(m.speedInMps) : m.speedInMps;
                    if (o.oneofs)
                        d._speedInMps = "speedInMps";
                }
                if (m.degreesClockwiseFromMagneticNorth != null && m.hasOwnProperty("degreesClockwiseFromMagneticNorth")) {
                    d.degreesClockwiseFromMagneticNorth = m.degreesClockwiseFromMagneticNorth;
                    if (o.oneofs)
                        d._degreesClockwiseFromMagneticNorth = "degreesClockwiseFromMagneticNorth";
                }
                if (m.comment != null && m.hasOwnProperty("comment")) {
                    d.comment = m.comment;
                    if (o.oneofs)
                        d._comment = "comment";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            LocationMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LocationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.LocationMessage";
            };

            return LocationMessage;
        })();

        Message.MMSThumbnailMetadata = (function() {

            function MMSThumbnailMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MMSThumbnailMetadata.prototype.thumbnailDirectPath = null;
            MMSThumbnailMetadata.prototype.thumbnailSha256 = null;
            MMSThumbnailMetadata.prototype.thumbnailEncSha256 = null;
            MMSThumbnailMetadata.prototype.mediaKey = null;
            MMSThumbnailMetadata.prototype.mediaKeyTimestamp = null;
            MMSThumbnailMetadata.prototype.thumbnailHeight = null;
            MMSThumbnailMetadata.prototype.thumbnailWidth = null;
            MMSThumbnailMetadata.prototype.mediaKeyDomain = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailDirectPath", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MMSThumbnailMetadata.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MMSThumbnailMetadata.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailHeight", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailHeight"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailWidth", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailWidth"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MMSThumbnailMetadata.prototype, "_mediaKeyDomain", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyDomain"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MMSThumbnailMetadata.create = function create(properties) {
                return new MMSThumbnailMetadata(properties);
            };

            MMSThumbnailMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.thumbnailDirectPath != null && Object.hasOwnProperty.call(m, "thumbnailDirectPath"))
                    w.uint32(10).string(m.thumbnailDirectPath);
                if (m.thumbnailSha256 != null && Object.hasOwnProperty.call(m, "thumbnailSha256"))
                    w.uint32(18).bytes(m.thumbnailSha256);
                if (m.thumbnailEncSha256 != null && Object.hasOwnProperty.call(m, "thumbnailEncSha256"))
                    w.uint32(26).bytes(m.thumbnailEncSha256);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(34).bytes(m.mediaKey);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(40).int64(m.mediaKeyTimestamp);
                if (m.thumbnailHeight != null && Object.hasOwnProperty.call(m, "thumbnailHeight"))
                    w.uint32(48).uint32(m.thumbnailHeight);
                if (m.thumbnailWidth != null && Object.hasOwnProperty.call(m, "thumbnailWidth"))
                    w.uint32(56).uint32(m.thumbnailWidth);
                if (m.mediaKeyDomain != null && Object.hasOwnProperty.call(m, "mediaKeyDomain"))
                    w.uint32(64).int32(m.mediaKeyDomain);
                return w;
            };

            MMSThumbnailMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.MMSThumbnailMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.thumbnailDirectPath = r.string();
                            break;
                        }
                    case 2: {
                            m.thumbnailSha256 = r.bytes();
                            break;
                        }
                    case 3: {
                            m.thumbnailEncSha256 = r.bytes();
                            break;
                        }
                    case 4: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 5: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 6: {
                            m.thumbnailHeight = r.uint32();
                            break;
                        }
                    case 7: {
                            m.thumbnailWidth = r.uint32();
                            break;
                        }
                    case 8: {
                            m.mediaKeyDomain = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MMSThumbnailMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.MMSThumbnailMetadata)
                    return d;
                var m = new $root.proto.Message.MMSThumbnailMetadata();
                if (d.thumbnailDirectPath != null) {
                    m.thumbnailDirectPath = String(d.thumbnailDirectPath);
                }
                if (d.thumbnailSha256 != null) {
                    if (typeof d.thumbnailSha256 === "string")
                        $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0);
                    else if (d.thumbnailSha256.length >= 0)
                        m.thumbnailSha256 = d.thumbnailSha256;
                }
                if (d.thumbnailEncSha256 != null) {
                    if (typeof d.thumbnailEncSha256 === "string")
                        $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0);
                    else if (d.thumbnailEncSha256.length >= 0)
                        m.thumbnailEncSha256 = d.thumbnailEncSha256;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.thumbnailHeight != null) {
                    m.thumbnailHeight = d.thumbnailHeight >>> 0;
                }
                if (d.thumbnailWidth != null) {
                    m.thumbnailWidth = d.thumbnailWidth >>> 0;
                }
                switch (d.mediaKeyDomain) {
                default:
                    if (typeof d.mediaKeyDomain === "number") {
                        m.mediaKeyDomain = d.mediaKeyDomain;
                        break;
                    }
                    break;
                case "UNSET":
                case 0:
                    m.mediaKeyDomain = 0;
                    break;
                case "E2EE_CHAT":
                case 1:
                    m.mediaKeyDomain = 1;
                    break;
                case "STATUS":
                case 2:
                    m.mediaKeyDomain = 2;
                    break;
                case "CAPI":
                case 3:
                    m.mediaKeyDomain = 3;
                    break;
                case "BOT":
                case 4:
                    m.mediaKeyDomain = 4;
                    break;
                }
                return m;
            };

            MMSThumbnailMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) {
                    d.thumbnailDirectPath = m.thumbnailDirectPath;
                    if (o.oneofs)
                        d._thumbnailDirectPath = "thumbnailDirectPath";
                }
                if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) {
                    d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256;
                    if (o.oneofs)
                        d._thumbnailSha256 = "thumbnailSha256";
                }
                if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) {
                    d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256;
                    if (o.oneofs)
                        d._thumbnailEncSha256 = "thumbnailEncSha256";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.thumbnailHeight != null && m.hasOwnProperty("thumbnailHeight")) {
                    d.thumbnailHeight = m.thumbnailHeight;
                    if (o.oneofs)
                        d._thumbnailHeight = "thumbnailHeight";
                }
                if (m.thumbnailWidth != null && m.hasOwnProperty("thumbnailWidth")) {
                    d.thumbnailWidth = m.thumbnailWidth;
                    if (o.oneofs)
                        d._thumbnailWidth = "thumbnailWidth";
                }
                if (m.mediaKeyDomain != null && m.hasOwnProperty("mediaKeyDomain")) {
                    d.mediaKeyDomain = o.enums === String ? $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] === undefined ? m.mediaKeyDomain : $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] : m.mediaKeyDomain;
                    if (o.oneofs)
                        d._mediaKeyDomain = "mediaKeyDomain";
                }
                return d;
            };

            MMSThumbnailMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MMSThumbnailMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.MMSThumbnailMetadata";
            };

            return MMSThumbnailMetadata;
        })();

        Message.MediaKeyDomain = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNSET"] = 0;
            values[valuesById[1] = "E2EE_CHAT"] = 1;
            values[valuesById[2] = "STATUS"] = 2;
            values[valuesById[3] = "CAPI"] = 3;
            values[valuesById[4] = "BOT"] = 4;
            return values;
        })();

        Message.MessageHistoryBundle = (function() {

            function MessageHistoryBundle(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MessageHistoryBundle.prototype.mimetype = null;
            MessageHistoryBundle.prototype.fileSha256 = null;
            MessageHistoryBundle.prototype.mediaKey = null;
            MessageHistoryBundle.prototype.fileEncSha256 = null;
            MessageHistoryBundle.prototype.directPath = null;
            MessageHistoryBundle.prototype.mediaKeyTimestamp = null;
            MessageHistoryBundle.prototype.contextInfo = null;
            MessageHistoryBundle.prototype.messageHistoryMetadata = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryBundle.prototype, "_mimetype", {
                get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryBundle.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryBundle.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryBundle.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryBundle.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryBundle.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryBundle.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryBundle.prototype, "_messageHistoryMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["messageHistoryMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MessageHistoryBundle.create = function create(properties) {
                return new MessageHistoryBundle(properties);
            };

            MessageHistoryBundle.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                    w.uint32(10).string(m.mimetype);
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(18).bytes(m.fileSha256);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(26).bytes(m.mediaKey);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(34).bytes(m.fileEncSha256);
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(42).string(m.directPath);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(48).int64(m.mediaKeyTimestamp);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(58).fork()).ldelim();
                if (m.messageHistoryMetadata != null && Object.hasOwnProperty.call(m, "messageHistoryMetadata"))
                    $root.proto.Message.MessageHistoryMetadata.encode(m.messageHistoryMetadata, w.uint32(66).fork()).ldelim();
                return w;
            };

            MessageHistoryBundle.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.MessageHistoryBundle();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.mimetype = r.string();
                            break;
                        }
                    case 2: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 3: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 4: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 5: {
                            m.directPath = r.string();
                            break;
                        }
                    case 6: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 7: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 8: {
                            m.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MessageHistoryBundle.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.MessageHistoryBundle)
                    return d;
                var m = new $root.proto.Message.MessageHistoryBundle();
                if (d.mimetype != null) {
                    m.mimetype = String(d.mimetype);
                }
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.MessageHistoryBundle.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.messageHistoryMetadata != null) {
                    if (typeof d.messageHistoryMetadata !== "object")
                        throw TypeError(".proto.Message.MessageHistoryBundle.messageHistoryMetadata: object expected");
                    m.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.fromObject(d.messageHistoryMetadata);
                }
                return m;
            };

            MessageHistoryBundle.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                    d.mimetype = m.mimetype;
                    if (o.oneofs)
                        d._mimetype = "mimetype";
                }
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.messageHistoryMetadata != null && m.hasOwnProperty("messageHistoryMetadata")) {
                    d.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.toObject(m.messageHistoryMetadata, o);
                    if (o.oneofs)
                        d._messageHistoryMetadata = "messageHistoryMetadata";
                }
                return d;
            };

            MessageHistoryBundle.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MessageHistoryBundle.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.MessageHistoryBundle";
            };

            return MessageHistoryBundle;
        })();

        Message.MessageHistoryMetadata = (function() {

            function MessageHistoryMetadata(p) {
                this.historyReceivers = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MessageHistoryMetadata.prototype.historyReceivers = $util.emptyArray;
            MessageHistoryMetadata.prototype.oldestMessageTimestamp = null;
            MessageHistoryMetadata.prototype.messageCount = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryMetadata.prototype, "_oldestMessageTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["oldestMessageTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryMetadata.prototype, "_messageCount", {
                get: $util.oneOfGetter($oneOfFields = ["messageCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MessageHistoryMetadata.create = function create(properties) {
                return new MessageHistoryMetadata(properties);
            };

            MessageHistoryMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.historyReceivers != null && m.historyReceivers.length) {
                    for (var i = 0; i < m.historyReceivers.length; ++i)
                        w.uint32(10).string(m.historyReceivers[i]);
                }
                if (m.oldestMessageTimestamp != null && Object.hasOwnProperty.call(m, "oldestMessageTimestamp"))
                    w.uint32(16).int64(m.oldestMessageTimestamp);
                if (m.messageCount != null && Object.hasOwnProperty.call(m, "messageCount"))
                    w.uint32(24).int64(m.messageCount);
                return w;
            };

            MessageHistoryMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.MessageHistoryMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.historyReceivers && m.historyReceivers.length))
                                m.historyReceivers = [];
                            m.historyReceivers.push(r.string());
                            break;
                        }
                    case 2: {
                            m.oldestMessageTimestamp = r.int64();
                            break;
                        }
                    case 3: {
                            m.messageCount = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MessageHistoryMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.MessageHistoryMetadata)
                    return d;
                var m = new $root.proto.Message.MessageHistoryMetadata();
                if (d.historyReceivers) {
                    if (!Array.isArray(d.historyReceivers))
                        throw TypeError(".proto.Message.MessageHistoryMetadata.historyReceivers: array expected");
                    m.historyReceivers = [];
                    for (var i = 0; i < d.historyReceivers.length; ++i) {
                        m.historyReceivers[i] = String(d.historyReceivers[i]);
                    }
                }
                if (d.oldestMessageTimestamp != null) {
                    if ($util.Long)
                        (m.oldestMessageTimestamp = $util.Long.fromValue(d.oldestMessageTimestamp)).unsigned = false;
                    else if (typeof d.oldestMessageTimestamp === "string")
                        m.oldestMessageTimestamp = parseInt(d.oldestMessageTimestamp, 10);
                    else if (typeof d.oldestMessageTimestamp === "number")
                        m.oldestMessageTimestamp = d.oldestMessageTimestamp;
                    else if (typeof d.oldestMessageTimestamp === "object")
                        m.oldestMessageTimestamp = new $util.LongBits(d.oldestMessageTimestamp.low >>> 0, d.oldestMessageTimestamp.high >>> 0).toNumber();
                }
                if (d.messageCount != null) {
                    if ($util.Long)
                        (m.messageCount = $util.Long.fromValue(d.messageCount)).unsigned = false;
                    else if (typeof d.messageCount === "string")
                        m.messageCount = parseInt(d.messageCount, 10);
                    else if (typeof d.messageCount === "number")
                        m.messageCount = d.messageCount;
                    else if (typeof d.messageCount === "object")
                        m.messageCount = new $util.LongBits(d.messageCount.low >>> 0, d.messageCount.high >>> 0).toNumber();
                }
                return m;
            };

            MessageHistoryMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.historyReceivers = [];
                }
                if (m.historyReceivers && m.historyReceivers.length) {
                    d.historyReceivers = [];
                    for (var j = 0; j < m.historyReceivers.length; ++j) {
                        d.historyReceivers[j] = m.historyReceivers[j];
                    }
                }
                if (m.oldestMessageTimestamp != null && m.hasOwnProperty("oldestMessageTimestamp")) {
                    if (typeof m.oldestMessageTimestamp === "number")
                        d.oldestMessageTimestamp = o.longs === String ? String(m.oldestMessageTimestamp) : m.oldestMessageTimestamp;
                    else
                        d.oldestMessageTimestamp = o.longs === String ? longToString(m.oldestMessageTimestamp) : o.longs === Number ? longToNumber(m.oldestMessageTimestamp) : m.oldestMessageTimestamp;
                    if (o.oneofs)
                        d._oldestMessageTimestamp = "oldestMessageTimestamp";
                }
                if (m.messageCount != null && m.hasOwnProperty("messageCount")) {
                    if (typeof m.messageCount === "number")
                        d.messageCount = o.longs === String ? String(m.messageCount) : m.messageCount;
                    else
                        d.messageCount = o.longs === String ? longToString(m.messageCount) : o.longs === Number ? longToNumber(m.messageCount) : m.messageCount;
                    if (o.oneofs)
                        d._messageCount = "messageCount";
                }
                return d;
            };

            MessageHistoryMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MessageHistoryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.MessageHistoryMetadata";
            };

            return MessageHistoryMetadata;
        })();

        Message.MessageHistoryNotice = (function() {

            function MessageHistoryNotice(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MessageHistoryNotice.prototype.contextInfo = null;
            MessageHistoryNotice.prototype.messageHistoryMetadata = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryNotice.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MessageHistoryNotice.prototype, "_messageHistoryMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["messageHistoryMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MessageHistoryNotice.create = function create(properties) {
                return new MessageHistoryNotice(properties);
            };

            MessageHistoryNotice.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(10).fork()).ldelim();
                if (m.messageHistoryMetadata != null && Object.hasOwnProperty.call(m, "messageHistoryMetadata"))
                    $root.proto.Message.MessageHistoryMetadata.encode(m.messageHistoryMetadata, w.uint32(18).fork()).ldelim();
                return w;
            };

            MessageHistoryNotice.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.MessageHistoryNotice();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MessageHistoryNotice.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.MessageHistoryNotice)
                    return d;
                var m = new $root.proto.Message.MessageHistoryNotice();
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.MessageHistoryNotice.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.messageHistoryMetadata != null) {
                    if (typeof d.messageHistoryMetadata !== "object")
                        throw TypeError(".proto.Message.MessageHistoryNotice.messageHistoryMetadata: object expected");
                    m.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.fromObject(d.messageHistoryMetadata);
                }
                return m;
            };

            MessageHistoryNotice.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.messageHistoryMetadata != null && m.hasOwnProperty("messageHistoryMetadata")) {
                    d.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.toObject(m.messageHistoryMetadata, o);
                    if (o.oneofs)
                        d._messageHistoryMetadata = "messageHistoryMetadata";
                }
                return d;
            };

            MessageHistoryNotice.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MessageHistoryNotice.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.MessageHistoryNotice";
            };

            return MessageHistoryNotice;
        })();

        Message.NewsletterAdminInviteMessage = (function() {

            function NewsletterAdminInviteMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            NewsletterAdminInviteMessage.prototype.newsletterJid = null;
            NewsletterAdminInviteMessage.prototype.newsletterName = null;
            NewsletterAdminInviteMessage.prototype.jpegThumbnail = null;
            NewsletterAdminInviteMessage.prototype.caption = null;
            NewsletterAdminInviteMessage.prototype.inviteExpiration = null;
            NewsletterAdminInviteMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_newsletterJid", {
                get: $util.oneOfGetter($oneOfFields = ["newsletterJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_newsletterName", {
                get: $util.oneOfGetter($oneOfFields = ["newsletterName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_inviteExpiration", {
                get: $util.oneOfGetter($oneOfFields = ["inviteExpiration"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            NewsletterAdminInviteMessage.create = function create(properties) {
                return new NewsletterAdminInviteMessage(properties);
            };

            NewsletterAdminInviteMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.newsletterJid != null && Object.hasOwnProperty.call(m, "newsletterJid"))
                    w.uint32(10).string(m.newsletterJid);
                if (m.newsletterName != null && Object.hasOwnProperty.call(m, "newsletterName"))
                    w.uint32(18).string(m.newsletterName);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(26).bytes(m.jpegThumbnail);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(34).string(m.caption);
                if (m.inviteExpiration != null && Object.hasOwnProperty.call(m, "inviteExpiration"))
                    w.uint32(40).int64(m.inviteExpiration);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(50).fork()).ldelim();
                return w;
            };

            NewsletterAdminInviteMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.NewsletterAdminInviteMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.newsletterJid = r.string();
                            break;
                        }
                    case 2: {
                            m.newsletterName = r.string();
                            break;
                        }
                    case 3: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 4: {
                            m.caption = r.string();
                            break;
                        }
                    case 5: {
                            m.inviteExpiration = r.int64();
                            break;
                        }
                    case 6: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            NewsletterAdminInviteMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.NewsletterAdminInviteMessage)
                    return d;
                var m = new $root.proto.Message.NewsletterAdminInviteMessage();
                if (d.newsletterJid != null) {
                    m.newsletterJid = String(d.newsletterJid);
                }
                if (d.newsletterName != null) {
                    m.newsletterName = String(d.newsletterName);
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.inviteExpiration != null) {
                    if ($util.Long)
                        (m.inviteExpiration = $util.Long.fromValue(d.inviteExpiration)).unsigned = false;
                    else if (typeof d.inviteExpiration === "string")
                        m.inviteExpiration = parseInt(d.inviteExpiration, 10);
                    else if (typeof d.inviteExpiration === "number")
                        m.inviteExpiration = d.inviteExpiration;
                    else if (typeof d.inviteExpiration === "object")
                        m.inviteExpiration = new $util.LongBits(d.inviteExpiration.low >>> 0, d.inviteExpiration.high >>> 0).toNumber();
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.NewsletterAdminInviteMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            NewsletterAdminInviteMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.newsletterJid != null && m.hasOwnProperty("newsletterJid")) {
                    d.newsletterJid = m.newsletterJid;
                    if (o.oneofs)
                        d._newsletterJid = "newsletterJid";
                }
                if (m.newsletterName != null && m.hasOwnProperty("newsletterName")) {
                    d.newsletterName = m.newsletterName;
                    if (o.oneofs)
                        d._newsletterName = "newsletterName";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                if (m.inviteExpiration != null && m.hasOwnProperty("inviteExpiration")) {
                    if (typeof m.inviteExpiration === "number")
                        d.inviteExpiration = o.longs === String ? String(m.inviteExpiration) : m.inviteExpiration;
                    else
                        d.inviteExpiration = o.longs === String ? longToString(m.inviteExpiration) : o.longs === Number ? longToNumber(m.inviteExpiration) : m.inviteExpiration;
                    if (o.oneofs)
                        d._inviteExpiration = "inviteExpiration";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            NewsletterAdminInviteMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            NewsletterAdminInviteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.NewsletterAdminInviteMessage";
            };

            return NewsletterAdminInviteMessage;
        })();

        Message.NewsletterFollowerInviteMessage = (function() {

            function NewsletterFollowerInviteMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            NewsletterFollowerInviteMessage.prototype.newsletterJid = null;
            NewsletterFollowerInviteMessage.prototype.newsletterName = null;
            NewsletterFollowerInviteMessage.prototype.jpegThumbnail = null;
            NewsletterFollowerInviteMessage.prototype.caption = null;
            NewsletterFollowerInviteMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterFollowerInviteMessage.prototype, "_newsletterJid", {
                get: $util.oneOfGetter($oneOfFields = ["newsletterJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterFollowerInviteMessage.prototype, "_newsletterName", {
                get: $util.oneOfGetter($oneOfFields = ["newsletterName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterFollowerInviteMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterFollowerInviteMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterFollowerInviteMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            NewsletterFollowerInviteMessage.create = function create(properties) {
                return new NewsletterFollowerInviteMessage(properties);
            };

            NewsletterFollowerInviteMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.newsletterJid != null && Object.hasOwnProperty.call(m, "newsletterJid"))
                    w.uint32(10).string(m.newsletterJid);
                if (m.newsletterName != null && Object.hasOwnProperty.call(m, "newsletterName"))
                    w.uint32(18).string(m.newsletterName);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(26).bytes(m.jpegThumbnail);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(34).string(m.caption);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(42).fork()).ldelim();
                return w;
            };

            NewsletterFollowerInviteMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.NewsletterFollowerInviteMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.newsletterJid = r.string();
                            break;
                        }
                    case 2: {
                            m.newsletterName = r.string();
                            break;
                        }
                    case 3: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 4: {
                            m.caption = r.string();
                            break;
                        }
                    case 5: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            NewsletterFollowerInviteMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.NewsletterFollowerInviteMessage)
                    return d;
                var m = new $root.proto.Message.NewsletterFollowerInviteMessage();
                if (d.newsletterJid != null) {
                    m.newsletterJid = String(d.newsletterJid);
                }
                if (d.newsletterName != null) {
                    m.newsletterName = String(d.newsletterName);
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.NewsletterFollowerInviteMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            NewsletterFollowerInviteMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.newsletterJid != null && m.hasOwnProperty("newsletterJid")) {
                    d.newsletterJid = m.newsletterJid;
                    if (o.oneofs)
                        d._newsletterJid = "newsletterJid";
                }
                if (m.newsletterName != null && m.hasOwnProperty("newsletterName")) {
                    d.newsletterName = m.newsletterName;
                    if (o.oneofs)
                        d._newsletterName = "newsletterName";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            NewsletterFollowerInviteMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            NewsletterFollowerInviteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.NewsletterFollowerInviteMessage";
            };

            return NewsletterFollowerInviteMessage;
        })();

        Message.OrderMessage = (function() {

            function OrderMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            OrderMessage.prototype.orderId = null;
            OrderMessage.prototype.thumbnail = null;
            OrderMessage.prototype.itemCount = null;
            OrderMessage.prototype.status = null;
            OrderMessage.prototype.surface = null;
            OrderMessage.prototype.message = null;
            OrderMessage.prototype.orderTitle = null;
            OrderMessage.prototype.sellerJid = null;
            OrderMessage.prototype.token = null;
            OrderMessage.prototype.totalAmount1000 = null;
            OrderMessage.prototype.totalCurrencyCode = null;
            OrderMessage.prototype.contextInfo = null;
            OrderMessage.prototype.messageVersion = null;
            OrderMessage.prototype.orderRequestMessageId = null;
            OrderMessage.prototype.catalogType = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_orderId", {
                get: $util.oneOfGetter($oneOfFields = ["orderId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_thumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_itemCount", {
                get: $util.oneOfGetter($oneOfFields = ["itemCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_status", {
                get: $util.oneOfGetter($oneOfFields = ["status"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_surface", {
                get: $util.oneOfGetter($oneOfFields = ["surface"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_message", {
                get: $util.oneOfGetter($oneOfFields = ["message"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_orderTitle", {
                get: $util.oneOfGetter($oneOfFields = ["orderTitle"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_sellerJid", {
                get: $util.oneOfGetter($oneOfFields = ["sellerJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_token", {
                get: $util.oneOfGetter($oneOfFields = ["token"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_totalAmount1000", {
                get: $util.oneOfGetter($oneOfFields = ["totalAmount1000"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_totalCurrencyCode", {
                get: $util.oneOfGetter($oneOfFields = ["totalCurrencyCode"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_messageVersion", {
                get: $util.oneOfGetter($oneOfFields = ["messageVersion"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_orderRequestMessageId", {
                get: $util.oneOfGetter($oneOfFields = ["orderRequestMessageId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(OrderMessage.prototype, "_catalogType", {
                get: $util.oneOfGetter($oneOfFields = ["catalogType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            OrderMessage.create = function create(properties) {
                return new OrderMessage(properties);
            };

            OrderMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.orderId != null && Object.hasOwnProperty.call(m, "orderId"))
                    w.uint32(10).string(m.orderId);
                if (m.thumbnail != null && Object.hasOwnProperty.call(m, "thumbnail"))
                    w.uint32(18).bytes(m.thumbnail);
                if (m.itemCount != null && Object.hasOwnProperty.call(m, "itemCount"))
                    w.uint32(24).int32(m.itemCount);
                if (m.status != null && Object.hasOwnProperty.call(m, "status"))
                    w.uint32(32).int32(m.status);
                if (m.surface != null && Object.hasOwnProperty.call(m, "surface"))
                    w.uint32(40).int32(m.surface);
                if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                    w.uint32(50).string(m.message);
                if (m.orderTitle != null && Object.hasOwnProperty.call(m, "orderTitle"))
                    w.uint32(58).string(m.orderTitle);
                if (m.sellerJid != null && Object.hasOwnProperty.call(m, "sellerJid"))
                    w.uint32(66).string(m.sellerJid);
                if (m.token != null && Object.hasOwnProperty.call(m, "token"))
                    w.uint32(74).string(m.token);
                if (m.totalAmount1000 != null && Object.hasOwnProperty.call(m, "totalAmount1000"))
                    w.uint32(80).int64(m.totalAmount1000);
                if (m.totalCurrencyCode != null && Object.hasOwnProperty.call(m, "totalCurrencyCode"))
                    w.uint32(90).string(m.totalCurrencyCode);
                if (m.messageVersion != null && Object.hasOwnProperty.call(m, "messageVersion"))
                    w.uint32(96).int32(m.messageVersion);
                if (m.orderRequestMessageId != null && Object.hasOwnProperty.call(m, "orderRequestMessageId"))
                    $root.proto.MessageKey.encode(m.orderRequestMessageId, w.uint32(106).fork()).ldelim();
                if (m.catalogType != null && Object.hasOwnProperty.call(m, "catalogType"))
                    w.uint32(122).string(m.catalogType);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                return w;
            };

            OrderMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.OrderMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.orderId = r.string();
                            break;
                        }
                    case 2: {
                            m.thumbnail = r.bytes();
                            break;
                        }
                    case 3: {
                            m.itemCount = r.int32();
                            break;
                        }
                    case 4: {
                            m.status = r.int32();
                            break;
                        }
                    case 5: {
                            m.surface = r.int32();
                            break;
                        }
                    case 6: {
                            m.message = r.string();
                            break;
                        }
                    case 7: {
                            m.orderTitle = r.string();
                            break;
                        }
                    case 8: {
                            m.sellerJid = r.string();
                            break;
                        }
                    case 9: {
                            m.token = r.string();
                            break;
                        }
                    case 10: {
                            m.totalAmount1000 = r.int64();
                            break;
                        }
                    case 11: {
                            m.totalCurrencyCode = r.string();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 12: {
                            m.messageVersion = r.int32();
                            break;
                        }
                    case 13: {
                            m.orderRequestMessageId = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 15: {
                            m.catalogType = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            OrderMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.OrderMessage)
                    return d;
                var m = new $root.proto.Message.OrderMessage();
                if (d.orderId != null) {
                    m.orderId = String(d.orderId);
                }
                if (d.thumbnail != null) {
                    if (typeof d.thumbnail === "string")
                        $util.base64.decode(d.thumbnail, m.thumbnail = $util.newBuffer($util.base64.length(d.thumbnail)), 0);
                    else if (d.thumbnail.length >= 0)
                        m.thumbnail = d.thumbnail;
                }
                if (d.itemCount != null) {
                    m.itemCount = d.itemCount | 0;
                }
                switch (d.status) {
                default:
                    if (typeof d.status === "number") {
                        m.status = d.status;
                        break;
                    }
                    break;
                case "INQUIRY":
                case 1:
                    m.status = 1;
                    break;
                case "ACCEPTED":
                case 2:
                    m.status = 2;
                    break;
                case "DECLINED":
                case 3:
                    m.status = 3;
                    break;
                }
                switch (d.surface) {
                default:
                    if (typeof d.surface === "number") {
                        m.surface = d.surface;
                        break;
                    }
                    break;
                case "CATALOG":
                case 1:
                    m.surface = 1;
                    break;
                }
                if (d.message != null) {
                    m.message = String(d.message);
                }
                if (d.orderTitle != null) {
                    m.orderTitle = String(d.orderTitle);
                }
                if (d.sellerJid != null) {
                    m.sellerJid = String(d.sellerJid);
                }
                if (d.token != null) {
                    m.token = String(d.token);
                }
                if (d.totalAmount1000 != null) {
                    if ($util.Long)
                        (m.totalAmount1000 = $util.Long.fromValue(d.totalAmount1000)).unsigned = false;
                    else if (typeof d.totalAmount1000 === "string")
                        m.totalAmount1000 = parseInt(d.totalAmount1000, 10);
                    else if (typeof d.totalAmount1000 === "number")
                        m.totalAmount1000 = d.totalAmount1000;
                    else if (typeof d.totalAmount1000 === "object")
                        m.totalAmount1000 = new $util.LongBits(d.totalAmount1000.low >>> 0, d.totalAmount1000.high >>> 0).toNumber();
                }
                if (d.totalCurrencyCode != null) {
                    m.totalCurrencyCode = String(d.totalCurrencyCode);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.OrderMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.messageVersion != null) {
                    m.messageVersion = d.messageVersion | 0;
                }
                if (d.orderRequestMessageId != null) {
                    if (typeof d.orderRequestMessageId !== "object")
                        throw TypeError(".proto.Message.OrderMessage.orderRequestMessageId: object expected");
                    m.orderRequestMessageId = $root.proto.MessageKey.fromObject(d.orderRequestMessageId);
                }
                if (d.catalogType != null) {
                    m.catalogType = String(d.catalogType);
                }
                return m;
            };

            OrderMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.orderId != null && m.hasOwnProperty("orderId")) {
                    d.orderId = m.orderId;
                    if (o.oneofs)
                        d._orderId = "orderId";
                }
                if (m.thumbnail != null && m.hasOwnProperty("thumbnail")) {
                    d.thumbnail = o.bytes === String ? $util.base64.encode(m.thumbnail, 0, m.thumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnail) : m.thumbnail;
                    if (o.oneofs)
                        d._thumbnail = "thumbnail";
                }
                if (m.itemCount != null && m.hasOwnProperty("itemCount")) {
                    d.itemCount = m.itemCount;
                    if (o.oneofs)
                        d._itemCount = "itemCount";
                }
                if (m.status != null && m.hasOwnProperty("status")) {
                    d.status = o.enums === String ? $root.proto.Message.OrderMessage.OrderStatus[m.status] === undefined ? m.status : $root.proto.Message.OrderMessage.OrderStatus[m.status] : m.status;
                    if (o.oneofs)
                        d._status = "status";
                }
                if (m.surface != null && m.hasOwnProperty("surface")) {
                    d.surface = o.enums === String ? $root.proto.Message.OrderMessage.OrderSurface[m.surface] === undefined ? m.surface : $root.proto.Message.OrderMessage.OrderSurface[m.surface] : m.surface;
                    if (o.oneofs)
                        d._surface = "surface";
                }
                if (m.message != null && m.hasOwnProperty("message")) {
                    d.message = m.message;
                    if (o.oneofs)
                        d._message = "message";
                }
                if (m.orderTitle != null && m.hasOwnProperty("orderTitle")) {
                    d.orderTitle = m.orderTitle;
                    if (o.oneofs)
                        d._orderTitle = "orderTitle";
                }
                if (m.sellerJid != null && m.hasOwnProperty("sellerJid")) {
                    d.sellerJid = m.sellerJid;
                    if (o.oneofs)
                        d._sellerJid = "sellerJid";
                }
                if (m.token != null && m.hasOwnProperty("token")) {
                    d.token = m.token;
                    if (o.oneofs)
                        d._token = "token";
                }
                if (m.totalAmount1000 != null && m.hasOwnProperty("totalAmount1000")) {
                    if (typeof m.totalAmount1000 === "number")
                        d.totalAmount1000 = o.longs === String ? String(m.totalAmount1000) : m.totalAmount1000;
                    else
                        d.totalAmount1000 = o.longs === String ? longToString(m.totalAmount1000) : o.longs === Number ? longToNumber(m.totalAmount1000) : m.totalAmount1000;
                    if (o.oneofs)
                        d._totalAmount1000 = "totalAmount1000";
                }
                if (m.totalCurrencyCode != null && m.hasOwnProperty("totalCurrencyCode")) {
                    d.totalCurrencyCode = m.totalCurrencyCode;
                    if (o.oneofs)
                        d._totalCurrencyCode = "totalCurrencyCode";
                }
                if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) {
                    d.messageVersion = m.messageVersion;
                    if (o.oneofs)
                        d._messageVersion = "messageVersion";
                }
                if (m.orderRequestMessageId != null && m.hasOwnProperty("orderRequestMessageId")) {
                    d.orderRequestMessageId = $root.proto.MessageKey.toObject(m.orderRequestMessageId, o);
                    if (o.oneofs)
                        d._orderRequestMessageId = "orderRequestMessageId";
                }
                if (m.catalogType != null && m.hasOwnProperty("catalogType")) {
                    d.catalogType = m.catalogType;
                    if (o.oneofs)
                        d._catalogType = "catalogType";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            OrderMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            OrderMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.OrderMessage";
            };

            OrderMessage.OrderStatus = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "INQUIRY"] = 1;
                values[valuesById[2] = "ACCEPTED"] = 2;
                values[valuesById[3] = "DECLINED"] = 3;
                return values;
            })();

            OrderMessage.OrderSurface = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "CATALOG"] = 1;
                return values;
            })();

            return OrderMessage;
        })();

        Message.PaymentExtendedMetadata = (function() {

            function PaymentExtendedMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PaymentExtendedMetadata.prototype.type = null;
            PaymentExtendedMetadata.prototype.platform = null;
            PaymentExtendedMetadata.prototype.messageParamsJson = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentExtendedMetadata.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentExtendedMetadata.prototype, "_platform", {
                get: $util.oneOfGetter($oneOfFields = ["platform"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentExtendedMetadata.prototype, "_messageParamsJson", {
                get: $util.oneOfGetter($oneOfFields = ["messageParamsJson"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PaymentExtendedMetadata.create = function create(properties) {
                return new PaymentExtendedMetadata(properties);
            };

            PaymentExtendedMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(8).uint32(m.type);
                if (m.platform != null && Object.hasOwnProperty.call(m, "platform"))
                    w.uint32(18).string(m.platform);
                if (m.messageParamsJson != null && Object.hasOwnProperty.call(m, "messageParamsJson"))
                    w.uint32(26).string(m.messageParamsJson);
                return w;
            };

            PaymentExtendedMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PaymentExtendedMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.type = r.uint32();
                            break;
                        }
                    case 2: {
                            m.platform = r.string();
                            break;
                        }
                    case 3: {
                            m.messageParamsJson = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PaymentExtendedMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PaymentExtendedMetadata)
                    return d;
                var m = new $root.proto.Message.PaymentExtendedMetadata();
                if (d.type != null) {
                    m.type = d.type >>> 0;
                }
                if (d.platform != null) {
                    m.platform = String(d.platform);
                }
                if (d.messageParamsJson != null) {
                    m.messageParamsJson = String(d.messageParamsJson);
                }
                return m;
            };

            PaymentExtendedMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                if (m.platform != null && m.hasOwnProperty("platform")) {
                    d.platform = m.platform;
                    if (o.oneofs)
                        d._platform = "platform";
                }
                if (m.messageParamsJson != null && m.hasOwnProperty("messageParamsJson")) {
                    d.messageParamsJson = m.messageParamsJson;
                    if (o.oneofs)
                        d._messageParamsJson = "messageParamsJson";
                }
                return d;
            };

            PaymentExtendedMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PaymentExtendedMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PaymentExtendedMetadata";
            };

            return PaymentExtendedMetadata;
        })();

        Message.PaymentInviteMessage = (function() {

            function PaymentInviteMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PaymentInviteMessage.prototype.serviceType = null;
            PaymentInviteMessage.prototype.expiryTimestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentInviteMessage.prototype, "_serviceType", {
                get: $util.oneOfGetter($oneOfFields = ["serviceType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentInviteMessage.prototype, "_expiryTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["expiryTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PaymentInviteMessage.create = function create(properties) {
                return new PaymentInviteMessage(properties);
            };

            PaymentInviteMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.serviceType != null && Object.hasOwnProperty.call(m, "serviceType"))
                    w.uint32(8).int32(m.serviceType);
                if (m.expiryTimestamp != null && Object.hasOwnProperty.call(m, "expiryTimestamp"))
                    w.uint32(16).int64(m.expiryTimestamp);
                return w;
            };

            PaymentInviteMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PaymentInviteMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.serviceType = r.int32();
                            break;
                        }
                    case 2: {
                            m.expiryTimestamp = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PaymentInviteMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PaymentInviteMessage)
                    return d;
                var m = new $root.proto.Message.PaymentInviteMessage();
                switch (d.serviceType) {
                default:
                    if (typeof d.serviceType === "number") {
                        m.serviceType = d.serviceType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.serviceType = 0;
                    break;
                case "FBPAY":
                case 1:
                    m.serviceType = 1;
                    break;
                case "NOVI":
                case 2:
                    m.serviceType = 2;
                    break;
                case "UPI":
                case 3:
                    m.serviceType = 3;
                    break;
                }
                if (d.expiryTimestamp != null) {
                    if ($util.Long)
                        (m.expiryTimestamp = $util.Long.fromValue(d.expiryTimestamp)).unsigned = false;
                    else if (typeof d.expiryTimestamp === "string")
                        m.expiryTimestamp = parseInt(d.expiryTimestamp, 10);
                    else if (typeof d.expiryTimestamp === "number")
                        m.expiryTimestamp = d.expiryTimestamp;
                    else if (typeof d.expiryTimestamp === "object")
                        m.expiryTimestamp = new $util.LongBits(d.expiryTimestamp.low >>> 0, d.expiryTimestamp.high >>> 0).toNumber();
                }
                return m;
            };

            PaymentInviteMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.serviceType != null && m.hasOwnProperty("serviceType")) {
                    d.serviceType = o.enums === String ? $root.proto.Message.PaymentInviteMessage.ServiceType[m.serviceType] === undefined ? m.serviceType : $root.proto.Message.PaymentInviteMessage.ServiceType[m.serviceType] : m.serviceType;
                    if (o.oneofs)
                        d._serviceType = "serviceType";
                }
                if (m.expiryTimestamp != null && m.hasOwnProperty("expiryTimestamp")) {
                    if (typeof m.expiryTimestamp === "number")
                        d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp;
                    else
                        d.expiryTimestamp = o.longs === String ? longToString(m.expiryTimestamp) : o.longs === Number ? longToNumber(m.expiryTimestamp) : m.expiryTimestamp;
                    if (o.oneofs)
                        d._expiryTimestamp = "expiryTimestamp";
                }
                return d;
            };

            PaymentInviteMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PaymentInviteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PaymentInviteMessage";
            };

            PaymentInviteMessage.ServiceType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "FBPAY"] = 1;
                values[valuesById[2] = "NOVI"] = 2;
                values[valuesById[3] = "UPI"] = 3;
                return values;
            })();

            return PaymentInviteMessage;
        })();

        Message.PaymentLinkMetadata = (function() {

            function PaymentLinkMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PaymentLinkMetadata.prototype.button = null;
            PaymentLinkMetadata.prototype.header = null;
            PaymentLinkMetadata.prototype.provider = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentLinkMetadata.prototype, "_button", {
                get: $util.oneOfGetter($oneOfFields = ["button"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentLinkMetadata.prototype, "_header", {
                get: $util.oneOfGetter($oneOfFields = ["header"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentLinkMetadata.prototype, "_provider", {
                get: $util.oneOfGetter($oneOfFields = ["provider"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PaymentLinkMetadata.create = function create(properties) {
                return new PaymentLinkMetadata(properties);
            };

            PaymentLinkMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.button != null && Object.hasOwnProperty.call(m, "button"))
                    $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton.encode(m.button, w.uint32(10).fork()).ldelim();
                if (m.header != null && Object.hasOwnProperty.call(m, "header"))
                    $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.encode(m.header, w.uint32(18).fork()).ldelim();
                if (m.provider != null && Object.hasOwnProperty.call(m, "provider"))
                    $root.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.encode(m.provider, w.uint32(26).fork()).ldelim();
                return w;
            };

            PaymentLinkMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PaymentLinkMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.button = $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.header = $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.provider = $root.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PaymentLinkMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PaymentLinkMetadata)
                    return d;
                var m = new $root.proto.Message.PaymentLinkMetadata();
                if (d.button != null) {
                    if (typeof d.button !== "object")
                        throw TypeError(".proto.Message.PaymentLinkMetadata.button: object expected");
                    m.button = $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton.fromObject(d.button);
                }
                if (d.header != null) {
                    if (typeof d.header !== "object")
                        throw TypeError(".proto.Message.PaymentLinkMetadata.header: object expected");
                    m.header = $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.fromObject(d.header);
                }
                if (d.provider != null) {
                    if (typeof d.provider !== "object")
                        throw TypeError(".proto.Message.PaymentLinkMetadata.provider: object expected");
                    m.provider = $root.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.fromObject(d.provider);
                }
                return m;
            };

            PaymentLinkMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.button != null && m.hasOwnProperty("button")) {
                    d.button = $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton.toObject(m.button, o);
                    if (o.oneofs)
                        d._button = "button";
                }
                if (m.header != null && m.hasOwnProperty("header")) {
                    d.header = $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.toObject(m.header, o);
                    if (o.oneofs)
                        d._header = "header";
                }
                if (m.provider != null && m.hasOwnProperty("provider")) {
                    d.provider = $root.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.toObject(m.provider, o);
                    if (o.oneofs)
                        d._provider = "provider";
                }
                return d;
            };

            PaymentLinkMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PaymentLinkMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PaymentLinkMetadata";
            };

            PaymentLinkMetadata.PaymentLinkButton = (function() {

                function PaymentLinkButton(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                PaymentLinkButton.prototype.displayText = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PaymentLinkButton.prototype, "_displayText", {
                    get: $util.oneOfGetter($oneOfFields = ["displayText"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                PaymentLinkButton.create = function create(properties) {
                    return new PaymentLinkButton(properties);
                };

                PaymentLinkButton.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.displayText != null && Object.hasOwnProperty.call(m, "displayText"))
                        w.uint32(10).string(m.displayText);
                    return w;
                };

                PaymentLinkButton.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.displayText = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                PaymentLinkButton.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton)
                        return d;
                    var m = new $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton();
                    if (d.displayText != null) {
                        m.displayText = String(d.displayText);
                    }
                    return m;
                };

                PaymentLinkButton.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.displayText != null && m.hasOwnProperty("displayText")) {
                        d.displayText = m.displayText;
                        if (o.oneofs)
                            d._displayText = "displayText";
                    }
                    return d;
                };

                PaymentLinkButton.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                PaymentLinkButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PaymentLinkMetadata.PaymentLinkButton";
                };

                return PaymentLinkButton;
            })();

            PaymentLinkMetadata.PaymentLinkHeader = (function() {

                function PaymentLinkHeader(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                PaymentLinkHeader.prototype.headerType = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PaymentLinkHeader.prototype, "_headerType", {
                    get: $util.oneOfGetter($oneOfFields = ["headerType"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                PaymentLinkHeader.create = function create(properties) {
                    return new PaymentLinkHeader(properties);
                };

                PaymentLinkHeader.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.headerType != null && Object.hasOwnProperty.call(m, "headerType"))
                        w.uint32(8).int32(m.headerType);
                    return w;
                };

                PaymentLinkHeader.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.headerType = r.int32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                PaymentLinkHeader.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader)
                        return d;
                    var m = new $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader();
                    switch (d.headerType) {
                    default:
                        if (typeof d.headerType === "number") {
                            m.headerType = d.headerType;
                            break;
                        }
                        break;
                    case "LINK_PREVIEW":
                    case 0:
                        m.headerType = 0;
                        break;
                    case "ORDER":
                    case 1:
                        m.headerType = 1;
                        break;
                    }
                    return m;
                };

                PaymentLinkHeader.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.headerType != null && m.hasOwnProperty("headerType")) {
                        d.headerType = o.enums === String ? $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[m.headerType] === undefined ? m.headerType : $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[m.headerType] : m.headerType;
                        if (o.oneofs)
                            d._headerType = "headerType";
                    }
                    return d;
                };

                PaymentLinkHeader.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                PaymentLinkHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PaymentLinkMetadata.PaymentLinkHeader";
                };

                PaymentLinkHeader.PaymentLinkHeaderType = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "LINK_PREVIEW"] = 0;
                    values[valuesById[1] = "ORDER"] = 1;
                    return values;
                })();

                return PaymentLinkHeader;
            })();

            PaymentLinkMetadata.PaymentLinkProvider = (function() {

                function PaymentLinkProvider(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                PaymentLinkProvider.prototype.paramsJson = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PaymentLinkProvider.prototype, "_paramsJson", {
                    get: $util.oneOfGetter($oneOfFields = ["paramsJson"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                PaymentLinkProvider.create = function create(properties) {
                    return new PaymentLinkProvider(properties);
                };

                PaymentLinkProvider.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.paramsJson != null && Object.hasOwnProperty.call(m, "paramsJson"))
                        w.uint32(10).string(m.paramsJson);
                    return w;
                };

                PaymentLinkProvider.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PaymentLinkMetadata.PaymentLinkProvider();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.paramsJson = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                PaymentLinkProvider.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PaymentLinkMetadata.PaymentLinkProvider)
                        return d;
                    var m = new $root.proto.Message.PaymentLinkMetadata.PaymentLinkProvider();
                    if (d.paramsJson != null) {
                        m.paramsJson = String(d.paramsJson);
                    }
                    return m;
                };

                PaymentLinkProvider.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.paramsJson != null && m.hasOwnProperty("paramsJson")) {
                        d.paramsJson = m.paramsJson;
                        if (o.oneofs)
                            d._paramsJson = "paramsJson";
                    }
                    return d;
                };

                PaymentLinkProvider.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                PaymentLinkProvider.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PaymentLinkMetadata.PaymentLinkProvider";
                };

                return PaymentLinkProvider;
            })();

            return PaymentLinkMetadata;
        })();

        Message.PeerDataOperationRequestMessage = (function() {

            function PeerDataOperationRequestMessage(p) {
                this.requestStickerReupload = [];
                this.requestUrlPreview = [];
                this.placeholderMessageResendRequest = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PeerDataOperationRequestMessage.prototype.peerDataOperationRequestType = null;
            PeerDataOperationRequestMessage.prototype.requestStickerReupload = $util.emptyArray;
            PeerDataOperationRequestMessage.prototype.requestUrlPreview = $util.emptyArray;
            PeerDataOperationRequestMessage.prototype.historySyncOnDemandRequest = null;
            PeerDataOperationRequestMessage.prototype.placeholderMessageResendRequest = $util.emptyArray;
            PeerDataOperationRequestMessage.prototype.fullHistorySyncOnDemandRequest = null;
            PeerDataOperationRequestMessage.prototype.syncdCollectionFatalRecoveryRequest = null;
            PeerDataOperationRequestMessage.prototype.historySyncChunkRetryRequest = null;
            PeerDataOperationRequestMessage.prototype.galaxyFlowAction = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_peerDataOperationRequestType", {
                get: $util.oneOfGetter($oneOfFields = ["peerDataOperationRequestType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_historySyncOnDemandRequest", {
                get: $util.oneOfGetter($oneOfFields = ["historySyncOnDemandRequest"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_fullHistorySyncOnDemandRequest", {
                get: $util.oneOfGetter($oneOfFields = ["fullHistorySyncOnDemandRequest"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_syncdCollectionFatalRecoveryRequest", {
                get: $util.oneOfGetter($oneOfFields = ["syncdCollectionFatalRecoveryRequest"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_historySyncChunkRetryRequest", {
                get: $util.oneOfGetter($oneOfFields = ["historySyncChunkRetryRequest"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_galaxyFlowAction", {
                get: $util.oneOfGetter($oneOfFields = ["galaxyFlowAction"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PeerDataOperationRequestMessage.create = function create(properties) {
                return new PeerDataOperationRequestMessage(properties);
            };

            PeerDataOperationRequestMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.peerDataOperationRequestType != null && Object.hasOwnProperty.call(m, "peerDataOperationRequestType"))
                    w.uint32(8).int32(m.peerDataOperationRequestType);
                if (m.requestStickerReupload != null && m.requestStickerReupload.length) {
                    for (var i = 0; i < m.requestStickerReupload.length; ++i)
                        $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.encode(m.requestStickerReupload[i], w.uint32(18).fork()).ldelim();
                }
                if (m.requestUrlPreview != null && m.requestUrlPreview.length) {
                    for (var i = 0; i < m.requestUrlPreview.length; ++i)
                        $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.encode(m.requestUrlPreview[i], w.uint32(26).fork()).ldelim();
                }
                if (m.historySyncOnDemandRequest != null && Object.hasOwnProperty.call(m, "historySyncOnDemandRequest"))
                    $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.encode(m.historySyncOnDemandRequest, w.uint32(34).fork()).ldelim();
                if (m.placeholderMessageResendRequest != null && m.placeholderMessageResendRequest.length) {
                    for (var i = 0; i < m.placeholderMessageResendRequest.length; ++i)
                        $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.encode(m.placeholderMessageResendRequest[i], w.uint32(42).fork()).ldelim();
                }
                if (m.fullHistorySyncOnDemandRequest != null && Object.hasOwnProperty.call(m, "fullHistorySyncOnDemandRequest"))
                    $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.encode(m.fullHistorySyncOnDemandRequest, w.uint32(50).fork()).ldelim();
                if (m.syncdCollectionFatalRecoveryRequest != null && Object.hasOwnProperty.call(m, "syncdCollectionFatalRecoveryRequest"))
                    $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.encode(m.syncdCollectionFatalRecoveryRequest, w.uint32(58).fork()).ldelim();
                if (m.historySyncChunkRetryRequest != null && Object.hasOwnProperty.call(m, "historySyncChunkRetryRequest"))
                    $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.encode(m.historySyncChunkRetryRequest, w.uint32(66).fork()).ldelim();
                if (m.galaxyFlowAction != null && Object.hasOwnProperty.call(m, "galaxyFlowAction"))
                    $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.encode(m.galaxyFlowAction, w.uint32(74).fork()).ldelim();
                return w;
            };

            PeerDataOperationRequestMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.peerDataOperationRequestType = r.int32();
                            break;
                        }
                    case 2: {
                            if (!(m.requestStickerReupload && m.requestStickerReupload.length))
                                m.requestStickerReupload = [];
                            m.requestStickerReupload.push($root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.decode(r, r.uint32()));
                            break;
                        }
                    case 3: {
                            if (!(m.requestUrlPreview && m.requestUrlPreview.length))
                                m.requestUrlPreview = [];
                            m.requestUrlPreview.push($root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.decode(r, r.uint32()));
                            break;
                        }
                    case 4: {
                            m.historySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.decode(r, r.uint32());
                            break;
                        }
                    case 5: {
                            if (!(m.placeholderMessageResendRequest && m.placeholderMessageResendRequest.length))
                                m.placeholderMessageResendRequest = [];
                            m.placeholderMessageResendRequest.push($root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.decode(r, r.uint32()));
                            break;
                        }
                    case 6: {
                            m.fullHistorySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.decode(r, r.uint32());
                            break;
                        }
                    case 7: {
                            m.syncdCollectionFatalRecoveryRequest = $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.decode(r, r.uint32());
                            break;
                        }
                    case 8: {
                            m.historySyncChunkRetryRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.decode(r, r.uint32());
                            break;
                        }
                    case 9: {
                            m.galaxyFlowAction = $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PeerDataOperationRequestMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage)
                    return d;
                var m = new $root.proto.Message.PeerDataOperationRequestMessage();
                switch (d.peerDataOperationRequestType) {
                default:
                    if (typeof d.peerDataOperationRequestType === "number") {
                        m.peerDataOperationRequestType = d.peerDataOperationRequestType;
                        break;
                    }
                    break;
                case "UPLOAD_STICKER":
                case 0:
                    m.peerDataOperationRequestType = 0;
                    break;
                case "SEND_RECENT_STICKER_BOOTSTRAP":
                case 1:
                    m.peerDataOperationRequestType = 1;
                    break;
                case "GENERATE_LINK_PREVIEW":
                case 2:
                    m.peerDataOperationRequestType = 2;
                    break;
                case "HISTORY_SYNC_ON_DEMAND":
                case 3:
                    m.peerDataOperationRequestType = 3;
                    break;
                case "PLACEHOLDER_MESSAGE_RESEND":
                case 4:
                    m.peerDataOperationRequestType = 4;
                    break;
                case "WAFFLE_LINKING_NONCE_FETCH":
                case 5:
                    m.peerDataOperationRequestType = 5;
                    break;
                case "FULL_HISTORY_SYNC_ON_DEMAND":
                case 6:
                    m.peerDataOperationRequestType = 6;
                    break;
                case "COMPANION_META_NONCE_FETCH":
                case 7:
                    m.peerDataOperationRequestType = 7;
                    break;
                case "COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":
                case 8:
                    m.peerDataOperationRequestType = 8;
                    break;
                case "COMPANION_CANONICAL_USER_NONCE_FETCH":
                case 9:
                    m.peerDataOperationRequestType = 9;
                    break;
                case "HISTORY_SYNC_CHUNK_RETRY":
                case 10:
                    m.peerDataOperationRequestType = 10;
                    break;
                case "GALAXY_FLOW_ACTION":
                case 11:
                    m.peerDataOperationRequestType = 11;
                    break;
                }
                if (d.requestStickerReupload) {
                    if (!Array.isArray(d.requestStickerReupload))
                        throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: array expected");
                    m.requestStickerReupload = [];
                    for (var i = 0; i < d.requestStickerReupload.length; ++i) {
                        if (typeof d.requestStickerReupload[i] !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: object expected");
                        m.requestStickerReupload[i] = $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.fromObject(d.requestStickerReupload[i]);
                    }
                }
                if (d.requestUrlPreview) {
                    if (!Array.isArray(d.requestUrlPreview))
                        throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestUrlPreview: array expected");
                    m.requestUrlPreview = [];
                    for (var i = 0; i < d.requestUrlPreview.length; ++i) {
                        if (typeof d.requestUrlPreview[i] !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestUrlPreview: object expected");
                        m.requestUrlPreview[i] = $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.fromObject(d.requestUrlPreview[i]);
                    }
                }
                if (d.historySyncOnDemandRequest != null) {
                    if (typeof d.historySyncOnDemandRequest !== "object")
                        throw TypeError(".proto.Message.PeerDataOperationRequestMessage.historySyncOnDemandRequest: object expected");
                    m.historySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.fromObject(d.historySyncOnDemandRequest);
                }
                if (d.placeholderMessageResendRequest) {
                    if (!Array.isArray(d.placeholderMessageResendRequest))
                        throw TypeError(".proto.Message.PeerDataOperationRequestMessage.placeholderMessageResendRequest: array expected");
                    m.placeholderMessageResendRequest = [];
                    for (var i = 0; i < d.placeholderMessageResendRequest.length; ++i) {
                        if (typeof d.placeholderMessageResendRequest[i] !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestMessage.placeholderMessageResendRequest: object expected");
                        m.placeholderMessageResendRequest[i] = $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.fromObject(d.placeholderMessageResendRequest[i]);
                    }
                }
                if (d.fullHistorySyncOnDemandRequest != null) {
                    if (typeof d.fullHistorySyncOnDemandRequest !== "object")
                        throw TypeError(".proto.Message.PeerDataOperationRequestMessage.fullHistorySyncOnDemandRequest: object expected");
                    m.fullHistorySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.fromObject(d.fullHistorySyncOnDemandRequest);
                }
                if (d.syncdCollectionFatalRecoveryRequest != null) {
                    if (typeof d.syncdCollectionFatalRecoveryRequest !== "object")
                        throw TypeError(".proto.Message.PeerDataOperationRequestMessage.syncdCollectionFatalRecoveryRequest: object expected");
                    m.syncdCollectionFatalRecoveryRequest = $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.fromObject(d.syncdCollectionFatalRecoveryRequest);
                }
                if (d.historySyncChunkRetryRequest != null) {
                    if (typeof d.historySyncChunkRetryRequest !== "object")
                        throw TypeError(".proto.Message.PeerDataOperationRequestMessage.historySyncChunkRetryRequest: object expected");
                    m.historySyncChunkRetryRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.fromObject(d.historySyncChunkRetryRequest);
                }
                if (d.galaxyFlowAction != null) {
                    if (typeof d.galaxyFlowAction !== "object")
                        throw TypeError(".proto.Message.PeerDataOperationRequestMessage.galaxyFlowAction: object expected");
                    m.galaxyFlowAction = $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.fromObject(d.galaxyFlowAction);
                }
                return m;
            };

            PeerDataOperationRequestMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.requestStickerReupload = [];
                    d.requestUrlPreview = [];
                    d.placeholderMessageResendRequest = [];
                }
                if (m.peerDataOperationRequestType != null && m.hasOwnProperty("peerDataOperationRequestType")) {
                    d.peerDataOperationRequestType = o.enums === String ? $root.proto.Message.PeerDataOperationRequestType[m.peerDataOperationRequestType] === undefined ? m.peerDataOperationRequestType : $root.proto.Message.PeerDataOperationRequestType[m.peerDataOperationRequestType] : m.peerDataOperationRequestType;
                    if (o.oneofs)
                        d._peerDataOperationRequestType = "peerDataOperationRequestType";
                }
                if (m.requestStickerReupload && m.requestStickerReupload.length) {
                    d.requestStickerReupload = [];
                    for (var j = 0; j < m.requestStickerReupload.length; ++j) {
                        d.requestStickerReupload[j] = $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.toObject(m.requestStickerReupload[j], o);
                    }
                }
                if (m.requestUrlPreview && m.requestUrlPreview.length) {
                    d.requestUrlPreview = [];
                    for (var j = 0; j < m.requestUrlPreview.length; ++j) {
                        d.requestUrlPreview[j] = $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.toObject(m.requestUrlPreview[j], o);
                    }
                }
                if (m.historySyncOnDemandRequest != null && m.hasOwnProperty("historySyncOnDemandRequest")) {
                    d.historySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.toObject(m.historySyncOnDemandRequest, o);
                    if (o.oneofs)
                        d._historySyncOnDemandRequest = "historySyncOnDemandRequest";
                }
                if (m.placeholderMessageResendRequest && m.placeholderMessageResendRequest.length) {
                    d.placeholderMessageResendRequest = [];
                    for (var j = 0; j < m.placeholderMessageResendRequest.length; ++j) {
                        d.placeholderMessageResendRequest[j] = $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.toObject(m.placeholderMessageResendRequest[j], o);
                    }
                }
                if (m.fullHistorySyncOnDemandRequest != null && m.hasOwnProperty("fullHistorySyncOnDemandRequest")) {
                    d.fullHistorySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.toObject(m.fullHistorySyncOnDemandRequest, o);
                    if (o.oneofs)
                        d._fullHistorySyncOnDemandRequest = "fullHistorySyncOnDemandRequest";
                }
                if (m.syncdCollectionFatalRecoveryRequest != null && m.hasOwnProperty("syncdCollectionFatalRecoveryRequest")) {
                    d.syncdCollectionFatalRecoveryRequest = $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.toObject(m.syncdCollectionFatalRecoveryRequest, o);
                    if (o.oneofs)
                        d._syncdCollectionFatalRecoveryRequest = "syncdCollectionFatalRecoveryRequest";
                }
                if (m.historySyncChunkRetryRequest != null && m.hasOwnProperty("historySyncChunkRetryRequest")) {
                    d.historySyncChunkRetryRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.toObject(m.historySyncChunkRetryRequest, o);
                    if (o.oneofs)
                        d._historySyncChunkRetryRequest = "historySyncChunkRetryRequest";
                }
                if (m.galaxyFlowAction != null && m.hasOwnProperty("galaxyFlowAction")) {
                    d.galaxyFlowAction = $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.toObject(m.galaxyFlowAction, o);
                    if (o.oneofs)
                        d._galaxyFlowAction = "galaxyFlowAction";
                }
                return d;
            };

            PeerDataOperationRequestMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PeerDataOperationRequestMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage";
            };

            PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest = (function() {

                function FullHistorySyncOnDemandRequest(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                FullHistorySyncOnDemandRequest.prototype.requestMetadata = null;
                FullHistorySyncOnDemandRequest.prototype.historySyncConfig = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(FullHistorySyncOnDemandRequest.prototype, "_requestMetadata", {
                    get: $util.oneOfGetter($oneOfFields = ["requestMetadata"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(FullHistorySyncOnDemandRequest.prototype, "_historySyncConfig", {
                    get: $util.oneOfGetter($oneOfFields = ["historySyncConfig"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                FullHistorySyncOnDemandRequest.create = function create(properties) {
                    return new FullHistorySyncOnDemandRequest(properties);
                };

                FullHistorySyncOnDemandRequest.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.requestMetadata != null && Object.hasOwnProperty.call(m, "requestMetadata"))
                        $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.encode(m.requestMetadata, w.uint32(10).fork()).ldelim();
                    if (m.historySyncConfig != null && Object.hasOwnProperty.call(m, "historySyncConfig"))
                        $root.proto.DeviceProps.HistorySyncConfig.encode(m.historySyncConfig, w.uint32(18).fork()).ldelim();
                    return w;
                };

                FullHistorySyncOnDemandRequest.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(r, r.uint32());
                                break;
                            }
                        case 2: {
                                m.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                FullHistorySyncOnDemandRequest.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest();
                    if (d.requestMetadata != null) {
                        if (typeof d.requestMetadata !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.requestMetadata: object expected");
                        m.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(d.requestMetadata);
                    }
                    if (d.historySyncConfig != null) {
                        if (typeof d.historySyncConfig !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.historySyncConfig: object expected");
                        m.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.fromObject(d.historySyncConfig);
                    }
                    return m;
                };

                FullHistorySyncOnDemandRequest.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.requestMetadata != null && m.hasOwnProperty("requestMetadata")) {
                        d.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(m.requestMetadata, o);
                        if (o.oneofs)
                            d._requestMetadata = "requestMetadata";
                    }
                    if (m.historySyncConfig != null && m.hasOwnProperty("historySyncConfig")) {
                        d.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.toObject(m.historySyncConfig, o);
                        if (o.oneofs)
                            d._historySyncConfig = "historySyncConfig";
                    }
                    return d;
                };

                FullHistorySyncOnDemandRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                FullHistorySyncOnDemandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest";
                };

                return FullHistorySyncOnDemandRequest;
            })();

            PeerDataOperationRequestMessage.GalaxyFlowAction = (function() {

                function GalaxyFlowAction(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                GalaxyFlowAction.prototype.type = null;
                GalaxyFlowAction.prototype.flowId = null;
                GalaxyFlowAction.prototype.stanzaId = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(GalaxyFlowAction.prototype, "_type", {
                    get: $util.oneOfGetter($oneOfFields = ["type"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(GalaxyFlowAction.prototype, "_flowId", {
                    get: $util.oneOfGetter($oneOfFields = ["flowId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(GalaxyFlowAction.prototype, "_stanzaId", {
                    get: $util.oneOfGetter($oneOfFields = ["stanzaId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                GalaxyFlowAction.create = function create(properties) {
                    return new GalaxyFlowAction(properties);
                };

                GalaxyFlowAction.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                        w.uint32(8).int32(m.type);
                    if (m.flowId != null && Object.hasOwnProperty.call(m, "flowId"))
                        w.uint32(18).string(m.flowId);
                    if (m.stanzaId != null && Object.hasOwnProperty.call(m, "stanzaId"))
                        w.uint32(26).string(m.stanzaId);
                    return w;
                };

                GalaxyFlowAction.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.type = r.int32();
                                break;
                            }
                        case 2: {
                                m.flowId = r.string();
                                break;
                            }
                        case 3: {
                                m.stanzaId = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                GalaxyFlowAction.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction();
                    switch (d.type) {
                    default:
                        if (typeof d.type === "number") {
                            m.type = d.type;
                            break;
                        }
                        break;
                    case "NOTIFY_LAUNCH":
                    case 1:
                        m.type = 1;
                        break;
                    }
                    if (d.flowId != null) {
                        m.flowId = String(d.flowId);
                    }
                    if (d.stanzaId != null) {
                        m.stanzaId = String(d.stanzaId);
                    }
                    return m;
                };

                GalaxyFlowAction.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.type != null && m.hasOwnProperty("type")) {
                        d.type = o.enums === String ? $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[m.type] === undefined ? m.type : $root.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[m.type] : m.type;
                        if (o.oneofs)
                            d._type = "type";
                    }
                    if (m.flowId != null && m.hasOwnProperty("flowId")) {
                        d.flowId = m.flowId;
                        if (o.oneofs)
                            d._flowId = "flowId";
                    }
                    if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) {
                        d.stanzaId = m.stanzaId;
                        if (o.oneofs)
                            d._stanzaId = "stanzaId";
                    }
                    return d;
                };

                GalaxyFlowAction.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                GalaxyFlowAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction";
                };

                GalaxyFlowAction.GalaxyFlowActionType = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[1] = "NOTIFY_LAUNCH"] = 1;
                    return values;
                })();

                return GalaxyFlowAction;
            })();

            PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest = (function() {

                function HistorySyncChunkRetryRequest(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                HistorySyncChunkRetryRequest.prototype.syncType = null;
                HistorySyncChunkRetryRequest.prototype.chunkOrder = null;
                HistorySyncChunkRetryRequest.prototype.chunkNotificationId = null;
                HistorySyncChunkRetryRequest.prototype.regenerateChunk = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncChunkRetryRequest.prototype, "_syncType", {
                    get: $util.oneOfGetter($oneOfFields = ["syncType"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncChunkRetryRequest.prototype, "_chunkOrder", {
                    get: $util.oneOfGetter($oneOfFields = ["chunkOrder"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncChunkRetryRequest.prototype, "_chunkNotificationId", {
                    get: $util.oneOfGetter($oneOfFields = ["chunkNotificationId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncChunkRetryRequest.prototype, "_regenerateChunk", {
                    get: $util.oneOfGetter($oneOfFields = ["regenerateChunk"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                HistorySyncChunkRetryRequest.create = function create(properties) {
                    return new HistorySyncChunkRetryRequest(properties);
                };

                HistorySyncChunkRetryRequest.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.syncType != null && Object.hasOwnProperty.call(m, "syncType"))
                        w.uint32(8).int32(m.syncType);
                    if (m.chunkOrder != null && Object.hasOwnProperty.call(m, "chunkOrder"))
                        w.uint32(16).uint32(m.chunkOrder);
                    if (m.chunkNotificationId != null && Object.hasOwnProperty.call(m, "chunkNotificationId"))
                        w.uint32(26).string(m.chunkNotificationId);
                    if (m.regenerateChunk != null && Object.hasOwnProperty.call(m, "regenerateChunk"))
                        w.uint32(32).bool(m.regenerateChunk);
                    return w;
                };

                HistorySyncChunkRetryRequest.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.syncType = r.int32();
                                break;
                            }
                        case 2: {
                                m.chunkOrder = r.uint32();
                                break;
                            }
                        case 3: {
                                m.chunkNotificationId = r.string();
                                break;
                            }
                        case 4: {
                                m.regenerateChunk = r.bool();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                HistorySyncChunkRetryRequest.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest();
                    switch (d.syncType) {
                    default:
                        if (typeof d.syncType === "number") {
                            m.syncType = d.syncType;
                            break;
                        }
                        break;
                    case "INITIAL_BOOTSTRAP":
                    case 0:
                        m.syncType = 0;
                        break;
                    case "INITIAL_STATUS_V3":
                    case 1:
                        m.syncType = 1;
                        break;
                    case "FULL":
                    case 2:
                        m.syncType = 2;
                        break;
                    case "RECENT":
                    case 3:
                        m.syncType = 3;
                        break;
                    case "PUSH_NAME":
                    case 4:
                        m.syncType = 4;
                        break;
                    case "NON_BLOCKING_DATA":
                    case 5:
                        m.syncType = 5;
                        break;
                    case "ON_DEMAND":
                    case 6:
                        m.syncType = 6;
                        break;
                    case "NO_HISTORY":
                    case 7:
                        m.syncType = 7;
                        break;
                    case "MESSAGE_ACCESS_STATUS":
                    case 8:
                        m.syncType = 8;
                        break;
                    }
                    if (d.chunkOrder != null) {
                        m.chunkOrder = d.chunkOrder >>> 0;
                    }
                    if (d.chunkNotificationId != null) {
                        m.chunkNotificationId = String(d.chunkNotificationId);
                    }
                    if (d.regenerateChunk != null) {
                        m.regenerateChunk = Boolean(d.regenerateChunk);
                    }
                    return m;
                };

                HistorySyncChunkRetryRequest.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.syncType != null && m.hasOwnProperty("syncType")) {
                        d.syncType = o.enums === String ? $root.proto.Message.HistorySyncType[m.syncType] === undefined ? m.syncType : $root.proto.Message.HistorySyncType[m.syncType] : m.syncType;
                        if (o.oneofs)
                            d._syncType = "syncType";
                    }
                    if (m.chunkOrder != null && m.hasOwnProperty("chunkOrder")) {
                        d.chunkOrder = m.chunkOrder;
                        if (o.oneofs)
                            d._chunkOrder = "chunkOrder";
                    }
                    if (m.chunkNotificationId != null && m.hasOwnProperty("chunkNotificationId")) {
                        d.chunkNotificationId = m.chunkNotificationId;
                        if (o.oneofs)
                            d._chunkNotificationId = "chunkNotificationId";
                    }
                    if (m.regenerateChunk != null && m.hasOwnProperty("regenerateChunk")) {
                        d.regenerateChunk = m.regenerateChunk;
                        if (o.oneofs)
                            d._regenerateChunk = "regenerateChunk";
                    }
                    return d;
                };

                HistorySyncChunkRetryRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                HistorySyncChunkRetryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest";
                };

                return HistorySyncChunkRetryRequest;
            })();

            PeerDataOperationRequestMessage.HistorySyncOnDemandRequest = (function() {

                function HistorySyncOnDemandRequest(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                HistorySyncOnDemandRequest.prototype.chatJid = null;
                HistorySyncOnDemandRequest.prototype.oldestMsgId = null;
                HistorySyncOnDemandRequest.prototype.oldestMsgFromMe = null;
                HistorySyncOnDemandRequest.prototype.onDemandMsgCount = null;
                HistorySyncOnDemandRequest.prototype.oldestMsgTimestampMs = null;
                HistorySyncOnDemandRequest.prototype.accountLid = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_chatJid", {
                    get: $util.oneOfGetter($oneOfFields = ["chatJid"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_oldestMsgId", {
                    get: $util.oneOfGetter($oneOfFields = ["oldestMsgId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_oldestMsgFromMe", {
                    get: $util.oneOfGetter($oneOfFields = ["oldestMsgFromMe"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_onDemandMsgCount", {
                    get: $util.oneOfGetter($oneOfFields = ["onDemandMsgCount"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_oldestMsgTimestampMs", {
                    get: $util.oneOfGetter($oneOfFields = ["oldestMsgTimestampMs"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_accountLid", {
                    get: $util.oneOfGetter($oneOfFields = ["accountLid"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                HistorySyncOnDemandRequest.create = function create(properties) {
                    return new HistorySyncOnDemandRequest(properties);
                };

                HistorySyncOnDemandRequest.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.chatJid != null && Object.hasOwnProperty.call(m, "chatJid"))
                        w.uint32(10).string(m.chatJid);
                    if (m.oldestMsgId != null && Object.hasOwnProperty.call(m, "oldestMsgId"))
                        w.uint32(18).string(m.oldestMsgId);
                    if (m.oldestMsgFromMe != null && Object.hasOwnProperty.call(m, "oldestMsgFromMe"))
                        w.uint32(24).bool(m.oldestMsgFromMe);
                    if (m.onDemandMsgCount != null && Object.hasOwnProperty.call(m, "onDemandMsgCount"))
                        w.uint32(32).int32(m.onDemandMsgCount);
                    if (m.oldestMsgTimestampMs != null && Object.hasOwnProperty.call(m, "oldestMsgTimestampMs"))
                        w.uint32(40).int64(m.oldestMsgTimestampMs);
                    if (m.accountLid != null && Object.hasOwnProperty.call(m, "accountLid"))
                        w.uint32(50).string(m.accountLid);
                    return w;
                };

                HistorySyncOnDemandRequest.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.chatJid = r.string();
                                break;
                            }
                        case 2: {
                                m.oldestMsgId = r.string();
                                break;
                            }
                        case 3: {
                                m.oldestMsgFromMe = r.bool();
                                break;
                            }
                        case 4: {
                                m.onDemandMsgCount = r.int32();
                                break;
                            }
                        case 5: {
                                m.oldestMsgTimestampMs = r.int64();
                                break;
                            }
                        case 6: {
                                m.accountLid = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                HistorySyncOnDemandRequest.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest();
                    if (d.chatJid != null) {
                        m.chatJid = String(d.chatJid);
                    }
                    if (d.oldestMsgId != null) {
                        m.oldestMsgId = String(d.oldestMsgId);
                    }
                    if (d.oldestMsgFromMe != null) {
                        m.oldestMsgFromMe = Boolean(d.oldestMsgFromMe);
                    }
                    if (d.onDemandMsgCount != null) {
                        m.onDemandMsgCount = d.onDemandMsgCount | 0;
                    }
                    if (d.oldestMsgTimestampMs != null) {
                        if ($util.Long)
                            (m.oldestMsgTimestampMs = $util.Long.fromValue(d.oldestMsgTimestampMs)).unsigned = false;
                        else if (typeof d.oldestMsgTimestampMs === "string")
                            m.oldestMsgTimestampMs = parseInt(d.oldestMsgTimestampMs, 10);
                        else if (typeof d.oldestMsgTimestampMs === "number")
                            m.oldestMsgTimestampMs = d.oldestMsgTimestampMs;
                        else if (typeof d.oldestMsgTimestampMs === "object")
                            m.oldestMsgTimestampMs = new $util.LongBits(d.oldestMsgTimestampMs.low >>> 0, d.oldestMsgTimestampMs.high >>> 0).toNumber();
                    }
                    if (d.accountLid != null) {
                        m.accountLid = String(d.accountLid);
                    }
                    return m;
                };

                HistorySyncOnDemandRequest.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.chatJid != null && m.hasOwnProperty("chatJid")) {
                        d.chatJid = m.chatJid;
                        if (o.oneofs)
                            d._chatJid = "chatJid";
                    }
                    if (m.oldestMsgId != null && m.hasOwnProperty("oldestMsgId")) {
                        d.oldestMsgId = m.oldestMsgId;
                        if (o.oneofs)
                            d._oldestMsgId = "oldestMsgId";
                    }
                    if (m.oldestMsgFromMe != null && m.hasOwnProperty("oldestMsgFromMe")) {
                        d.oldestMsgFromMe = m.oldestMsgFromMe;
                        if (o.oneofs)
                            d._oldestMsgFromMe = "oldestMsgFromMe";
                    }
                    if (m.onDemandMsgCount != null && m.hasOwnProperty("onDemandMsgCount")) {
                        d.onDemandMsgCount = m.onDemandMsgCount;
                        if (o.oneofs)
                            d._onDemandMsgCount = "onDemandMsgCount";
                    }
                    if (m.oldestMsgTimestampMs != null && m.hasOwnProperty("oldestMsgTimestampMs")) {
                        if (typeof m.oldestMsgTimestampMs === "number")
                            d.oldestMsgTimestampMs = o.longs === String ? String(m.oldestMsgTimestampMs) : m.oldestMsgTimestampMs;
                        else
                            d.oldestMsgTimestampMs = o.longs === String ? longToString(m.oldestMsgTimestampMs) : o.longs === Number ? longToNumber(m.oldestMsgTimestampMs) : m.oldestMsgTimestampMs;
                        if (o.oneofs)
                            d._oldestMsgTimestampMs = "oldestMsgTimestampMs";
                    }
                    if (m.accountLid != null && m.hasOwnProperty("accountLid")) {
                        d.accountLid = m.accountLid;
                        if (o.oneofs)
                            d._accountLid = "accountLid";
                    }
                    return d;
                };

                HistorySyncOnDemandRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                HistorySyncOnDemandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest";
                };

                return HistorySyncOnDemandRequest;
            })();

            PeerDataOperationRequestMessage.PlaceholderMessageResendRequest = (function() {

                function PlaceholderMessageResendRequest(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                PlaceholderMessageResendRequest.prototype.messageKey = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PlaceholderMessageResendRequest.prototype, "_messageKey", {
                    get: $util.oneOfGetter($oneOfFields = ["messageKey"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                PlaceholderMessageResendRequest.create = function create(properties) {
                    return new PlaceholderMessageResendRequest(properties);
                };

                PlaceholderMessageResendRequest.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.messageKey != null && Object.hasOwnProperty.call(m, "messageKey"))
                        $root.proto.MessageKey.encode(m.messageKey, w.uint32(10).fork()).ldelim();
                    return w;
                };

                PlaceholderMessageResendRequest.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.messageKey = $root.proto.MessageKey.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                PlaceholderMessageResendRequest.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest();
                    if (d.messageKey != null) {
                        if (typeof d.messageKey !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey: object expected");
                        m.messageKey = $root.proto.MessageKey.fromObject(d.messageKey);
                    }
                    return m;
                };

                PlaceholderMessageResendRequest.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.messageKey != null && m.hasOwnProperty("messageKey")) {
                        d.messageKey = $root.proto.MessageKey.toObject(m.messageKey, o);
                        if (o.oneofs)
                            d._messageKey = "messageKey";
                    }
                    return d;
                };

                PlaceholderMessageResendRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                PlaceholderMessageResendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest";
                };

                return PlaceholderMessageResendRequest;
            })();

            PeerDataOperationRequestMessage.RequestStickerReupload = (function() {

                function RequestStickerReupload(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                RequestStickerReupload.prototype.fileSha256 = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(RequestStickerReupload.prototype, "_fileSha256", {
                    get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                RequestStickerReupload.create = function create(properties) {
                    return new RequestStickerReupload(properties);
                };

                RequestStickerReupload.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                        w.uint32(10).string(m.fileSha256);
                    return w;
                };

                RequestStickerReupload.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.fileSha256 = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                RequestStickerReupload.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload();
                    if (d.fileSha256 != null) {
                        m.fileSha256 = String(d.fileSha256);
                    }
                    return m;
                };

                RequestStickerReupload.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                        d.fileSha256 = m.fileSha256;
                        if (o.oneofs)
                            d._fileSha256 = "fileSha256";
                    }
                    return d;
                };

                RequestStickerReupload.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                RequestStickerReupload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload";
                };

                return RequestStickerReupload;
            })();

            PeerDataOperationRequestMessage.RequestUrlPreview = (function() {

                function RequestUrlPreview(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                RequestUrlPreview.prototype.url = null;
                RequestUrlPreview.prototype.includeHqThumbnail = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(RequestUrlPreview.prototype, "_url", {
                    get: $util.oneOfGetter($oneOfFields = ["url"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(RequestUrlPreview.prototype, "_includeHqThumbnail", {
                    get: $util.oneOfGetter($oneOfFields = ["includeHqThumbnail"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                RequestUrlPreview.create = function create(properties) {
                    return new RequestUrlPreview(properties);
                };

                RequestUrlPreview.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                        w.uint32(10).string(m.url);
                    if (m.includeHqThumbnail != null && Object.hasOwnProperty.call(m, "includeHqThumbnail"))
                        w.uint32(16).bool(m.includeHqThumbnail);
                    return w;
                };

                RequestUrlPreview.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.url = r.string();
                                break;
                            }
                        case 2: {
                                m.includeHqThumbnail = r.bool();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                RequestUrlPreview.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview();
                    if (d.url != null) {
                        m.url = String(d.url);
                    }
                    if (d.includeHqThumbnail != null) {
                        m.includeHqThumbnail = Boolean(d.includeHqThumbnail);
                    }
                    return m;
                };

                RequestUrlPreview.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.url != null && m.hasOwnProperty("url")) {
                        d.url = m.url;
                        if (o.oneofs)
                            d._url = "url";
                    }
                    if (m.includeHqThumbnail != null && m.hasOwnProperty("includeHqThumbnail")) {
                        d.includeHqThumbnail = m.includeHqThumbnail;
                        if (o.oneofs)
                            d._includeHqThumbnail = "includeHqThumbnail";
                    }
                    return d;
                };

                RequestUrlPreview.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                RequestUrlPreview.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview";
                };

                return RequestUrlPreview;
            })();

            PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest = (function() {

                function SyncDCollectionFatalRecoveryRequest(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                SyncDCollectionFatalRecoveryRequest.prototype.collectionName = null;
                SyncDCollectionFatalRecoveryRequest.prototype.timestamp = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SyncDCollectionFatalRecoveryRequest.prototype, "_collectionName", {
                    get: $util.oneOfGetter($oneOfFields = ["collectionName"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(SyncDCollectionFatalRecoveryRequest.prototype, "_timestamp", {
                    get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                SyncDCollectionFatalRecoveryRequest.create = function create(properties) {
                    return new SyncDCollectionFatalRecoveryRequest(properties);
                };

                SyncDCollectionFatalRecoveryRequest.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.collectionName != null && Object.hasOwnProperty.call(m, "collectionName"))
                        w.uint32(10).string(m.collectionName);
                    if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                        w.uint32(16).int64(m.timestamp);
                    return w;
                };

                SyncDCollectionFatalRecoveryRequest.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.collectionName = r.string();
                                break;
                            }
                        case 2: {
                                m.timestamp = r.int64();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                SyncDCollectionFatalRecoveryRequest.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest();
                    if (d.collectionName != null) {
                        m.collectionName = String(d.collectionName);
                    }
                    if (d.timestamp != null) {
                        if ($util.Long)
                            (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                        else if (typeof d.timestamp === "string")
                            m.timestamp = parseInt(d.timestamp, 10);
                        else if (typeof d.timestamp === "number")
                            m.timestamp = d.timestamp;
                        else if (typeof d.timestamp === "object")
                            m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
                    }
                    return m;
                };

                SyncDCollectionFatalRecoveryRequest.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.collectionName != null && m.hasOwnProperty("collectionName")) {
                        d.collectionName = m.collectionName;
                        if (o.oneofs)
                            d._collectionName = "collectionName";
                    }
                    if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                        if (typeof m.timestamp === "number")
                            d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                        else
                            d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                        if (o.oneofs)
                            d._timestamp = "timestamp";
                    }
                    return d;
                };

                SyncDCollectionFatalRecoveryRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                SyncDCollectionFatalRecoveryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest";
                };

                return SyncDCollectionFatalRecoveryRequest;
            })();

            return PeerDataOperationRequestMessage;
        })();

        Message.PeerDataOperationRequestResponseMessage = (function() {

            function PeerDataOperationRequestResponseMessage(p) {
                this.peerDataOperationResult = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PeerDataOperationRequestResponseMessage.prototype.peerDataOperationRequestType = null;
            PeerDataOperationRequestResponseMessage.prototype.stanzaId = null;
            PeerDataOperationRequestResponseMessage.prototype.peerDataOperationResult = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PeerDataOperationRequestResponseMessage.prototype, "_peerDataOperationRequestType", {
                get: $util.oneOfGetter($oneOfFields = ["peerDataOperationRequestType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PeerDataOperationRequestResponseMessage.prototype, "_stanzaId", {
                get: $util.oneOfGetter($oneOfFields = ["stanzaId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PeerDataOperationRequestResponseMessage.create = function create(properties) {
                return new PeerDataOperationRequestResponseMessage(properties);
            };

            PeerDataOperationRequestResponseMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.peerDataOperationRequestType != null && Object.hasOwnProperty.call(m, "peerDataOperationRequestType"))
                    w.uint32(8).int32(m.peerDataOperationRequestType);
                if (m.stanzaId != null && Object.hasOwnProperty.call(m, "stanzaId"))
                    w.uint32(18).string(m.stanzaId);
                if (m.peerDataOperationResult != null && m.peerDataOperationResult.length) {
                    for (var i = 0; i < m.peerDataOperationResult.length; ++i)
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.encode(m.peerDataOperationResult[i], w.uint32(26).fork()).ldelim();
                }
                return w;
            };

            PeerDataOperationRequestResponseMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.peerDataOperationRequestType = r.int32();
                            break;
                        }
                    case 2: {
                            m.stanzaId = r.string();
                            break;
                        }
                    case 3: {
                            if (!(m.peerDataOperationResult && m.peerDataOperationResult.length))
                                m.peerDataOperationResult = [];
                            m.peerDataOperationResult.push($root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PeerDataOperationRequestResponseMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage)
                    return d;
                var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage();
                switch (d.peerDataOperationRequestType) {
                default:
                    if (typeof d.peerDataOperationRequestType === "number") {
                        m.peerDataOperationRequestType = d.peerDataOperationRequestType;
                        break;
                    }
                    break;
                case "UPLOAD_STICKER":
                case 0:
                    m.peerDataOperationRequestType = 0;
                    break;
                case "SEND_RECENT_STICKER_BOOTSTRAP":
                case 1:
                    m.peerDataOperationRequestType = 1;
                    break;
                case "GENERATE_LINK_PREVIEW":
                case 2:
                    m.peerDataOperationRequestType = 2;
                    break;
                case "HISTORY_SYNC_ON_DEMAND":
                case 3:
                    m.peerDataOperationRequestType = 3;
                    break;
                case "PLACEHOLDER_MESSAGE_RESEND":
                case 4:
                    m.peerDataOperationRequestType = 4;
                    break;
                case "WAFFLE_LINKING_NONCE_FETCH":
                case 5:
                    m.peerDataOperationRequestType = 5;
                    break;
                case "FULL_HISTORY_SYNC_ON_DEMAND":
                case 6:
                    m.peerDataOperationRequestType = 6;
                    break;
                case "COMPANION_META_NONCE_FETCH":
                case 7:
                    m.peerDataOperationRequestType = 7;
                    break;
                case "COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":
                case 8:
                    m.peerDataOperationRequestType = 8;
                    break;
                case "COMPANION_CANONICAL_USER_NONCE_FETCH":
                case 9:
                    m.peerDataOperationRequestType = 9;
                    break;
                case "HISTORY_SYNC_CHUNK_RETRY":
                case 10:
                    m.peerDataOperationRequestType = 10;
                    break;
                case "GALAXY_FLOW_ACTION":
                case 11:
                    m.peerDataOperationRequestType = 11;
                    break;
                }
                if (d.stanzaId != null) {
                    m.stanzaId = String(d.stanzaId);
                }
                if (d.peerDataOperationResult) {
                    if (!Array.isArray(d.peerDataOperationResult))
                        throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: array expected");
                    m.peerDataOperationResult = [];
                    for (var i = 0; i < d.peerDataOperationResult.length; ++i) {
                        if (typeof d.peerDataOperationResult[i] !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: object expected");
                        m.peerDataOperationResult[i] = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fromObject(d.peerDataOperationResult[i]);
                    }
                }
                return m;
            };

            PeerDataOperationRequestResponseMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.peerDataOperationResult = [];
                }
                if (m.peerDataOperationRequestType != null && m.hasOwnProperty("peerDataOperationRequestType")) {
                    d.peerDataOperationRequestType = o.enums === String ? $root.proto.Message.PeerDataOperationRequestType[m.peerDataOperationRequestType] === undefined ? m.peerDataOperationRequestType : $root.proto.Message.PeerDataOperationRequestType[m.peerDataOperationRequestType] : m.peerDataOperationRequestType;
                    if (o.oneofs)
                        d._peerDataOperationRequestType = "peerDataOperationRequestType";
                }
                if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) {
                    d.stanzaId = m.stanzaId;
                    if (o.oneofs)
                        d._stanzaId = "stanzaId";
                }
                if (m.peerDataOperationResult && m.peerDataOperationResult.length) {
                    d.peerDataOperationResult = [];
                    for (var j = 0; j < m.peerDataOperationResult.length; ++j) {
                        d.peerDataOperationResult[j] = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.toObject(m.peerDataOperationResult[j], o);
                    }
                }
                return d;
            };

            PeerDataOperationRequestResponseMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PeerDataOperationRequestResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage";
            };

            PeerDataOperationRequestResponseMessage.PeerDataOperationResult = (function() {

                function PeerDataOperationResult(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                PeerDataOperationResult.prototype.mediaUploadResult = null;
                PeerDataOperationResult.prototype.stickerMessage = null;
                PeerDataOperationResult.prototype.linkPreviewResponse = null;
                PeerDataOperationResult.prototype.placeholderMessageResendResponse = null;
                PeerDataOperationResult.prototype.waffleNonceFetchRequestResponse = null;
                PeerDataOperationResult.prototype.fullHistorySyncOnDemandRequestResponse = null;
                PeerDataOperationResult.prototype.companionMetaNonceFetchRequestResponse = null;
                PeerDataOperationResult.prototype.syncdSnapshotFatalRecoveryResponse = null;
                PeerDataOperationResult.prototype.companionCanonicalUserNonceFetchRequestResponse = null;
                PeerDataOperationResult.prototype.historySyncChunkRetryResponse = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_mediaUploadResult", {
                    get: $util.oneOfGetter($oneOfFields = ["mediaUploadResult"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_stickerMessage", {
                    get: $util.oneOfGetter($oneOfFields = ["stickerMessage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_linkPreviewResponse", {
                    get: $util.oneOfGetter($oneOfFields = ["linkPreviewResponse"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_placeholderMessageResendResponse", {
                    get: $util.oneOfGetter($oneOfFields = ["placeholderMessageResendResponse"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_waffleNonceFetchRequestResponse", {
                    get: $util.oneOfGetter($oneOfFields = ["waffleNonceFetchRequestResponse"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_fullHistorySyncOnDemandRequestResponse", {
                    get: $util.oneOfGetter($oneOfFields = ["fullHistorySyncOnDemandRequestResponse"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_companionMetaNonceFetchRequestResponse", {
                    get: $util.oneOfGetter($oneOfFields = ["companionMetaNonceFetchRequestResponse"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_syncdSnapshotFatalRecoveryResponse", {
                    get: $util.oneOfGetter($oneOfFields = ["syncdSnapshotFatalRecoveryResponse"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_companionCanonicalUserNonceFetchRequestResponse", {
                    get: $util.oneOfGetter($oneOfFields = ["companionCanonicalUserNonceFetchRequestResponse"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PeerDataOperationResult.prototype, "_historySyncChunkRetryResponse", {
                    get: $util.oneOfGetter($oneOfFields = ["historySyncChunkRetryResponse"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                PeerDataOperationResult.create = function create(properties) {
                    return new PeerDataOperationResult(properties);
                };

                PeerDataOperationResult.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.mediaUploadResult != null && Object.hasOwnProperty.call(m, "mediaUploadResult"))
                        w.uint32(8).int32(m.mediaUploadResult);
                    if (m.stickerMessage != null && Object.hasOwnProperty.call(m, "stickerMessage"))
                        $root.proto.Message.StickerMessage.encode(m.stickerMessage, w.uint32(18).fork()).ldelim();
                    if (m.linkPreviewResponse != null && Object.hasOwnProperty.call(m, "linkPreviewResponse"))
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.encode(m.linkPreviewResponse, w.uint32(26).fork()).ldelim();
                    if (m.placeholderMessageResendResponse != null && Object.hasOwnProperty.call(m, "placeholderMessageResendResponse"))
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.encode(m.placeholderMessageResendResponse, w.uint32(34).fork()).ldelim();
                    if (m.waffleNonceFetchRequestResponse != null && Object.hasOwnProperty.call(m, "waffleNonceFetchRequestResponse"))
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.encode(m.waffleNonceFetchRequestResponse, w.uint32(42).fork()).ldelim();
                    if (m.fullHistorySyncOnDemandRequestResponse != null && Object.hasOwnProperty.call(m, "fullHistorySyncOnDemandRequestResponse"))
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.encode(m.fullHistorySyncOnDemandRequestResponse, w.uint32(50).fork()).ldelim();
                    if (m.companionMetaNonceFetchRequestResponse != null && Object.hasOwnProperty.call(m, "companionMetaNonceFetchRequestResponse"))
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.encode(m.companionMetaNonceFetchRequestResponse, w.uint32(58).fork()).ldelim();
                    if (m.syncdSnapshotFatalRecoveryResponse != null && Object.hasOwnProperty.call(m, "syncdSnapshotFatalRecoveryResponse"))
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.encode(m.syncdSnapshotFatalRecoveryResponse, w.uint32(66).fork()).ldelim();
                    if (m.companionCanonicalUserNonceFetchRequestResponse != null && Object.hasOwnProperty.call(m, "companionCanonicalUserNonceFetchRequestResponse"))
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.encode(m.companionCanonicalUserNonceFetchRequestResponse, w.uint32(74).fork()).ldelim();
                    if (m.historySyncChunkRetryResponse != null && Object.hasOwnProperty.call(m, "historySyncChunkRetryResponse"))
                        $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.encode(m.historySyncChunkRetryResponse, w.uint32(82).fork()).ldelim();
                    return w;
                };

                PeerDataOperationResult.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.mediaUploadResult = r.int32();
                                break;
                            }
                        case 2: {
                                m.stickerMessage = $root.proto.Message.StickerMessage.decode(r, r.uint32());
                                break;
                            }
                        case 3: {
                                m.linkPreviewResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.decode(r, r.uint32());
                                break;
                            }
                        case 4: {
                                m.placeholderMessageResendResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.decode(r, r.uint32());
                                break;
                            }
                        case 5: {
                                m.waffleNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.decode(r, r.uint32());
                                break;
                            }
                        case 6: {
                                m.fullHistorySyncOnDemandRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.decode(r, r.uint32());
                                break;
                            }
                        case 7: {
                                m.companionMetaNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.decode(r, r.uint32());
                                break;
                            }
                        case 8: {
                                m.syncdSnapshotFatalRecoveryResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.decode(r, r.uint32());
                                break;
                            }
                        case 9: {
                                m.companionCanonicalUserNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.decode(r, r.uint32());
                                break;
                            }
                        case 10: {
                                m.historySyncChunkRetryResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                PeerDataOperationResult.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult)
                        return d;
                    var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult();
                    switch (d.mediaUploadResult) {
                    default:
                        if (typeof d.mediaUploadResult === "number") {
                            m.mediaUploadResult = d.mediaUploadResult;
                            break;
                        }
                        break;
                    case "GENERAL_ERROR":
                    case 0:
                        m.mediaUploadResult = 0;
                        break;
                    case "SUCCESS":
                    case 1:
                        m.mediaUploadResult = 1;
                        break;
                    case "NOT_FOUND":
                    case 2:
                        m.mediaUploadResult = 2;
                        break;
                    case "DECRYPTION_ERROR":
                    case 3:
                        m.mediaUploadResult = 3;
                        break;
                    }
                    if (d.stickerMessage != null) {
                        if (typeof d.stickerMessage !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage: object expected");
                        m.stickerMessage = $root.proto.Message.StickerMessage.fromObject(d.stickerMessage);
                    }
                    if (d.linkPreviewResponse != null) {
                        if (typeof d.linkPreviewResponse !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse: object expected");
                        m.linkPreviewResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.fromObject(d.linkPreviewResponse);
                    }
                    if (d.placeholderMessageResendResponse != null) {
                        if (typeof d.placeholderMessageResendResponse !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse: object expected");
                        m.placeholderMessageResendResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.fromObject(d.placeholderMessageResendResponse);
                    }
                    if (d.waffleNonceFetchRequestResponse != null) {
                        if (typeof d.waffleNonceFetchRequestResponse !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.waffleNonceFetchRequestResponse: object expected");
                        m.waffleNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.fromObject(d.waffleNonceFetchRequestResponse);
                    }
                    if (d.fullHistorySyncOnDemandRequestResponse != null) {
                        if (typeof d.fullHistorySyncOnDemandRequestResponse !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fullHistorySyncOnDemandRequestResponse: object expected");
                        m.fullHistorySyncOnDemandRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.fromObject(d.fullHistorySyncOnDemandRequestResponse);
                    }
                    if (d.companionMetaNonceFetchRequestResponse != null) {
                        if (typeof d.companionMetaNonceFetchRequestResponse !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionMetaNonceFetchRequestResponse: object expected");
                        m.companionMetaNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.fromObject(d.companionMetaNonceFetchRequestResponse);
                    }
                    if (d.syncdSnapshotFatalRecoveryResponse != null) {
                        if (typeof d.syncdSnapshotFatalRecoveryResponse !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.syncdSnapshotFatalRecoveryResponse: object expected");
                        m.syncdSnapshotFatalRecoveryResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.fromObject(d.syncdSnapshotFatalRecoveryResponse);
                    }
                    if (d.companionCanonicalUserNonceFetchRequestResponse != null) {
                        if (typeof d.companionCanonicalUserNonceFetchRequestResponse !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionCanonicalUserNonceFetchRequestResponse: object expected");
                        m.companionCanonicalUserNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.fromObject(d.companionCanonicalUserNonceFetchRequestResponse);
                    }
                    if (d.historySyncChunkRetryResponse != null) {
                        if (typeof d.historySyncChunkRetryResponse !== "object")
                            throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.historySyncChunkRetryResponse: object expected");
                        m.historySyncChunkRetryResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.fromObject(d.historySyncChunkRetryResponse);
                    }
                    return m;
                };

                PeerDataOperationResult.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.mediaUploadResult != null && m.hasOwnProperty("mediaUploadResult")) {
                        d.mediaUploadResult = o.enums === String ? $root.proto.MediaRetryNotification.ResultType[m.mediaUploadResult] === undefined ? m.mediaUploadResult : $root.proto.MediaRetryNotification.ResultType[m.mediaUploadResult] : m.mediaUploadResult;
                        if (o.oneofs)
                            d._mediaUploadResult = "mediaUploadResult";
                    }
                    if (m.stickerMessage != null && m.hasOwnProperty("stickerMessage")) {
                        d.stickerMessage = $root.proto.Message.StickerMessage.toObject(m.stickerMessage, o);
                        if (o.oneofs)
                            d._stickerMessage = "stickerMessage";
                    }
                    if (m.linkPreviewResponse != null && m.hasOwnProperty("linkPreviewResponse")) {
                        d.linkPreviewResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.toObject(m.linkPreviewResponse, o);
                        if (o.oneofs)
                            d._linkPreviewResponse = "linkPreviewResponse";
                    }
                    if (m.placeholderMessageResendResponse != null && m.hasOwnProperty("placeholderMessageResendResponse")) {
                        d.placeholderMessageResendResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.toObject(m.placeholderMessageResendResponse, o);
                        if (o.oneofs)
                            d._placeholderMessageResendResponse = "placeholderMessageResendResponse";
                    }
                    if (m.waffleNonceFetchRequestResponse != null && m.hasOwnProperty("waffleNonceFetchRequestResponse")) {
                        d.waffleNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.toObject(m.waffleNonceFetchRequestResponse, o);
                        if (o.oneofs)
                            d._waffleNonceFetchRequestResponse = "waffleNonceFetchRequestResponse";
                    }
                    if (m.fullHistorySyncOnDemandRequestResponse != null && m.hasOwnProperty("fullHistorySyncOnDemandRequestResponse")) {
                        d.fullHistorySyncOnDemandRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.toObject(m.fullHistorySyncOnDemandRequestResponse, o);
                        if (o.oneofs)
                            d._fullHistorySyncOnDemandRequestResponse = "fullHistorySyncOnDemandRequestResponse";
                    }
                    if (m.companionMetaNonceFetchRequestResponse != null && m.hasOwnProperty("companionMetaNonceFetchRequestResponse")) {
                        d.companionMetaNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.toObject(m.companionMetaNonceFetchRequestResponse, o);
                        if (o.oneofs)
                            d._companionMetaNonceFetchRequestResponse = "companionMetaNonceFetchRequestResponse";
                    }
                    if (m.syncdSnapshotFatalRecoveryResponse != null && m.hasOwnProperty("syncdSnapshotFatalRecoveryResponse")) {
                        d.syncdSnapshotFatalRecoveryResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.toObject(m.syncdSnapshotFatalRecoveryResponse, o);
                        if (o.oneofs)
                            d._syncdSnapshotFatalRecoveryResponse = "syncdSnapshotFatalRecoveryResponse";
                    }
                    if (m.companionCanonicalUserNonceFetchRequestResponse != null && m.hasOwnProperty("companionCanonicalUserNonceFetchRequestResponse")) {
                        d.companionCanonicalUserNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.toObject(m.companionCanonicalUserNonceFetchRequestResponse, o);
                        if (o.oneofs)
                            d._companionCanonicalUserNonceFetchRequestResponse = "companionCanonicalUserNonceFetchRequestResponse";
                    }
                    if (m.historySyncChunkRetryResponse != null && m.hasOwnProperty("historySyncChunkRetryResponse")) {
                        d.historySyncChunkRetryResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.toObject(m.historySyncChunkRetryResponse, o);
                        if (o.oneofs)
                            d._historySyncChunkRetryResponse = "historySyncChunkRetryResponse";
                    }
                    return d;
                };

                PeerDataOperationResult.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                PeerDataOperationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult";
                };

                PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse = (function() {

                    function CompanionCanonicalUserNonceFetchResponse(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    CompanionCanonicalUserNonceFetchResponse.prototype.nonce = null;
                    CompanionCanonicalUserNonceFetchResponse.prototype.waFbid = null;
                    CompanionCanonicalUserNonceFetchResponse.prototype.forceRefresh = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(CompanionCanonicalUserNonceFetchResponse.prototype, "_nonce", {
                        get: $util.oneOfGetter($oneOfFields = ["nonce"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(CompanionCanonicalUserNonceFetchResponse.prototype, "_waFbid", {
                        get: $util.oneOfGetter($oneOfFields = ["waFbid"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(CompanionCanonicalUserNonceFetchResponse.prototype, "_forceRefresh", {
                        get: $util.oneOfGetter($oneOfFields = ["forceRefresh"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    CompanionCanonicalUserNonceFetchResponse.create = function create(properties) {
                        return new CompanionCanonicalUserNonceFetchResponse(properties);
                    };

                    CompanionCanonicalUserNonceFetchResponse.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce"))
                            w.uint32(10).string(m.nonce);
                        if (m.waFbid != null && Object.hasOwnProperty.call(m, "waFbid"))
                            w.uint32(18).string(m.waFbid);
                        if (m.forceRefresh != null && Object.hasOwnProperty.call(m, "forceRefresh"))
                            w.uint32(24).bool(m.forceRefresh);
                        return w;
                    };

                    CompanionCanonicalUserNonceFetchResponse.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.nonce = r.string();
                                    break;
                                }
                            case 2: {
                                    m.waFbid = r.string();
                                    break;
                                }
                            case 3: {
                                    m.forceRefresh = r.bool();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    CompanionCanonicalUserNonceFetchResponse.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse)
                            return d;
                        var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse();
                        if (d.nonce != null) {
                            m.nonce = String(d.nonce);
                        }
                        if (d.waFbid != null) {
                            m.waFbid = String(d.waFbid);
                        }
                        if (d.forceRefresh != null) {
                            m.forceRefresh = Boolean(d.forceRefresh);
                        }
                        return m;
                    };

                    CompanionCanonicalUserNonceFetchResponse.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.nonce != null && m.hasOwnProperty("nonce")) {
                            d.nonce = m.nonce;
                            if (o.oneofs)
                                d._nonce = "nonce";
                        }
                        if (m.waFbid != null && m.hasOwnProperty("waFbid")) {
                            d.waFbid = m.waFbid;
                            if (o.oneofs)
                                d._waFbid = "waFbid";
                        }
                        if (m.forceRefresh != null && m.hasOwnProperty("forceRefresh")) {
                            d.forceRefresh = m.forceRefresh;
                            if (o.oneofs)
                                d._forceRefresh = "forceRefresh";
                        }
                        return d;
                    };

                    CompanionCanonicalUserNonceFetchResponse.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    CompanionCanonicalUserNonceFetchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse";
                    };

                    return CompanionCanonicalUserNonceFetchResponse;
                })();

                PeerDataOperationResult.CompanionMetaNonceFetchResponse = (function() {

                    function CompanionMetaNonceFetchResponse(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    CompanionMetaNonceFetchResponse.prototype.nonce = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(CompanionMetaNonceFetchResponse.prototype, "_nonce", {
                        get: $util.oneOfGetter($oneOfFields = ["nonce"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    CompanionMetaNonceFetchResponse.create = function create(properties) {
                        return new CompanionMetaNonceFetchResponse(properties);
                    };

                    CompanionMetaNonceFetchResponse.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce"))
                            w.uint32(10).string(m.nonce);
                        return w;
                    };

                    CompanionMetaNonceFetchResponse.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.nonce = r.string();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    CompanionMetaNonceFetchResponse.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse)
                            return d;
                        var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse();
                        if (d.nonce != null) {
                            m.nonce = String(d.nonce);
                        }
                        return m;
                    };

                    CompanionMetaNonceFetchResponse.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.nonce != null && m.hasOwnProperty("nonce")) {
                            d.nonce = m.nonce;
                            if (o.oneofs)
                                d._nonce = "nonce";
                        }
                        return d;
                    };

                    CompanionMetaNonceFetchResponse.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    CompanionMetaNonceFetchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse";
                    };

                    return CompanionMetaNonceFetchResponse;
                })();

                PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse = (function() {

                    function FullHistorySyncOnDemandRequestResponse(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    FullHistorySyncOnDemandRequestResponse.prototype.requestMetadata = null;
                    FullHistorySyncOnDemandRequestResponse.prototype.responseCode = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(FullHistorySyncOnDemandRequestResponse.prototype, "_requestMetadata", {
                        get: $util.oneOfGetter($oneOfFields = ["requestMetadata"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(FullHistorySyncOnDemandRequestResponse.prototype, "_responseCode", {
                        get: $util.oneOfGetter($oneOfFields = ["responseCode"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    FullHistorySyncOnDemandRequestResponse.create = function create(properties) {
                        return new FullHistorySyncOnDemandRequestResponse(properties);
                    };

                    FullHistorySyncOnDemandRequestResponse.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.requestMetadata != null && Object.hasOwnProperty.call(m, "requestMetadata"))
                            $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.encode(m.requestMetadata, w.uint32(10).fork()).ldelim();
                        if (m.responseCode != null && Object.hasOwnProperty.call(m, "responseCode"))
                            w.uint32(16).int32(m.responseCode);
                        return w;
                    };

                    FullHistorySyncOnDemandRequestResponse.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(r, r.uint32());
                                    break;
                                }
                            case 2: {
                                    m.responseCode = r.int32();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    FullHistorySyncOnDemandRequestResponse.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse)
                            return d;
                        var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse();
                        if (d.requestMetadata != null) {
                            if (typeof d.requestMetadata !== "object")
                                throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.requestMetadata: object expected");
                            m.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(d.requestMetadata);
                        }
                        switch (d.responseCode) {
                        default:
                            if (typeof d.responseCode === "number") {
                                m.responseCode = d.responseCode;
                                break;
                            }
                            break;
                        case "REQUEST_SUCCESS":
                        case 0:
                            m.responseCode = 0;
                            break;
                        case "REQUEST_TIME_EXPIRED":
                        case 1:
                            m.responseCode = 1;
                            break;
                        case "DECLINED_SHARING_HISTORY":
                        case 2:
                            m.responseCode = 2;
                            break;
                        case "GENERIC_ERROR":
                        case 3:
                            m.responseCode = 3;
                            break;
                        case "ERROR_REQUEST_ON_NON_SMB_PRIMARY":
                        case 4:
                            m.responseCode = 4;
                            break;
                        case "ERROR_HOSTED_DEVICE_NOT_CONNECTED":
                        case 5:
                            m.responseCode = 5;
                            break;
                        case "ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET":
                        case 6:
                            m.responseCode = 6;
                            break;
                        }
                        return m;
                    };

                    FullHistorySyncOnDemandRequestResponse.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.requestMetadata != null && m.hasOwnProperty("requestMetadata")) {
                            d.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(m.requestMetadata, o);
                            if (o.oneofs)
                                d._requestMetadata = "requestMetadata";
                        }
                        if (m.responseCode != null && m.hasOwnProperty("responseCode")) {
                            d.responseCode = o.enums === String ? $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[m.responseCode] === undefined ? m.responseCode : $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[m.responseCode] : m.responseCode;
                            if (o.oneofs)
                                d._responseCode = "responseCode";
                        }
                        return d;
                    };

                    FullHistorySyncOnDemandRequestResponse.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    FullHistorySyncOnDemandRequestResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse";
                    };

                    return FullHistorySyncOnDemandRequestResponse;
                })();

                PeerDataOperationResult.FullHistorySyncOnDemandResponseCode = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "REQUEST_SUCCESS"] = 0;
                    values[valuesById[1] = "REQUEST_TIME_EXPIRED"] = 1;
                    values[valuesById[2] = "DECLINED_SHARING_HISTORY"] = 2;
                    values[valuesById[3] = "GENERIC_ERROR"] = 3;
                    values[valuesById[4] = "ERROR_REQUEST_ON_NON_SMB_PRIMARY"] = 4;
                    values[valuesById[5] = "ERROR_HOSTED_DEVICE_NOT_CONNECTED"] = 5;
                    values[valuesById[6] = "ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET"] = 6;
                    return values;
                })();

                PeerDataOperationResult.HistorySyncChunkRetryResponse = (function() {

                    function HistorySyncChunkRetryResponse(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    HistorySyncChunkRetryResponse.prototype.syncType = null;
                    HistorySyncChunkRetryResponse.prototype.chunkOrder = null;
                    HistorySyncChunkRetryResponse.prototype.requestId = null;
                    HistorySyncChunkRetryResponse.prototype.responseCode = null;
                    HistorySyncChunkRetryResponse.prototype.canRecover = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(HistorySyncChunkRetryResponse.prototype, "_syncType", {
                        get: $util.oneOfGetter($oneOfFields = ["syncType"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(HistorySyncChunkRetryResponse.prototype, "_chunkOrder", {
                        get: $util.oneOfGetter($oneOfFields = ["chunkOrder"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(HistorySyncChunkRetryResponse.prototype, "_requestId", {
                        get: $util.oneOfGetter($oneOfFields = ["requestId"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(HistorySyncChunkRetryResponse.prototype, "_responseCode", {
                        get: $util.oneOfGetter($oneOfFields = ["responseCode"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(HistorySyncChunkRetryResponse.prototype, "_canRecover", {
                        get: $util.oneOfGetter($oneOfFields = ["canRecover"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    HistorySyncChunkRetryResponse.create = function create(properties) {
                        return new HistorySyncChunkRetryResponse(properties);
                    };

                    HistorySyncChunkRetryResponse.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.syncType != null && Object.hasOwnProperty.call(m, "syncType"))
                            w.uint32(8).int32(m.syncType);
                        if (m.chunkOrder != null && Object.hasOwnProperty.call(m, "chunkOrder"))
                            w.uint32(16).uint32(m.chunkOrder);
                        if (m.requestId != null && Object.hasOwnProperty.call(m, "requestId"))
                            w.uint32(26).string(m.requestId);
                        if (m.responseCode != null && Object.hasOwnProperty.call(m, "responseCode"))
                            w.uint32(32).int32(m.responseCode);
                        if (m.canRecover != null && Object.hasOwnProperty.call(m, "canRecover"))
                            w.uint32(40).bool(m.canRecover);
                        return w;
                    };

                    HistorySyncChunkRetryResponse.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.syncType = r.int32();
                                    break;
                                }
                            case 2: {
                                    m.chunkOrder = r.uint32();
                                    break;
                                }
                            case 3: {
                                    m.requestId = r.string();
                                    break;
                                }
                            case 4: {
                                    m.responseCode = r.int32();
                                    break;
                                }
                            case 5: {
                                    m.canRecover = r.bool();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    HistorySyncChunkRetryResponse.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse)
                            return d;
                        var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse();
                        switch (d.syncType) {
                        default:
                            if (typeof d.syncType === "number") {
                                m.syncType = d.syncType;
                                break;
                            }
                            break;
                        case "INITIAL_BOOTSTRAP":
                        case 0:
                            m.syncType = 0;
                            break;
                        case "INITIAL_STATUS_V3":
                        case 1:
                            m.syncType = 1;
                            break;
                        case "FULL":
                        case 2:
                            m.syncType = 2;
                            break;
                        case "RECENT":
                        case 3:
                            m.syncType = 3;
                            break;
                        case "PUSH_NAME":
                        case 4:
                            m.syncType = 4;
                            break;
                        case "NON_BLOCKING_DATA":
                        case 5:
                            m.syncType = 5;
                            break;
                        case "ON_DEMAND":
                        case 6:
                            m.syncType = 6;
                            break;
                        case "NO_HISTORY":
                        case 7:
                            m.syncType = 7;
                            break;
                        case "MESSAGE_ACCESS_STATUS":
                        case 8:
                            m.syncType = 8;
                            break;
                        }
                        if (d.chunkOrder != null) {
                            m.chunkOrder = d.chunkOrder >>> 0;
                        }
                        if (d.requestId != null) {
                            m.requestId = String(d.requestId);
                        }
                        switch (d.responseCode) {
                        default:
                            if (typeof d.responseCode === "number") {
                                m.responseCode = d.responseCode;
                                break;
                            }
                            break;
                        case "GENERATION_ERROR":
                        case 1:
                            m.responseCode = 1;
                            break;
                        case "CHUNK_CONSUMED":
                        case 2:
                            m.responseCode = 2;
                            break;
                        case "TIMEOUT":
                        case 3:
                            m.responseCode = 3;
                            break;
                        case "SESSION_EXHAUSTED":
                        case 4:
                            m.responseCode = 4;
                            break;
                        case "CHUNK_EXHAUSTED":
                        case 5:
                            m.responseCode = 5;
                            break;
                        case "DUPLICATED_REQUEST":
                        case 6:
                            m.responseCode = 6;
                            break;
                        }
                        if (d.canRecover != null) {
                            m.canRecover = Boolean(d.canRecover);
                        }
                        return m;
                    };

                    HistorySyncChunkRetryResponse.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.syncType != null && m.hasOwnProperty("syncType")) {
                            d.syncType = o.enums === String ? $root.proto.Message.HistorySyncType[m.syncType] === undefined ? m.syncType : $root.proto.Message.HistorySyncType[m.syncType] : m.syncType;
                            if (o.oneofs)
                                d._syncType = "syncType";
                        }
                        if (m.chunkOrder != null && m.hasOwnProperty("chunkOrder")) {
                            d.chunkOrder = m.chunkOrder;
                            if (o.oneofs)
                                d._chunkOrder = "chunkOrder";
                        }
                        if (m.requestId != null && m.hasOwnProperty("requestId")) {
                            d.requestId = m.requestId;
                            if (o.oneofs)
                                d._requestId = "requestId";
                        }
                        if (m.responseCode != null && m.hasOwnProperty("responseCode")) {
                            d.responseCode = o.enums === String ? $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[m.responseCode] === undefined ? m.responseCode : $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[m.responseCode] : m.responseCode;
                            if (o.oneofs)
                                d._responseCode = "responseCode";
                        }
                        if (m.canRecover != null && m.hasOwnProperty("canRecover")) {
                            d.canRecover = m.canRecover;
                            if (o.oneofs)
                                d._canRecover = "canRecover";
                        }
                        return d;
                    };

                    HistorySyncChunkRetryResponse.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    HistorySyncChunkRetryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse";
                    };

                    return HistorySyncChunkRetryResponse;
                })();

                PeerDataOperationResult.HistorySyncChunkRetryResponseCode = (function() {
                    const valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[1] = "GENERATION_ERROR"] = 1;
                    values[valuesById[2] = "CHUNK_CONSUMED"] = 2;
                    values[valuesById[3] = "TIMEOUT"] = 3;
                    values[valuesById[4] = "SESSION_EXHAUSTED"] = 4;
                    values[valuesById[5] = "CHUNK_EXHAUSTED"] = 5;
                    values[valuesById[6] = "DUPLICATED_REQUEST"] = 6;
                    return values;
                })();

                PeerDataOperationResult.LinkPreviewResponse = (function() {

                    function LinkPreviewResponse(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    LinkPreviewResponse.prototype.url = null;
                    LinkPreviewResponse.prototype.title = null;
                    LinkPreviewResponse.prototype.description = null;
                    LinkPreviewResponse.prototype.thumbData = null;
                    LinkPreviewResponse.prototype.matchText = null;
                    LinkPreviewResponse.prototype.previewType = null;
                    LinkPreviewResponse.prototype.hqThumbnail = null;
                    LinkPreviewResponse.prototype.previewMetadata = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(LinkPreviewResponse.prototype, "_url", {
                        get: $util.oneOfGetter($oneOfFields = ["url"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(LinkPreviewResponse.prototype, "_title", {
                        get: $util.oneOfGetter($oneOfFields = ["title"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(LinkPreviewResponse.prototype, "_description", {
                        get: $util.oneOfGetter($oneOfFields = ["description"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(LinkPreviewResponse.prototype, "_thumbData", {
                        get: $util.oneOfGetter($oneOfFields = ["thumbData"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(LinkPreviewResponse.prototype, "_matchText", {
                        get: $util.oneOfGetter($oneOfFields = ["matchText"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(LinkPreviewResponse.prototype, "_previewType", {
                        get: $util.oneOfGetter($oneOfFields = ["previewType"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(LinkPreviewResponse.prototype, "_hqThumbnail", {
                        get: $util.oneOfGetter($oneOfFields = ["hqThumbnail"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(LinkPreviewResponse.prototype, "_previewMetadata", {
                        get: $util.oneOfGetter($oneOfFields = ["previewMetadata"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    LinkPreviewResponse.create = function create(properties) {
                        return new LinkPreviewResponse(properties);
                    };

                    LinkPreviewResponse.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                            w.uint32(10).string(m.url);
                        if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                            w.uint32(18).string(m.title);
                        if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                            w.uint32(26).string(m.description);
                        if (m.thumbData != null && Object.hasOwnProperty.call(m, "thumbData"))
                            w.uint32(34).bytes(m.thumbData);
                        if (m.matchText != null && Object.hasOwnProperty.call(m, "matchText"))
                            w.uint32(50).string(m.matchText);
                        if (m.previewType != null && Object.hasOwnProperty.call(m, "previewType"))
                            w.uint32(58).string(m.previewType);
                        if (m.hqThumbnail != null && Object.hasOwnProperty.call(m, "hqThumbnail"))
                            $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.encode(m.hqThumbnail, w.uint32(66).fork()).ldelim();
                        if (m.previewMetadata != null && Object.hasOwnProperty.call(m, "previewMetadata"))
                            $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.encode(m.previewMetadata, w.uint32(74).fork()).ldelim();
                        return w;
                    };

                    LinkPreviewResponse.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.url = r.string();
                                    break;
                                }
                            case 2: {
                                    m.title = r.string();
                                    break;
                                }
                            case 3: {
                                    m.description = r.string();
                                    break;
                                }
                            case 4: {
                                    m.thumbData = r.bytes();
                                    break;
                                }
                            case 6: {
                                    m.matchText = r.string();
                                    break;
                                }
                            case 7: {
                                    m.previewType = r.string();
                                    break;
                                }
                            case 8: {
                                    m.hqThumbnail = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.decode(r, r.uint32());
                                    break;
                                }
                            case 9: {
                                    m.previewMetadata = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.decode(r, r.uint32());
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    LinkPreviewResponse.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse)
                            return d;
                        var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse();
                        if (d.url != null) {
                            m.url = String(d.url);
                        }
                        if (d.title != null) {
                            m.title = String(d.title);
                        }
                        if (d.description != null) {
                            m.description = String(d.description);
                        }
                        if (d.thumbData != null) {
                            if (typeof d.thumbData === "string")
                                $util.base64.decode(d.thumbData, m.thumbData = $util.newBuffer($util.base64.length(d.thumbData)), 0);
                            else if (d.thumbData.length >= 0)
                                m.thumbData = d.thumbData;
                        }
                        if (d.matchText != null) {
                            m.matchText = String(d.matchText);
                        }
                        if (d.previewType != null) {
                            m.previewType = String(d.previewType);
                        }
                        if (d.hqThumbnail != null) {
                            if (typeof d.hqThumbnail !== "object")
                                throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail: object expected");
                            m.hqThumbnail = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.fromObject(d.hqThumbnail);
                        }
                        if (d.previewMetadata != null) {
                            if (typeof d.previewMetadata !== "object")
                                throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.previewMetadata: object expected");
                            m.previewMetadata = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.fromObject(d.previewMetadata);
                        }
                        return m;
                    };

                    LinkPreviewResponse.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.url != null && m.hasOwnProperty("url")) {
                            d.url = m.url;
                            if (o.oneofs)
                                d._url = "url";
                        }
                        if (m.title != null && m.hasOwnProperty("title")) {
                            d.title = m.title;
                            if (o.oneofs)
                                d._title = "title";
                        }
                        if (m.description != null && m.hasOwnProperty("description")) {
                            d.description = m.description;
                            if (o.oneofs)
                                d._description = "description";
                        }
                        if (m.thumbData != null && m.hasOwnProperty("thumbData")) {
                            d.thumbData = o.bytes === String ? $util.base64.encode(m.thumbData, 0, m.thumbData.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbData) : m.thumbData;
                            if (o.oneofs)
                                d._thumbData = "thumbData";
                        }
                        if (m.matchText != null && m.hasOwnProperty("matchText")) {
                            d.matchText = m.matchText;
                            if (o.oneofs)
                                d._matchText = "matchText";
                        }
                        if (m.previewType != null && m.hasOwnProperty("previewType")) {
                            d.previewType = m.previewType;
                            if (o.oneofs)
                                d._previewType = "previewType";
                        }
                        if (m.hqThumbnail != null && m.hasOwnProperty("hqThumbnail")) {
                            d.hqThumbnail = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.toObject(m.hqThumbnail, o);
                            if (o.oneofs)
                                d._hqThumbnail = "hqThumbnail";
                        }
                        if (m.previewMetadata != null && m.hasOwnProperty("previewMetadata")) {
                            d.previewMetadata = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.toObject(m.previewMetadata, o);
                            if (o.oneofs)
                                d._previewMetadata = "previewMetadata";
                        }
                        return d;
                    };

                    LinkPreviewResponse.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    LinkPreviewResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse";
                    };

                    LinkPreviewResponse.LinkPreviewHighQualityThumbnail = (function() {

                        function LinkPreviewHighQualityThumbnail(p) {
                            if (p)
                                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                    if (p[ks[i]] != null)
                                        this[ks[i]] = p[ks[i]];
                        }

                        LinkPreviewHighQualityThumbnail.prototype.directPath = null;
                        LinkPreviewHighQualityThumbnail.prototype.thumbHash = null;
                        LinkPreviewHighQualityThumbnail.prototype.encThumbHash = null;
                        LinkPreviewHighQualityThumbnail.prototype.mediaKey = null;
                        LinkPreviewHighQualityThumbnail.prototype.mediaKeyTimestampMs = null;
                        LinkPreviewHighQualityThumbnail.prototype.thumbWidth = null;
                        LinkPreviewHighQualityThumbnail.prototype.thumbHeight = null;

                        let $oneOfFields;

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_directPath", {
                            get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_thumbHash", {
                            get: $util.oneOfGetter($oneOfFields = ["thumbHash"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_encThumbHash", {
                            get: $util.oneOfGetter($oneOfFields = ["encThumbHash"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_mediaKey", {
                            get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_mediaKeyTimestampMs", {
                            get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestampMs"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_thumbWidth", {
                            get: $util.oneOfGetter($oneOfFields = ["thumbWidth"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_thumbHeight", {
                            get: $util.oneOfGetter($oneOfFields = ["thumbHeight"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        LinkPreviewHighQualityThumbnail.create = function create(properties) {
                            return new LinkPreviewHighQualityThumbnail(properties);
                        };

                        LinkPreviewHighQualityThumbnail.encode = function encode(m, w) {
                            if (!w)
                                w = $Writer.create();
                            if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                                w.uint32(10).string(m.directPath);
                            if (m.thumbHash != null && Object.hasOwnProperty.call(m, "thumbHash"))
                                w.uint32(18).string(m.thumbHash);
                            if (m.encThumbHash != null && Object.hasOwnProperty.call(m, "encThumbHash"))
                                w.uint32(26).string(m.encThumbHash);
                            if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                                w.uint32(34).bytes(m.mediaKey);
                            if (m.mediaKeyTimestampMs != null && Object.hasOwnProperty.call(m, "mediaKeyTimestampMs"))
                                w.uint32(40).int64(m.mediaKeyTimestampMs);
                            if (m.thumbWidth != null && Object.hasOwnProperty.call(m, "thumbWidth"))
                                w.uint32(48).int32(m.thumbWidth);
                            if (m.thumbHeight != null && Object.hasOwnProperty.call(m, "thumbHeight"))
                                w.uint32(56).int32(m.thumbHeight);
                            return w;
                        };

                        LinkPreviewHighQualityThumbnail.decode = function decode(r, l, e) {
                            if (!(r instanceof $Reader))
                                r = $Reader.create(r);
                            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail();
                            while (r.pos < c) {
                                var t = r.uint32();
                                if (t === e)
                                    break;
                                switch (t >>> 3) {
                                case 1: {
                                        m.directPath = r.string();
                                        break;
                                    }
                                case 2: {
                                        m.thumbHash = r.string();
                                        break;
                                    }
                                case 3: {
                                        m.encThumbHash = r.string();
                                        break;
                                    }
                                case 4: {
                                        m.mediaKey = r.bytes();
                                        break;
                                    }
                                case 5: {
                                        m.mediaKeyTimestampMs = r.int64();
                                        break;
                                    }
                                case 6: {
                                        m.thumbWidth = r.int32();
                                        break;
                                    }
                                case 7: {
                                        m.thumbHeight = r.int32();
                                        break;
                                    }
                                default:
                                    r.skipType(t & 7);
                                    break;
                                }
                            }
                            return m;
                        };

                        LinkPreviewHighQualityThumbnail.fromObject = function fromObject(d) {
                            if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail)
                                return d;
                            var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail();
                            if (d.directPath != null) {
                                m.directPath = String(d.directPath);
                            }
                            if (d.thumbHash != null) {
                                m.thumbHash = String(d.thumbHash);
                            }
                            if (d.encThumbHash != null) {
                                m.encThumbHash = String(d.encThumbHash);
                            }
                            if (d.mediaKey != null) {
                                if (typeof d.mediaKey === "string")
                                    $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                                else if (d.mediaKey.length >= 0)
                                    m.mediaKey = d.mediaKey;
                            }
                            if (d.mediaKeyTimestampMs != null) {
                                if ($util.Long)
                                    (m.mediaKeyTimestampMs = $util.Long.fromValue(d.mediaKeyTimestampMs)).unsigned = false;
                                else if (typeof d.mediaKeyTimestampMs === "string")
                                    m.mediaKeyTimestampMs = parseInt(d.mediaKeyTimestampMs, 10);
                                else if (typeof d.mediaKeyTimestampMs === "number")
                                    m.mediaKeyTimestampMs = d.mediaKeyTimestampMs;
                                else if (typeof d.mediaKeyTimestampMs === "object")
                                    m.mediaKeyTimestampMs = new $util.LongBits(d.mediaKeyTimestampMs.low >>> 0, d.mediaKeyTimestampMs.high >>> 0).toNumber();
                            }
                            if (d.thumbWidth != null) {
                                m.thumbWidth = d.thumbWidth | 0;
                            }
                            if (d.thumbHeight != null) {
                                m.thumbHeight = d.thumbHeight | 0;
                            }
                            return m;
                        };

                        LinkPreviewHighQualityThumbnail.toObject = function toObject(m, o) {
                            if (!o)
                                o = {};
                            var d = {};
                            if (m.directPath != null && m.hasOwnProperty("directPath")) {
                                d.directPath = m.directPath;
                                if (o.oneofs)
                                    d._directPath = "directPath";
                            }
                            if (m.thumbHash != null && m.hasOwnProperty("thumbHash")) {
                                d.thumbHash = m.thumbHash;
                                if (o.oneofs)
                                    d._thumbHash = "thumbHash";
                            }
                            if (m.encThumbHash != null && m.hasOwnProperty("encThumbHash")) {
                                d.encThumbHash = m.encThumbHash;
                                if (o.oneofs)
                                    d._encThumbHash = "encThumbHash";
                            }
                            if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                                d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                                if (o.oneofs)
                                    d._mediaKey = "mediaKey";
                            }
                            if (m.mediaKeyTimestampMs != null && m.hasOwnProperty("mediaKeyTimestampMs")) {
                                if (typeof m.mediaKeyTimestampMs === "number")
                                    d.mediaKeyTimestampMs = o.longs === String ? String(m.mediaKeyTimestampMs) : m.mediaKeyTimestampMs;
                                else
                                    d.mediaKeyTimestampMs = o.longs === String ? longToString(m.mediaKeyTimestampMs) : o.longs === Number ? longToNumber(m.mediaKeyTimestampMs) : m.mediaKeyTimestampMs;
                                if (o.oneofs)
                                    d._mediaKeyTimestampMs = "mediaKeyTimestampMs";
                            }
                            if (m.thumbWidth != null && m.hasOwnProperty("thumbWidth")) {
                                d.thumbWidth = m.thumbWidth;
                                if (o.oneofs)
                                    d._thumbWidth = "thumbWidth";
                            }
                            if (m.thumbHeight != null && m.hasOwnProperty("thumbHeight")) {
                                d.thumbHeight = m.thumbHeight;
                                if (o.oneofs)
                                    d._thumbHeight = "thumbHeight";
                            }
                            return d;
                        };

                        LinkPreviewHighQualityThumbnail.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };

                        LinkPreviewHighQualityThumbnail.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail";
                        };

                        return LinkPreviewHighQualityThumbnail;
                    })();

                    LinkPreviewResponse.PaymentLinkPreviewMetadata = (function() {

                        function PaymentLinkPreviewMetadata(p) {
                            if (p)
                                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                    if (p[ks[i]] != null)
                                        this[ks[i]] = p[ks[i]];
                        }

                        PaymentLinkPreviewMetadata.prototype.isBusinessVerified = null;
                        PaymentLinkPreviewMetadata.prototype.providerName = null;

                        let $oneOfFields;

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(PaymentLinkPreviewMetadata.prototype, "_isBusinessVerified", {
                            get: $util.oneOfGetter($oneOfFields = ["isBusinessVerified"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        // Virtual OneOf for proto3 optional field
                        Object.defineProperty(PaymentLinkPreviewMetadata.prototype, "_providerName", {
                            get: $util.oneOfGetter($oneOfFields = ["providerName"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });

                        PaymentLinkPreviewMetadata.create = function create(properties) {
                            return new PaymentLinkPreviewMetadata(properties);
                        };

                        PaymentLinkPreviewMetadata.encode = function encode(m, w) {
                            if (!w)
                                w = $Writer.create();
                            if (m.isBusinessVerified != null && Object.hasOwnProperty.call(m, "isBusinessVerified"))
                                w.uint32(8).bool(m.isBusinessVerified);
                            if (m.providerName != null && Object.hasOwnProperty.call(m, "providerName"))
                                w.uint32(18).string(m.providerName);
                            return w;
                        };

                        PaymentLinkPreviewMetadata.decode = function decode(r, l, e) {
                            if (!(r instanceof $Reader))
                                r = $Reader.create(r);
                            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata();
                            while (r.pos < c) {
                                var t = r.uint32();
                                if (t === e)
                                    break;
                                switch (t >>> 3) {
                                case 1: {
                                        m.isBusinessVerified = r.bool();
                                        break;
                                    }
                                case 2: {
                                        m.providerName = r.string();
                                        break;
                                    }
                                default:
                                    r.skipType(t & 7);
                                    break;
                                }
                            }
                            return m;
                        };

                        PaymentLinkPreviewMetadata.fromObject = function fromObject(d) {
                            if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata)
                                return d;
                            var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata();
                            if (d.isBusinessVerified != null) {
                                m.isBusinessVerified = Boolean(d.isBusinessVerified);
                            }
                            if (d.providerName != null) {
                                m.providerName = String(d.providerName);
                            }
                            return m;
                        };

                        PaymentLinkPreviewMetadata.toObject = function toObject(m, o) {
                            if (!o)
                                o = {};
                            var d = {};
                            if (m.isBusinessVerified != null && m.hasOwnProperty("isBusinessVerified")) {
                                d.isBusinessVerified = m.isBusinessVerified;
                                if (o.oneofs)
                                    d._isBusinessVerified = "isBusinessVerified";
                            }
                            if (m.providerName != null && m.hasOwnProperty("providerName")) {
                                d.providerName = m.providerName;
                                if (o.oneofs)
                                    d._providerName = "providerName";
                            }
                            return d;
                        };

                        PaymentLinkPreviewMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };

                        PaymentLinkPreviewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata";
                        };

                        return PaymentLinkPreviewMetadata;
                    })();

                    return LinkPreviewResponse;
                })();

                PeerDataOperationResult.PlaceholderMessageResendResponse = (function() {

                    function PlaceholderMessageResendResponse(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    PlaceholderMessageResendResponse.prototype.webMessageInfoBytes = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(PlaceholderMessageResendResponse.prototype, "_webMessageInfoBytes", {
                        get: $util.oneOfGetter($oneOfFields = ["webMessageInfoBytes"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    PlaceholderMessageResendResponse.create = function create(properties) {
                        return new PlaceholderMessageResendResponse(properties);
                    };

                    PlaceholderMessageResendResponse.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.webMessageInfoBytes != null && Object.hasOwnProperty.call(m, "webMessageInfoBytes"))
                            w.uint32(10).bytes(m.webMessageInfoBytes);
                        return w;
                    };

                    PlaceholderMessageResendResponse.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.webMessageInfoBytes = r.bytes();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    PlaceholderMessageResendResponse.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse)
                            return d;
                        var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse();
                        if (d.webMessageInfoBytes != null) {
                            if (typeof d.webMessageInfoBytes === "string")
                                $util.base64.decode(d.webMessageInfoBytes, m.webMessageInfoBytes = $util.newBuffer($util.base64.length(d.webMessageInfoBytes)), 0);
                            else if (d.webMessageInfoBytes.length >= 0)
                                m.webMessageInfoBytes = d.webMessageInfoBytes;
                        }
                        return m;
                    };

                    PlaceholderMessageResendResponse.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.webMessageInfoBytes != null && m.hasOwnProperty("webMessageInfoBytes")) {
                            d.webMessageInfoBytes = o.bytes === String ? $util.base64.encode(m.webMessageInfoBytes, 0, m.webMessageInfoBytes.length) : o.bytes === Array ? Array.prototype.slice.call(m.webMessageInfoBytes) : m.webMessageInfoBytes;
                            if (o.oneofs)
                                d._webMessageInfoBytes = "webMessageInfoBytes";
                        }
                        return d;
                    };

                    PlaceholderMessageResendResponse.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    PlaceholderMessageResendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse";
                    };

                    return PlaceholderMessageResendResponse;
                })();

                PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse = (function() {

                    function SyncDSnapshotFatalRecoveryResponse(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    SyncDSnapshotFatalRecoveryResponse.prototype.collectionSnapshot = null;
                    SyncDSnapshotFatalRecoveryResponse.prototype.isCompressed = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(SyncDSnapshotFatalRecoveryResponse.prototype, "_collectionSnapshot", {
                        get: $util.oneOfGetter($oneOfFields = ["collectionSnapshot"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(SyncDSnapshotFatalRecoveryResponse.prototype, "_isCompressed", {
                        get: $util.oneOfGetter($oneOfFields = ["isCompressed"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    SyncDSnapshotFatalRecoveryResponse.create = function create(properties) {
                        return new SyncDSnapshotFatalRecoveryResponse(properties);
                    };

                    SyncDSnapshotFatalRecoveryResponse.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.collectionSnapshot != null && Object.hasOwnProperty.call(m, "collectionSnapshot"))
                            w.uint32(10).bytes(m.collectionSnapshot);
                        if (m.isCompressed != null && Object.hasOwnProperty.call(m, "isCompressed"))
                            w.uint32(16).bool(m.isCompressed);
                        return w;
                    };

                    SyncDSnapshotFatalRecoveryResponse.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.collectionSnapshot = r.bytes();
                                    break;
                                }
                            case 2: {
                                    m.isCompressed = r.bool();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    SyncDSnapshotFatalRecoveryResponse.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse)
                            return d;
                        var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse();
                        if (d.collectionSnapshot != null) {
                            if (typeof d.collectionSnapshot === "string")
                                $util.base64.decode(d.collectionSnapshot, m.collectionSnapshot = $util.newBuffer($util.base64.length(d.collectionSnapshot)), 0);
                            else if (d.collectionSnapshot.length >= 0)
                                m.collectionSnapshot = d.collectionSnapshot;
                        }
                        if (d.isCompressed != null) {
                            m.isCompressed = Boolean(d.isCompressed);
                        }
                        return m;
                    };

                    SyncDSnapshotFatalRecoveryResponse.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.collectionSnapshot != null && m.hasOwnProperty("collectionSnapshot")) {
                            d.collectionSnapshot = o.bytes === String ? $util.base64.encode(m.collectionSnapshot, 0, m.collectionSnapshot.length) : o.bytes === Array ? Array.prototype.slice.call(m.collectionSnapshot) : m.collectionSnapshot;
                            if (o.oneofs)
                                d._collectionSnapshot = "collectionSnapshot";
                        }
                        if (m.isCompressed != null && m.hasOwnProperty("isCompressed")) {
                            d.isCompressed = m.isCompressed;
                            if (o.oneofs)
                                d._isCompressed = "isCompressed";
                        }
                        return d;
                    };

                    SyncDSnapshotFatalRecoveryResponse.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    SyncDSnapshotFatalRecoveryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse";
                    };

                    return SyncDSnapshotFatalRecoveryResponse;
                })();

                PeerDataOperationResult.WaffleNonceFetchResponse = (function() {

                    function WaffleNonceFetchResponse(p) {
                        if (p)
                            for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                                if (p[ks[i]] != null)
                                    this[ks[i]] = p[ks[i]];
                    }

                    WaffleNonceFetchResponse.prototype.nonce = null;
                    WaffleNonceFetchResponse.prototype.waEntFbid = null;

                    let $oneOfFields;

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(WaffleNonceFetchResponse.prototype, "_nonce", {
                        get: $util.oneOfGetter($oneOfFields = ["nonce"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    // Virtual OneOf for proto3 optional field
                    Object.defineProperty(WaffleNonceFetchResponse.prototype, "_waEntFbid", {
                        get: $util.oneOfGetter($oneOfFields = ["waEntFbid"]),
                        set: $util.oneOfSetter($oneOfFields)
                    });

                    WaffleNonceFetchResponse.create = function create(properties) {
                        return new WaffleNonceFetchResponse(properties);
                    };

                    WaffleNonceFetchResponse.encode = function encode(m, w) {
                        if (!w)
                            w = $Writer.create();
                        if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce"))
                            w.uint32(10).string(m.nonce);
                        if (m.waEntFbid != null && Object.hasOwnProperty.call(m, "waEntFbid"))
                            w.uint32(18).string(m.waEntFbid);
                        return w;
                    };

                    WaffleNonceFetchResponse.decode = function decode(r, l, e) {
                        if (!(r instanceof $Reader))
                            r = $Reader.create(r);
                        var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse();
                        while (r.pos < c) {
                            var t = r.uint32();
                            if (t === e)
                                break;
                            switch (t >>> 3) {
                            case 1: {
                                    m.nonce = r.string();
                                    break;
                                }
                            case 2: {
                                    m.waEntFbid = r.string();
                                    break;
                                }
                            default:
                                r.skipType(t & 7);
                                break;
                            }
                        }
                        return m;
                    };

                    WaffleNonceFetchResponse.fromObject = function fromObject(d) {
                        if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse)
                            return d;
                        var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse();
                        if (d.nonce != null) {
                            m.nonce = String(d.nonce);
                        }
                        if (d.waEntFbid != null) {
                            m.waEntFbid = String(d.waEntFbid);
                        }
                        return m;
                    };

                    WaffleNonceFetchResponse.toObject = function toObject(m, o) {
                        if (!o)
                            o = {};
                        var d = {};
                        if (m.nonce != null && m.hasOwnProperty("nonce")) {
                            d.nonce = m.nonce;
                            if (o.oneofs)
                                d._nonce = "nonce";
                        }
                        if (m.waEntFbid != null && m.hasOwnProperty("waEntFbid")) {
                            d.waEntFbid = m.waEntFbid;
                            if (o.oneofs)
                                d._waEntFbid = "waEntFbid";
                        }
                        return d;
                    };

                    WaffleNonceFetchResponse.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };

                    WaffleNonceFetchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse";
                    };

                    return WaffleNonceFetchResponse;
                })();

                return PeerDataOperationResult;
            })();

            return PeerDataOperationRequestResponseMessage;
        })();

        Message.PeerDataOperationRequestType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UPLOAD_STICKER"] = 0;
            values[valuesById[1] = "SEND_RECENT_STICKER_BOOTSTRAP"] = 1;
            values[valuesById[2] = "GENERATE_LINK_PREVIEW"] = 2;
            values[valuesById[3] = "HISTORY_SYNC_ON_DEMAND"] = 3;
            values[valuesById[4] = "PLACEHOLDER_MESSAGE_RESEND"] = 4;
            values[valuesById[5] = "WAFFLE_LINKING_NONCE_FETCH"] = 5;
            values[valuesById[6] = "FULL_HISTORY_SYNC_ON_DEMAND"] = 6;
            values[valuesById[7] = "COMPANION_META_NONCE_FETCH"] = 7;
            values[valuesById[8] = "COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY"] = 8;
            values[valuesById[9] = "COMPANION_CANONICAL_USER_NONCE_FETCH"] = 9;
            values[valuesById[10] = "HISTORY_SYNC_CHUNK_RETRY"] = 10;
            values[valuesById[11] = "GALAXY_FLOW_ACTION"] = 11;
            return values;
        })();

        Message.PinInChatMessage = (function() {

            function PinInChatMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PinInChatMessage.prototype.key = null;
            PinInChatMessage.prototype.type = null;
            PinInChatMessage.prototype.senderTimestampMs = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PinInChatMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PinInChatMessage.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PinInChatMessage.prototype, "_senderTimestampMs", {
                get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PinInChatMessage.create = function create(properties) {
                return new PinInChatMessage(properties);
            };

            PinInChatMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(16).int32(m.type);
                if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
                    w.uint32(24).int64(m.senderTimestampMs);
                return w;
            };

            PinInChatMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PinInChatMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.type = r.int32();
                            break;
                        }
                    case 3: {
                            m.senderTimestampMs = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PinInChatMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PinInChatMessage)
                    return d;
                var m = new $root.proto.Message.PinInChatMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.PinInChatMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "UNKNOWN_TYPE":
                case 0:
                    m.type = 0;
                    break;
                case "PIN_FOR_ALL":
                case 1:
                    m.type = 1;
                    break;
                case "UNPIN_FOR_ALL":
                case 2:
                    m.type = 2;
                    break;
                }
                if (d.senderTimestampMs != null) {
                    if ($util.Long)
                        (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
                    else if (typeof d.senderTimestampMs === "string")
                        m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
                    else if (typeof d.senderTimestampMs === "number")
                        m.senderTimestampMs = d.senderTimestampMs;
                    else if (typeof d.senderTimestampMs === "object")
                        m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
                }
                return m;
            };

            PinInChatMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.Message.PinInChatMessage.Type[m.type] === undefined ? m.type : $root.proto.Message.PinInChatMessage.Type[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
                    if (typeof m.senderTimestampMs === "number")
                        d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
                    else
                        d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
                    if (o.oneofs)
                        d._senderTimestampMs = "senderTimestampMs";
                }
                return d;
            };

            PinInChatMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PinInChatMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PinInChatMessage";
            };

            PinInChatMessage.Type = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN_TYPE"] = 0;
                values[valuesById[1] = "PIN_FOR_ALL"] = 1;
                values[valuesById[2] = "UNPIN_FOR_ALL"] = 2;
                return values;
            })();

            return PinInChatMessage;
        })();

        Message.PlaceholderMessage = (function() {

            function PlaceholderMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PlaceholderMessage.prototype.type = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PlaceholderMessage.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PlaceholderMessage.create = function create(properties) {
                return new PlaceholderMessage(properties);
            };

            PlaceholderMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(8).int32(m.type);
                return w;
            };

            PlaceholderMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PlaceholderMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.type = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PlaceholderMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PlaceholderMessage)
                    return d;
                var m = new $root.proto.Message.PlaceholderMessage();
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "MASK_LINKED_DEVICES":
                case 0:
                    m.type = 0;
                    break;
                }
                return m;
            };

            PlaceholderMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.Message.PlaceholderMessage.PlaceholderType[m.type] === undefined ? m.type : $root.proto.Message.PlaceholderMessage.PlaceholderType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                return d;
            };

            PlaceholderMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PlaceholderMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PlaceholderMessage";
            };

            PlaceholderMessage.PlaceholderType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "MASK_LINKED_DEVICES"] = 0;
                return values;
            })();

            return PlaceholderMessage;
        })();

        Message.PollContentType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "TEXT"] = 1;
            values[valuesById[2] = "IMAGE"] = 2;
            return values;
        })();

        Message.PollCreationMessage = (function() {

            function PollCreationMessage(p) {
                this.options = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollCreationMessage.prototype.encKey = null;
            PollCreationMessage.prototype.name = null;
            PollCreationMessage.prototype.options = $util.emptyArray;
            PollCreationMessage.prototype.selectableOptionsCount = null;
            PollCreationMessage.prototype.contextInfo = null;
            PollCreationMessage.prototype.pollContentType = null;
            PollCreationMessage.prototype.pollType = null;
            PollCreationMessage.prototype.correctAnswer = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollCreationMessage.prototype, "_encKey", {
                get: $util.oneOfGetter($oneOfFields = ["encKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollCreationMessage.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollCreationMessage.prototype, "_selectableOptionsCount", {
                get: $util.oneOfGetter($oneOfFields = ["selectableOptionsCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollCreationMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollCreationMessage.prototype, "_pollContentType", {
                get: $util.oneOfGetter($oneOfFields = ["pollContentType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollCreationMessage.prototype, "_pollType", {
                get: $util.oneOfGetter($oneOfFields = ["pollType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollCreationMessage.prototype, "_correctAnswer", {
                get: $util.oneOfGetter($oneOfFields = ["correctAnswer"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PollCreationMessage.create = function create(properties) {
                return new PollCreationMessage(properties);
            };

            PollCreationMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.encKey != null && Object.hasOwnProperty.call(m, "encKey"))
                    w.uint32(10).bytes(m.encKey);
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(18).string(m.name);
                if (m.options != null && m.options.length) {
                    for (var i = 0; i < m.options.length; ++i)
                        $root.proto.Message.PollCreationMessage.Option.encode(m.options[i], w.uint32(26).fork()).ldelim();
                }
                if (m.selectableOptionsCount != null && Object.hasOwnProperty.call(m, "selectableOptionsCount"))
                    w.uint32(32).uint32(m.selectableOptionsCount);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(42).fork()).ldelim();
                if (m.pollContentType != null && Object.hasOwnProperty.call(m, "pollContentType"))
                    w.uint32(48).int32(m.pollContentType);
                if (m.pollType != null && Object.hasOwnProperty.call(m, "pollType"))
                    w.uint32(56).int32(m.pollType);
                if (m.correctAnswer != null && Object.hasOwnProperty.call(m, "correctAnswer"))
                    $root.proto.Message.PollCreationMessage.Option.encode(m.correctAnswer, w.uint32(66).fork()).ldelim();
                return w;
            };

            PollCreationMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollCreationMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.encKey = r.bytes();
                            break;
                        }
                    case 2: {
                            m.name = r.string();
                            break;
                        }
                    case 3: {
                            if (!(m.options && m.options.length))
                                m.options = [];
                            m.options.push($root.proto.Message.PollCreationMessage.Option.decode(r, r.uint32()));
                            break;
                        }
                    case 4: {
                            m.selectableOptionsCount = r.uint32();
                            break;
                        }
                    case 5: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 6: {
                            m.pollContentType = r.int32();
                            break;
                        }
                    case 7: {
                            m.pollType = r.int32();
                            break;
                        }
                    case 8: {
                            m.correctAnswer = $root.proto.Message.PollCreationMessage.Option.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollCreationMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PollCreationMessage)
                    return d;
                var m = new $root.proto.Message.PollCreationMessage();
                if (d.encKey != null) {
                    if (typeof d.encKey === "string")
                        $util.base64.decode(d.encKey, m.encKey = $util.newBuffer($util.base64.length(d.encKey)), 0);
                    else if (d.encKey.length >= 0)
                        m.encKey = d.encKey;
                }
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.options) {
                    if (!Array.isArray(d.options))
                        throw TypeError(".proto.Message.PollCreationMessage.options: array expected");
                    m.options = [];
                    for (var i = 0; i < d.options.length; ++i) {
                        if (typeof d.options[i] !== "object")
                            throw TypeError(".proto.Message.PollCreationMessage.options: object expected");
                        m.options[i] = $root.proto.Message.PollCreationMessage.Option.fromObject(d.options[i]);
                    }
                }
                if (d.selectableOptionsCount != null) {
                    m.selectableOptionsCount = d.selectableOptionsCount >>> 0;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.PollCreationMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                switch (d.pollContentType) {
                default:
                    if (typeof d.pollContentType === "number") {
                        m.pollContentType = d.pollContentType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.pollContentType = 0;
                    break;
                case "TEXT":
                case 1:
                    m.pollContentType = 1;
                    break;
                case "IMAGE":
                case 2:
                    m.pollContentType = 2;
                    break;
                }
                switch (d.pollType) {
                default:
                    if (typeof d.pollType === "number") {
                        m.pollType = d.pollType;
                        break;
                    }
                    break;
                case "POLL":
                case 0:
                    m.pollType = 0;
                    break;
                case "QUIZ":
                case 1:
                    m.pollType = 1;
                    break;
                }
                if (d.correctAnswer != null) {
                    if (typeof d.correctAnswer !== "object")
                        throw TypeError(".proto.Message.PollCreationMessage.correctAnswer: object expected");
                    m.correctAnswer = $root.proto.Message.PollCreationMessage.Option.fromObject(d.correctAnswer);
                }
                return m;
            };

            PollCreationMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.options = [];
                }
                if (m.encKey != null && m.hasOwnProperty("encKey")) {
                    d.encKey = o.bytes === String ? $util.base64.encode(m.encKey, 0, m.encKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.encKey) : m.encKey;
                    if (o.oneofs)
                        d._encKey = "encKey";
                }
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.options && m.options.length) {
                    d.options = [];
                    for (var j = 0; j < m.options.length; ++j) {
                        d.options[j] = $root.proto.Message.PollCreationMessage.Option.toObject(m.options[j], o);
                    }
                }
                if (m.selectableOptionsCount != null && m.hasOwnProperty("selectableOptionsCount")) {
                    d.selectableOptionsCount = m.selectableOptionsCount;
                    if (o.oneofs)
                        d._selectableOptionsCount = "selectableOptionsCount";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.pollContentType != null && m.hasOwnProperty("pollContentType")) {
                    d.pollContentType = o.enums === String ? $root.proto.Message.PollContentType[m.pollContentType] === undefined ? m.pollContentType : $root.proto.Message.PollContentType[m.pollContentType] : m.pollContentType;
                    if (o.oneofs)
                        d._pollContentType = "pollContentType";
                }
                if (m.pollType != null && m.hasOwnProperty("pollType")) {
                    d.pollType = o.enums === String ? $root.proto.Message.PollType[m.pollType] === undefined ? m.pollType : $root.proto.Message.PollType[m.pollType] : m.pollType;
                    if (o.oneofs)
                        d._pollType = "pollType";
                }
                if (m.correctAnswer != null && m.hasOwnProperty("correctAnswer")) {
                    d.correctAnswer = $root.proto.Message.PollCreationMessage.Option.toObject(m.correctAnswer, o);
                    if (o.oneofs)
                        d._correctAnswer = "correctAnswer";
                }
                return d;
            };

            PollCreationMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollCreationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PollCreationMessage";
            };

            PollCreationMessage.Option = (function() {

                function Option(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Option.prototype.optionName = null;
                Option.prototype.optionHash = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Option.prototype, "_optionName", {
                    get: $util.oneOfGetter($oneOfFields = ["optionName"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Option.prototype, "_optionHash", {
                    get: $util.oneOfGetter($oneOfFields = ["optionHash"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Option.create = function create(properties) {
                    return new Option(properties);
                };

                Option.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.optionName != null && Object.hasOwnProperty.call(m, "optionName"))
                        w.uint32(10).string(m.optionName);
                    if (m.optionHash != null && Object.hasOwnProperty.call(m, "optionHash"))
                        w.uint32(18).string(m.optionHash);
                    return w;
                };

                Option.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollCreationMessage.Option();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.optionName = r.string();
                                break;
                            }
                        case 2: {
                                m.optionHash = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Option.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PollCreationMessage.Option)
                        return d;
                    var m = new $root.proto.Message.PollCreationMessage.Option();
                    if (d.optionName != null) {
                        m.optionName = String(d.optionName);
                    }
                    if (d.optionHash != null) {
                        m.optionHash = String(d.optionHash);
                    }
                    return m;
                };

                Option.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.optionName != null && m.hasOwnProperty("optionName")) {
                        d.optionName = m.optionName;
                        if (o.oneofs)
                            d._optionName = "optionName";
                    }
                    if (m.optionHash != null && m.hasOwnProperty("optionHash")) {
                        d.optionHash = m.optionHash;
                        if (o.oneofs)
                            d._optionHash = "optionHash";
                    }
                    return d;
                };

                Option.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Option.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PollCreationMessage.Option";
                };

                return Option;
            })();

            return PollCreationMessage;
        })();

        Message.PollEncValue = (function() {

            function PollEncValue(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollEncValue.prototype.encPayload = null;
            PollEncValue.prototype.encIv = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollEncValue.prototype, "_encPayload", {
                get: $util.oneOfGetter($oneOfFields = ["encPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollEncValue.prototype, "_encIv", {
                get: $util.oneOfGetter($oneOfFields = ["encIv"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PollEncValue.create = function create(properties) {
                return new PollEncValue(properties);
            };

            PollEncValue.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.encPayload != null && Object.hasOwnProperty.call(m, "encPayload"))
                    w.uint32(10).bytes(m.encPayload);
                if (m.encIv != null && Object.hasOwnProperty.call(m, "encIv"))
                    w.uint32(18).bytes(m.encIv);
                return w;
            };

            PollEncValue.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollEncValue();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.encPayload = r.bytes();
                            break;
                        }
                    case 2: {
                            m.encIv = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollEncValue.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PollEncValue)
                    return d;
                var m = new $root.proto.Message.PollEncValue();
                if (d.encPayload != null) {
                    if (typeof d.encPayload === "string")
                        $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0);
                    else if (d.encPayload.length >= 0)
                        m.encPayload = d.encPayload;
                }
                if (d.encIv != null) {
                    if (typeof d.encIv === "string")
                        $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0);
                    else if (d.encIv.length >= 0)
                        m.encIv = d.encIv;
                }
                return m;
            };

            PollEncValue.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.encPayload != null && m.hasOwnProperty("encPayload")) {
                    d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload;
                    if (o.oneofs)
                        d._encPayload = "encPayload";
                }
                if (m.encIv != null && m.hasOwnProperty("encIv")) {
                    d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv;
                    if (o.oneofs)
                        d._encIv = "encIv";
                }
                return d;
            };

            PollEncValue.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollEncValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PollEncValue";
            };

            return PollEncValue;
        })();

        Message.PollResultSnapshotMessage = (function() {

            function PollResultSnapshotMessage(p) {
                this.pollVotes = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollResultSnapshotMessage.prototype.name = null;
            PollResultSnapshotMessage.prototype.pollVotes = $util.emptyArray;
            PollResultSnapshotMessage.prototype.contextInfo = null;
            PollResultSnapshotMessage.prototype.pollType = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollResultSnapshotMessage.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollResultSnapshotMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollResultSnapshotMessage.prototype, "_pollType", {
                get: $util.oneOfGetter($oneOfFields = ["pollType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PollResultSnapshotMessage.create = function create(properties) {
                return new PollResultSnapshotMessage(properties);
            };

            PollResultSnapshotMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(10).string(m.name);
                if (m.pollVotes != null && m.pollVotes.length) {
                    for (var i = 0; i < m.pollVotes.length; ++i)
                        $root.proto.Message.PollResultSnapshotMessage.PollVote.encode(m.pollVotes[i], w.uint32(18).fork()).ldelim();
                }
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(26).fork()).ldelim();
                if (m.pollType != null && Object.hasOwnProperty.call(m, "pollType"))
                    w.uint32(32).int32(m.pollType);
                return w;
            };

            PollResultSnapshotMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollResultSnapshotMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.name = r.string();
                            break;
                        }
                    case 2: {
                            if (!(m.pollVotes && m.pollVotes.length))
                                m.pollVotes = [];
                            m.pollVotes.push($root.proto.Message.PollResultSnapshotMessage.PollVote.decode(r, r.uint32()));
                            break;
                        }
                    case 3: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.pollType = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollResultSnapshotMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PollResultSnapshotMessage)
                    return d;
                var m = new $root.proto.Message.PollResultSnapshotMessage();
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.pollVotes) {
                    if (!Array.isArray(d.pollVotes))
                        throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: array expected");
                    m.pollVotes = [];
                    for (var i = 0; i < d.pollVotes.length; ++i) {
                        if (typeof d.pollVotes[i] !== "object")
                            throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: object expected");
                        m.pollVotes[i] = $root.proto.Message.PollResultSnapshotMessage.PollVote.fromObject(d.pollVotes[i]);
                    }
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.PollResultSnapshotMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                switch (d.pollType) {
                default:
                    if (typeof d.pollType === "number") {
                        m.pollType = d.pollType;
                        break;
                    }
                    break;
                case "POLL":
                case 0:
                    m.pollType = 0;
                    break;
                case "QUIZ":
                case 1:
                    m.pollType = 1;
                    break;
                }
                return m;
            };

            PollResultSnapshotMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.pollVotes = [];
                }
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.pollVotes && m.pollVotes.length) {
                    d.pollVotes = [];
                    for (var j = 0; j < m.pollVotes.length; ++j) {
                        d.pollVotes[j] = $root.proto.Message.PollResultSnapshotMessage.PollVote.toObject(m.pollVotes[j], o);
                    }
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.pollType != null && m.hasOwnProperty("pollType")) {
                    d.pollType = o.enums === String ? $root.proto.Message.PollType[m.pollType] === undefined ? m.pollType : $root.proto.Message.PollType[m.pollType] : m.pollType;
                    if (o.oneofs)
                        d._pollType = "pollType";
                }
                return d;
            };

            PollResultSnapshotMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollResultSnapshotMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PollResultSnapshotMessage";
            };

            PollResultSnapshotMessage.PollVote = (function() {

                function PollVote(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                PollVote.prototype.optionName = null;
                PollVote.prototype.optionVoteCount = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PollVote.prototype, "_optionName", {
                    get: $util.oneOfGetter($oneOfFields = ["optionName"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(PollVote.prototype, "_optionVoteCount", {
                    get: $util.oneOfGetter($oneOfFields = ["optionVoteCount"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                PollVote.create = function create(properties) {
                    return new PollVote(properties);
                };

                PollVote.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.optionName != null && Object.hasOwnProperty.call(m, "optionName"))
                        w.uint32(10).string(m.optionName);
                    if (m.optionVoteCount != null && Object.hasOwnProperty.call(m, "optionVoteCount"))
                        w.uint32(16).int64(m.optionVoteCount);
                    return w;
                };

                PollVote.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollResultSnapshotMessage.PollVote();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.optionName = r.string();
                                break;
                            }
                        case 2: {
                                m.optionVoteCount = r.int64();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                PollVote.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.PollResultSnapshotMessage.PollVote)
                        return d;
                    var m = new $root.proto.Message.PollResultSnapshotMessage.PollVote();
                    if (d.optionName != null) {
                        m.optionName = String(d.optionName);
                    }
                    if (d.optionVoteCount != null) {
                        if ($util.Long)
                            (m.optionVoteCount = $util.Long.fromValue(d.optionVoteCount)).unsigned = false;
                        else if (typeof d.optionVoteCount === "string")
                            m.optionVoteCount = parseInt(d.optionVoteCount, 10);
                        else if (typeof d.optionVoteCount === "number")
                            m.optionVoteCount = d.optionVoteCount;
                        else if (typeof d.optionVoteCount === "object")
                            m.optionVoteCount = new $util.LongBits(d.optionVoteCount.low >>> 0, d.optionVoteCount.high >>> 0).toNumber();
                    }
                    return m;
                };

                PollVote.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.optionName != null && m.hasOwnProperty("optionName")) {
                        d.optionName = m.optionName;
                        if (o.oneofs)
                            d._optionName = "optionName";
                    }
                    if (m.optionVoteCount != null && m.hasOwnProperty("optionVoteCount")) {
                        if (typeof m.optionVoteCount === "number")
                            d.optionVoteCount = o.longs === String ? String(m.optionVoteCount) : m.optionVoteCount;
                        else
                            d.optionVoteCount = o.longs === String ? longToString(m.optionVoteCount) : o.longs === Number ? longToNumber(m.optionVoteCount) : m.optionVoteCount;
                        if (o.oneofs)
                            d._optionVoteCount = "optionVoteCount";
                    }
                    return d;
                };

                PollVote.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                PollVote.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.PollResultSnapshotMessage.PollVote";
                };

                return PollVote;
            })();

            return PollResultSnapshotMessage;
        })();

        Message.PollType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "POLL"] = 0;
            values[valuesById[1] = "QUIZ"] = 1;
            return values;
        })();

        Message.PollUpdateMessage = (function() {

            function PollUpdateMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollUpdateMessage.prototype.pollCreationMessageKey = null;
            PollUpdateMessage.prototype.vote = null;
            PollUpdateMessage.prototype.metadata = null;
            PollUpdateMessage.prototype.senderTimestampMs = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollUpdateMessage.prototype, "_pollCreationMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollUpdateMessage.prototype, "_vote", {
                get: $util.oneOfGetter($oneOfFields = ["vote"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollUpdateMessage.prototype, "_metadata", {
                get: $util.oneOfGetter($oneOfFields = ["metadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollUpdateMessage.prototype, "_senderTimestampMs", {
                get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PollUpdateMessage.create = function create(properties) {
                return new PollUpdateMessage(properties);
            };

            PollUpdateMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.pollCreationMessageKey != null && Object.hasOwnProperty.call(m, "pollCreationMessageKey"))
                    $root.proto.MessageKey.encode(m.pollCreationMessageKey, w.uint32(10).fork()).ldelim();
                if (m.vote != null && Object.hasOwnProperty.call(m, "vote"))
                    $root.proto.Message.PollEncValue.encode(m.vote, w.uint32(18).fork()).ldelim();
                if (m.metadata != null && Object.hasOwnProperty.call(m, "metadata"))
                    $root.proto.Message.PollUpdateMessageMetadata.encode(m.metadata, w.uint32(26).fork()).ldelim();
                if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
                    w.uint32(32).int64(m.senderTimestampMs);
                return w;
            };

            PollUpdateMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollUpdateMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.pollCreationMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.vote = $root.proto.Message.PollEncValue.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.metadata = $root.proto.Message.PollUpdateMessageMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.senderTimestampMs = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollUpdateMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PollUpdateMessage)
                    return d;
                var m = new $root.proto.Message.PollUpdateMessage();
                if (d.pollCreationMessageKey != null) {
                    if (typeof d.pollCreationMessageKey !== "object")
                        throw TypeError(".proto.Message.PollUpdateMessage.pollCreationMessageKey: object expected");
                    m.pollCreationMessageKey = $root.proto.MessageKey.fromObject(d.pollCreationMessageKey);
                }
                if (d.vote != null) {
                    if (typeof d.vote !== "object")
                        throw TypeError(".proto.Message.PollUpdateMessage.vote: object expected");
                    m.vote = $root.proto.Message.PollEncValue.fromObject(d.vote);
                }
                if (d.metadata != null) {
                    if (typeof d.metadata !== "object")
                        throw TypeError(".proto.Message.PollUpdateMessage.metadata: object expected");
                    m.metadata = $root.proto.Message.PollUpdateMessageMetadata.fromObject(d.metadata);
                }
                if (d.senderTimestampMs != null) {
                    if ($util.Long)
                        (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
                    else if (typeof d.senderTimestampMs === "string")
                        m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
                    else if (typeof d.senderTimestampMs === "number")
                        m.senderTimestampMs = d.senderTimestampMs;
                    else if (typeof d.senderTimestampMs === "object")
                        m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
                }
                return m;
            };

            PollUpdateMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.pollCreationMessageKey != null && m.hasOwnProperty("pollCreationMessageKey")) {
                    d.pollCreationMessageKey = $root.proto.MessageKey.toObject(m.pollCreationMessageKey, o);
                    if (o.oneofs)
                        d._pollCreationMessageKey = "pollCreationMessageKey";
                }
                if (m.vote != null && m.hasOwnProperty("vote")) {
                    d.vote = $root.proto.Message.PollEncValue.toObject(m.vote, o);
                    if (o.oneofs)
                        d._vote = "vote";
                }
                if (m.metadata != null && m.hasOwnProperty("metadata")) {
                    d.metadata = $root.proto.Message.PollUpdateMessageMetadata.toObject(m.metadata, o);
                    if (o.oneofs)
                        d._metadata = "metadata";
                }
                if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
                    if (typeof m.senderTimestampMs === "number")
                        d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
                    else
                        d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
                    if (o.oneofs)
                        d._senderTimestampMs = "senderTimestampMs";
                }
                return d;
            };

            PollUpdateMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollUpdateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PollUpdateMessage";
            };

            return PollUpdateMessage;
        })();

        Message.PollUpdateMessageMetadata = (function() {

            function PollUpdateMessageMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollUpdateMessageMetadata.create = function create(properties) {
                return new PollUpdateMessageMetadata(properties);
            };

            PollUpdateMessageMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                return w;
            };

            PollUpdateMessageMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollUpdateMessageMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollUpdateMessageMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PollUpdateMessageMetadata)
                    return d;
                return new $root.proto.Message.PollUpdateMessageMetadata();
            };

            PollUpdateMessageMetadata.toObject = function toObject() {
                return {};
            };

            PollUpdateMessageMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollUpdateMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PollUpdateMessageMetadata";
            };

            return PollUpdateMessageMetadata;
        })();

        Message.PollVoteMessage = (function() {

            function PollVoteMessage(p) {
                this.selectedOptions = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollVoteMessage.prototype.selectedOptions = $util.emptyArray;

            PollVoteMessage.create = function create(properties) {
                return new PollVoteMessage(properties);
            };

            PollVoteMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.selectedOptions != null && m.selectedOptions.length) {
                    for (var i = 0; i < m.selectedOptions.length; ++i)
                        w.uint32(10).bytes(m.selectedOptions[i]);
                }
                return w;
            };

            PollVoteMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollVoteMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.selectedOptions && m.selectedOptions.length))
                                m.selectedOptions = [];
                            m.selectedOptions.push(r.bytes());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollVoteMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.PollVoteMessage)
                    return d;
                var m = new $root.proto.Message.PollVoteMessage();
                if (d.selectedOptions) {
                    if (!Array.isArray(d.selectedOptions))
                        throw TypeError(".proto.Message.PollVoteMessage.selectedOptions: array expected");
                    m.selectedOptions = [];
                    for (var i = 0; i < d.selectedOptions.length; ++i) {
                        if (typeof d.selectedOptions[i] === "string")
                            $util.base64.decode(d.selectedOptions[i], m.selectedOptions[i] = $util.newBuffer($util.base64.length(d.selectedOptions[i])), 0);
                        else if (d.selectedOptions[i].length >= 0)
                            m.selectedOptions[i] = d.selectedOptions[i];
                    }
                }
                return m;
            };

            PollVoteMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.selectedOptions = [];
                }
                if (m.selectedOptions && m.selectedOptions.length) {
                    d.selectedOptions = [];
                    for (var j = 0; j < m.selectedOptions.length; ++j) {
                        d.selectedOptions[j] = o.bytes === String ? $util.base64.encode(m.selectedOptions[j], 0, m.selectedOptions[j].length) : o.bytes === Array ? Array.prototype.slice.call(m.selectedOptions[j]) : m.selectedOptions[j];
                    }
                }
                return d;
            };

            PollVoteMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollVoteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.PollVoteMessage";
            };

            return PollVoteMessage;
        })();

        Message.ProductMessage = (function() {

            function ProductMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ProductMessage.prototype.product = null;
            ProductMessage.prototype.businessOwnerJid = null;
            ProductMessage.prototype.catalog = null;
            ProductMessage.prototype.body = null;
            ProductMessage.prototype.footer = null;
            ProductMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProductMessage.prototype, "_product", {
                get: $util.oneOfGetter($oneOfFields = ["product"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProductMessage.prototype, "_businessOwnerJid", {
                get: $util.oneOfGetter($oneOfFields = ["businessOwnerJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProductMessage.prototype, "_catalog", {
                get: $util.oneOfGetter($oneOfFields = ["catalog"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProductMessage.prototype, "_body", {
                get: $util.oneOfGetter($oneOfFields = ["body"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProductMessage.prototype, "_footer", {
                get: $util.oneOfGetter($oneOfFields = ["footer"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProductMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ProductMessage.create = function create(properties) {
                return new ProductMessage(properties);
            };

            ProductMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.product != null && Object.hasOwnProperty.call(m, "product"))
                    $root.proto.Message.ProductMessage.ProductSnapshot.encode(m.product, w.uint32(10).fork()).ldelim();
                if (m.businessOwnerJid != null && Object.hasOwnProperty.call(m, "businessOwnerJid"))
                    w.uint32(18).string(m.businessOwnerJid);
                if (m.catalog != null && Object.hasOwnProperty.call(m, "catalog"))
                    $root.proto.Message.ProductMessage.CatalogSnapshot.encode(m.catalog, w.uint32(34).fork()).ldelim();
                if (m.body != null && Object.hasOwnProperty.call(m, "body"))
                    w.uint32(42).string(m.body);
                if (m.footer != null && Object.hasOwnProperty.call(m, "footer"))
                    w.uint32(50).string(m.footer);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                return w;
            };

            ProductMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ProductMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.product = $root.proto.Message.ProductMessage.ProductSnapshot.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.businessOwnerJid = r.string();
                            break;
                        }
                    case 4: {
                            m.catalog = $root.proto.Message.ProductMessage.CatalogSnapshot.decode(r, r.uint32());
                            break;
                        }
                    case 5: {
                            m.body = r.string();
                            break;
                        }
                    case 6: {
                            m.footer = r.string();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ProductMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ProductMessage)
                    return d;
                var m = new $root.proto.Message.ProductMessage();
                if (d.product != null) {
                    if (typeof d.product !== "object")
                        throw TypeError(".proto.Message.ProductMessage.product: object expected");
                    m.product = $root.proto.Message.ProductMessage.ProductSnapshot.fromObject(d.product);
                }
                if (d.businessOwnerJid != null) {
                    m.businessOwnerJid = String(d.businessOwnerJid);
                }
                if (d.catalog != null) {
                    if (typeof d.catalog !== "object")
                        throw TypeError(".proto.Message.ProductMessage.catalog: object expected");
                    m.catalog = $root.proto.Message.ProductMessage.CatalogSnapshot.fromObject(d.catalog);
                }
                if (d.body != null) {
                    m.body = String(d.body);
                }
                if (d.footer != null) {
                    m.footer = String(d.footer);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.ProductMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            ProductMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.product != null && m.hasOwnProperty("product")) {
                    d.product = $root.proto.Message.ProductMessage.ProductSnapshot.toObject(m.product, o);
                    if (o.oneofs)
                        d._product = "product";
                }
                if (m.businessOwnerJid != null && m.hasOwnProperty("businessOwnerJid")) {
                    d.businessOwnerJid = m.businessOwnerJid;
                    if (o.oneofs)
                        d._businessOwnerJid = "businessOwnerJid";
                }
                if (m.catalog != null && m.hasOwnProperty("catalog")) {
                    d.catalog = $root.proto.Message.ProductMessage.CatalogSnapshot.toObject(m.catalog, o);
                    if (o.oneofs)
                        d._catalog = "catalog";
                }
                if (m.body != null && m.hasOwnProperty("body")) {
                    d.body = m.body;
                    if (o.oneofs)
                        d._body = "body";
                }
                if (m.footer != null && m.hasOwnProperty("footer")) {
                    d.footer = m.footer;
                    if (o.oneofs)
                        d._footer = "footer";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            ProductMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ProductMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ProductMessage";
            };

            ProductMessage.CatalogSnapshot = (function() {

                function CatalogSnapshot(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                CatalogSnapshot.prototype.catalogImage = null;
                CatalogSnapshot.prototype.title = null;
                CatalogSnapshot.prototype.description = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CatalogSnapshot.prototype, "_catalogImage", {
                    get: $util.oneOfGetter($oneOfFields = ["catalogImage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CatalogSnapshot.prototype, "_title", {
                    get: $util.oneOfGetter($oneOfFields = ["title"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(CatalogSnapshot.prototype, "_description", {
                    get: $util.oneOfGetter($oneOfFields = ["description"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                CatalogSnapshot.create = function create(properties) {
                    return new CatalogSnapshot(properties);
                };

                CatalogSnapshot.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.catalogImage != null && Object.hasOwnProperty.call(m, "catalogImage"))
                        $root.proto.Message.ImageMessage.encode(m.catalogImage, w.uint32(10).fork()).ldelim();
                    if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                        w.uint32(18).string(m.title);
                    if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                        w.uint32(26).string(m.description);
                    return w;
                };

                CatalogSnapshot.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ProductMessage.CatalogSnapshot();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.catalogImage = $root.proto.Message.ImageMessage.decode(r, r.uint32());
                                break;
                            }
                        case 2: {
                                m.title = r.string();
                                break;
                            }
                        case 3: {
                                m.description = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                CatalogSnapshot.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ProductMessage.CatalogSnapshot)
                        return d;
                    var m = new $root.proto.Message.ProductMessage.CatalogSnapshot();
                    if (d.catalogImage != null) {
                        if (typeof d.catalogImage !== "object")
                            throw TypeError(".proto.Message.ProductMessage.CatalogSnapshot.catalogImage: object expected");
                        m.catalogImage = $root.proto.Message.ImageMessage.fromObject(d.catalogImage);
                    }
                    if (d.title != null) {
                        m.title = String(d.title);
                    }
                    if (d.description != null) {
                        m.description = String(d.description);
                    }
                    return m;
                };

                CatalogSnapshot.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.catalogImage != null && m.hasOwnProperty("catalogImage")) {
                        d.catalogImage = $root.proto.Message.ImageMessage.toObject(m.catalogImage, o);
                        if (o.oneofs)
                            d._catalogImage = "catalogImage";
                    }
                    if (m.title != null && m.hasOwnProperty("title")) {
                        d.title = m.title;
                        if (o.oneofs)
                            d._title = "title";
                    }
                    if (m.description != null && m.hasOwnProperty("description")) {
                        d.description = m.description;
                        if (o.oneofs)
                            d._description = "description";
                    }
                    return d;
                };

                CatalogSnapshot.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                CatalogSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ProductMessage.CatalogSnapshot";
                };

                return CatalogSnapshot;
            })();

            ProductMessage.ProductSnapshot = (function() {

                function ProductSnapshot(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                ProductSnapshot.prototype.productImage = null;
                ProductSnapshot.prototype.productId = null;
                ProductSnapshot.prototype.title = null;
                ProductSnapshot.prototype.description = null;
                ProductSnapshot.prototype.currencyCode = null;
                ProductSnapshot.prototype.priceAmount1000 = null;
                ProductSnapshot.prototype.retailerId = null;
                ProductSnapshot.prototype.url = null;
                ProductSnapshot.prototype.productImageCount = null;
                ProductSnapshot.prototype.firstImageId = null;
                ProductSnapshot.prototype.salePriceAmount1000 = null;
                ProductSnapshot.prototype.signedUrl = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_productImage", {
                    get: $util.oneOfGetter($oneOfFields = ["productImage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_productId", {
                    get: $util.oneOfGetter($oneOfFields = ["productId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_title", {
                    get: $util.oneOfGetter($oneOfFields = ["title"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_description", {
                    get: $util.oneOfGetter($oneOfFields = ["description"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_currencyCode", {
                    get: $util.oneOfGetter($oneOfFields = ["currencyCode"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_priceAmount1000", {
                    get: $util.oneOfGetter($oneOfFields = ["priceAmount1000"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_retailerId", {
                    get: $util.oneOfGetter($oneOfFields = ["retailerId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_url", {
                    get: $util.oneOfGetter($oneOfFields = ["url"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_productImageCount", {
                    get: $util.oneOfGetter($oneOfFields = ["productImageCount"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_firstImageId", {
                    get: $util.oneOfGetter($oneOfFields = ["firstImageId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_salePriceAmount1000", {
                    get: $util.oneOfGetter($oneOfFields = ["salePriceAmount1000"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ProductSnapshot.prototype, "_signedUrl", {
                    get: $util.oneOfGetter($oneOfFields = ["signedUrl"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                ProductSnapshot.create = function create(properties) {
                    return new ProductSnapshot(properties);
                };

                ProductSnapshot.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.productImage != null && Object.hasOwnProperty.call(m, "productImage"))
                        $root.proto.Message.ImageMessage.encode(m.productImage, w.uint32(10).fork()).ldelim();
                    if (m.productId != null && Object.hasOwnProperty.call(m, "productId"))
                        w.uint32(18).string(m.productId);
                    if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                        w.uint32(26).string(m.title);
                    if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                        w.uint32(34).string(m.description);
                    if (m.currencyCode != null && Object.hasOwnProperty.call(m, "currencyCode"))
                        w.uint32(42).string(m.currencyCode);
                    if (m.priceAmount1000 != null && Object.hasOwnProperty.call(m, "priceAmount1000"))
                        w.uint32(48).int64(m.priceAmount1000);
                    if (m.retailerId != null && Object.hasOwnProperty.call(m, "retailerId"))
                        w.uint32(58).string(m.retailerId);
                    if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                        w.uint32(66).string(m.url);
                    if (m.productImageCount != null && Object.hasOwnProperty.call(m, "productImageCount"))
                        w.uint32(72).uint32(m.productImageCount);
                    if (m.firstImageId != null && Object.hasOwnProperty.call(m, "firstImageId"))
                        w.uint32(90).string(m.firstImageId);
                    if (m.salePriceAmount1000 != null && Object.hasOwnProperty.call(m, "salePriceAmount1000"))
                        w.uint32(96).int64(m.salePriceAmount1000);
                    if (m.signedUrl != null && Object.hasOwnProperty.call(m, "signedUrl"))
                        w.uint32(106).string(m.signedUrl);
                    return w;
                };

                ProductSnapshot.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ProductMessage.ProductSnapshot();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.productImage = $root.proto.Message.ImageMessage.decode(r, r.uint32());
                                break;
                            }
                        case 2: {
                                m.productId = r.string();
                                break;
                            }
                        case 3: {
                                m.title = r.string();
                                break;
                            }
                        case 4: {
                                m.description = r.string();
                                break;
                            }
                        case 5: {
                                m.currencyCode = r.string();
                                break;
                            }
                        case 6: {
                                m.priceAmount1000 = r.int64();
                                break;
                            }
                        case 7: {
                                m.retailerId = r.string();
                                break;
                            }
                        case 8: {
                                m.url = r.string();
                                break;
                            }
                        case 9: {
                                m.productImageCount = r.uint32();
                                break;
                            }
                        case 11: {
                                m.firstImageId = r.string();
                                break;
                            }
                        case 12: {
                                m.salePriceAmount1000 = r.int64();
                                break;
                            }
                        case 13: {
                                m.signedUrl = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                ProductSnapshot.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.ProductMessage.ProductSnapshot)
                        return d;
                    var m = new $root.proto.Message.ProductMessage.ProductSnapshot();
                    if (d.productImage != null) {
                        if (typeof d.productImage !== "object")
                            throw TypeError(".proto.Message.ProductMessage.ProductSnapshot.productImage: object expected");
                        m.productImage = $root.proto.Message.ImageMessage.fromObject(d.productImage);
                    }
                    if (d.productId != null) {
                        m.productId = String(d.productId);
                    }
                    if (d.title != null) {
                        m.title = String(d.title);
                    }
                    if (d.description != null) {
                        m.description = String(d.description);
                    }
                    if (d.currencyCode != null) {
                        m.currencyCode = String(d.currencyCode);
                    }
                    if (d.priceAmount1000 != null) {
                        if ($util.Long)
                            (m.priceAmount1000 = $util.Long.fromValue(d.priceAmount1000)).unsigned = false;
                        else if (typeof d.priceAmount1000 === "string")
                            m.priceAmount1000 = parseInt(d.priceAmount1000, 10);
                        else if (typeof d.priceAmount1000 === "number")
                            m.priceAmount1000 = d.priceAmount1000;
                        else if (typeof d.priceAmount1000 === "object")
                            m.priceAmount1000 = new $util.LongBits(d.priceAmount1000.low >>> 0, d.priceAmount1000.high >>> 0).toNumber();
                    }
                    if (d.retailerId != null) {
                        m.retailerId = String(d.retailerId);
                    }
                    if (d.url != null) {
                        m.url = String(d.url);
                    }
                    if (d.productImageCount != null) {
                        m.productImageCount = d.productImageCount >>> 0;
                    }
                    if (d.firstImageId != null) {
                        m.firstImageId = String(d.firstImageId);
                    }
                    if (d.salePriceAmount1000 != null) {
                        if ($util.Long)
                            (m.salePriceAmount1000 = $util.Long.fromValue(d.salePriceAmount1000)).unsigned = false;
                        else if (typeof d.salePriceAmount1000 === "string")
                            m.salePriceAmount1000 = parseInt(d.salePriceAmount1000, 10);
                        else if (typeof d.salePriceAmount1000 === "number")
                            m.salePriceAmount1000 = d.salePriceAmount1000;
                        else if (typeof d.salePriceAmount1000 === "object")
                            m.salePriceAmount1000 = new $util.LongBits(d.salePriceAmount1000.low >>> 0, d.salePriceAmount1000.high >>> 0).toNumber();
                    }
                    if (d.signedUrl != null) {
                        m.signedUrl = String(d.signedUrl);
                    }
                    return m;
                };

                ProductSnapshot.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.productImage != null && m.hasOwnProperty("productImage")) {
                        d.productImage = $root.proto.Message.ImageMessage.toObject(m.productImage, o);
                        if (o.oneofs)
                            d._productImage = "productImage";
                    }
                    if (m.productId != null && m.hasOwnProperty("productId")) {
                        d.productId = m.productId;
                        if (o.oneofs)
                            d._productId = "productId";
                    }
                    if (m.title != null && m.hasOwnProperty("title")) {
                        d.title = m.title;
                        if (o.oneofs)
                            d._title = "title";
                    }
                    if (m.description != null && m.hasOwnProperty("description")) {
                        d.description = m.description;
                        if (o.oneofs)
                            d._description = "description";
                    }
                    if (m.currencyCode != null && m.hasOwnProperty("currencyCode")) {
                        d.currencyCode = m.currencyCode;
                        if (o.oneofs)
                            d._currencyCode = "currencyCode";
                    }
                    if (m.priceAmount1000 != null && m.hasOwnProperty("priceAmount1000")) {
                        if (typeof m.priceAmount1000 === "number")
                            d.priceAmount1000 = o.longs === String ? String(m.priceAmount1000) : m.priceAmount1000;
                        else
                            d.priceAmount1000 = o.longs === String ? longToString(m.priceAmount1000) : o.longs === Number ? longToNumber(m.priceAmount1000) : m.priceAmount1000;
                        if (o.oneofs)
                            d._priceAmount1000 = "priceAmount1000";
                    }
                    if (m.retailerId != null && m.hasOwnProperty("retailerId")) {
                        d.retailerId = m.retailerId;
                        if (o.oneofs)
                            d._retailerId = "retailerId";
                    }
                    if (m.url != null && m.hasOwnProperty("url")) {
                        d.url = m.url;
                        if (o.oneofs)
                            d._url = "url";
                    }
                    if (m.productImageCount != null && m.hasOwnProperty("productImageCount")) {
                        d.productImageCount = m.productImageCount;
                        if (o.oneofs)
                            d._productImageCount = "productImageCount";
                    }
                    if (m.firstImageId != null && m.hasOwnProperty("firstImageId")) {
                        d.firstImageId = m.firstImageId;
                        if (o.oneofs)
                            d._firstImageId = "firstImageId";
                    }
                    if (m.salePriceAmount1000 != null && m.hasOwnProperty("salePriceAmount1000")) {
                        if (typeof m.salePriceAmount1000 === "number")
                            d.salePriceAmount1000 = o.longs === String ? String(m.salePriceAmount1000) : m.salePriceAmount1000;
                        else
                            d.salePriceAmount1000 = o.longs === String ? longToString(m.salePriceAmount1000) : o.longs === Number ? longToNumber(m.salePriceAmount1000) : m.salePriceAmount1000;
                        if (o.oneofs)
                            d._salePriceAmount1000 = "salePriceAmount1000";
                    }
                    if (m.signedUrl != null && m.hasOwnProperty("signedUrl")) {
                        d.signedUrl = m.signedUrl;
                        if (o.oneofs)
                            d._signedUrl = "signedUrl";
                    }
                    return d;
                };

                ProductSnapshot.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                ProductSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.ProductMessage.ProductSnapshot";
                };

                return ProductSnapshot;
            })();

            return ProductMessage;
        })();

        Message.ProtocolMessage = (function() {

            function ProtocolMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ProtocolMessage.prototype.key = null;
            ProtocolMessage.prototype.type = null;
            ProtocolMessage.prototype.ephemeralExpiration = null;
            ProtocolMessage.prototype.ephemeralSettingTimestamp = null;
            ProtocolMessage.prototype.historySyncNotification = null;
            ProtocolMessage.prototype.appStateSyncKeyShare = null;
            ProtocolMessage.prototype.appStateSyncKeyRequest = null;
            ProtocolMessage.prototype.initialSecurityNotificationSettingSync = null;
            ProtocolMessage.prototype.appStateFatalExceptionNotification = null;
            ProtocolMessage.prototype.disappearingMode = null;
            ProtocolMessage.prototype.editedMessage = null;
            ProtocolMessage.prototype.timestampMs = null;
            ProtocolMessage.prototype.peerDataOperationRequestMessage = null;
            ProtocolMessage.prototype.peerDataOperationRequestResponseMessage = null;
            ProtocolMessage.prototype.botFeedbackMessage = null;
            ProtocolMessage.prototype.invokerJid = null;
            ProtocolMessage.prototype.requestWelcomeMessageMetadata = null;
            ProtocolMessage.prototype.mediaNotifyMessage = null;
            ProtocolMessage.prototype.cloudApiThreadControlNotification = null;
            ProtocolMessage.prototype.lidMigrationMappingSyncMessage = null;
            ProtocolMessage.prototype.limitSharing = null;
            ProtocolMessage.prototype.aiPsiMetadata = null;
            ProtocolMessage.prototype.aiQueryFanout = null;
            ProtocolMessage.prototype.memberLabel = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_ephemeralExpiration", {
                get: $util.oneOfGetter($oneOfFields = ["ephemeralExpiration"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_ephemeralSettingTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["ephemeralSettingTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_historySyncNotification", {
                get: $util.oneOfGetter($oneOfFields = ["historySyncNotification"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_appStateSyncKeyShare", {
                get: $util.oneOfGetter($oneOfFields = ["appStateSyncKeyShare"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_appStateSyncKeyRequest", {
                get: $util.oneOfGetter($oneOfFields = ["appStateSyncKeyRequest"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_initialSecurityNotificationSettingSync", {
                get: $util.oneOfGetter($oneOfFields = ["initialSecurityNotificationSettingSync"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_appStateFatalExceptionNotification", {
                get: $util.oneOfGetter($oneOfFields = ["appStateFatalExceptionNotification"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_disappearingMode", {
                get: $util.oneOfGetter($oneOfFields = ["disappearingMode"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_editedMessage", {
                get: $util.oneOfGetter($oneOfFields = ["editedMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_timestampMs", {
                get: $util.oneOfGetter($oneOfFields = ["timestampMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_peerDataOperationRequestMessage", {
                get: $util.oneOfGetter($oneOfFields = ["peerDataOperationRequestMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_peerDataOperationRequestResponseMessage", {
                get: $util.oneOfGetter($oneOfFields = ["peerDataOperationRequestResponseMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_botFeedbackMessage", {
                get: $util.oneOfGetter($oneOfFields = ["botFeedbackMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_invokerJid", {
                get: $util.oneOfGetter($oneOfFields = ["invokerJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_requestWelcomeMessageMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["requestWelcomeMessageMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_mediaNotifyMessage", {
                get: $util.oneOfGetter($oneOfFields = ["mediaNotifyMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_cloudApiThreadControlNotification", {
                get: $util.oneOfGetter($oneOfFields = ["cloudApiThreadControlNotification"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_lidMigrationMappingSyncMessage", {
                get: $util.oneOfGetter($oneOfFields = ["lidMigrationMappingSyncMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_limitSharing", {
                get: $util.oneOfGetter($oneOfFields = ["limitSharing"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_aiPsiMetadata", {
                get: $util.oneOfGetter($oneOfFields = ["aiPsiMetadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_aiQueryFanout", {
                get: $util.oneOfGetter($oneOfFields = ["aiQueryFanout"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ProtocolMessage.prototype, "_memberLabel", {
                get: $util.oneOfGetter($oneOfFields = ["memberLabel"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ProtocolMessage.create = function create(properties) {
                return new ProtocolMessage(properties);
            };

            ProtocolMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(16).int32(m.type);
                if (m.ephemeralExpiration != null && Object.hasOwnProperty.call(m, "ephemeralExpiration"))
                    w.uint32(32).uint32(m.ephemeralExpiration);
                if (m.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(m, "ephemeralSettingTimestamp"))
                    w.uint32(40).int64(m.ephemeralSettingTimestamp);
                if (m.historySyncNotification != null && Object.hasOwnProperty.call(m, "historySyncNotification"))
                    $root.proto.Message.HistorySyncNotification.encode(m.historySyncNotification, w.uint32(50).fork()).ldelim();
                if (m.appStateSyncKeyShare != null && Object.hasOwnProperty.call(m, "appStateSyncKeyShare"))
                    $root.proto.Message.AppStateSyncKeyShare.encode(m.appStateSyncKeyShare, w.uint32(58).fork()).ldelim();
                if (m.appStateSyncKeyRequest != null && Object.hasOwnProperty.call(m, "appStateSyncKeyRequest"))
                    $root.proto.Message.AppStateSyncKeyRequest.encode(m.appStateSyncKeyRequest, w.uint32(66).fork()).ldelim();
                if (m.initialSecurityNotificationSettingSync != null && Object.hasOwnProperty.call(m, "initialSecurityNotificationSettingSync"))
                    $root.proto.Message.InitialSecurityNotificationSettingSync.encode(m.initialSecurityNotificationSettingSync, w.uint32(74).fork()).ldelim();
                if (m.appStateFatalExceptionNotification != null && Object.hasOwnProperty.call(m, "appStateFatalExceptionNotification"))
                    $root.proto.Message.AppStateFatalExceptionNotification.encode(m.appStateFatalExceptionNotification, w.uint32(82).fork()).ldelim();
                if (m.disappearingMode != null && Object.hasOwnProperty.call(m, "disappearingMode"))
                    $root.proto.DisappearingMode.encode(m.disappearingMode, w.uint32(90).fork()).ldelim();
                if (m.editedMessage != null && Object.hasOwnProperty.call(m, "editedMessage"))
                    $root.proto.Message.encode(m.editedMessage, w.uint32(114).fork()).ldelim();
                if (m.timestampMs != null && Object.hasOwnProperty.call(m, "timestampMs"))
                    w.uint32(120).int64(m.timestampMs);
                if (m.peerDataOperationRequestMessage != null && Object.hasOwnProperty.call(m, "peerDataOperationRequestMessage"))
                    $root.proto.Message.PeerDataOperationRequestMessage.encode(m.peerDataOperationRequestMessage, w.uint32(130).fork()).ldelim();
                if (m.peerDataOperationRequestResponseMessage != null && Object.hasOwnProperty.call(m, "peerDataOperationRequestResponseMessage"))
                    $root.proto.Message.PeerDataOperationRequestResponseMessage.encode(m.peerDataOperationRequestResponseMessage, w.uint32(138).fork()).ldelim();
                if (m.botFeedbackMessage != null && Object.hasOwnProperty.call(m, "botFeedbackMessage"))
                    $root.proto.BotFeedbackMessage.encode(m.botFeedbackMessage, w.uint32(146).fork()).ldelim();
                if (m.invokerJid != null && Object.hasOwnProperty.call(m, "invokerJid"))
                    w.uint32(154).string(m.invokerJid);
                if (m.requestWelcomeMessageMetadata != null && Object.hasOwnProperty.call(m, "requestWelcomeMessageMetadata"))
                    $root.proto.Message.RequestWelcomeMessageMetadata.encode(m.requestWelcomeMessageMetadata, w.uint32(162).fork()).ldelim();
                if (m.mediaNotifyMessage != null && Object.hasOwnProperty.call(m, "mediaNotifyMessage"))
                    $root.proto.MediaNotifyMessage.encode(m.mediaNotifyMessage, w.uint32(170).fork()).ldelim();
                if (m.cloudApiThreadControlNotification != null && Object.hasOwnProperty.call(m, "cloudApiThreadControlNotification"))
                    $root.proto.Message.CloudAPIThreadControlNotification.encode(m.cloudApiThreadControlNotification, w.uint32(178).fork()).ldelim();
                if (m.lidMigrationMappingSyncMessage != null && Object.hasOwnProperty.call(m, "lidMigrationMappingSyncMessage"))
                    $root.proto.LIDMigrationMappingSyncMessage.encode(m.lidMigrationMappingSyncMessage, w.uint32(186).fork()).ldelim();
                if (m.limitSharing != null && Object.hasOwnProperty.call(m, "limitSharing"))
                    $root.proto.LimitSharing.encode(m.limitSharing, w.uint32(194).fork()).ldelim();
                if (m.aiPsiMetadata != null && Object.hasOwnProperty.call(m, "aiPsiMetadata"))
                    w.uint32(202).bytes(m.aiPsiMetadata);
                if (m.aiQueryFanout != null && Object.hasOwnProperty.call(m, "aiQueryFanout"))
                    $root.proto.AIQueryFanout.encode(m.aiQueryFanout, w.uint32(210).fork()).ldelim();
                if (m.memberLabel != null && Object.hasOwnProperty.call(m, "memberLabel"))
                    $root.proto.MemberLabel.encode(m.memberLabel, w.uint32(218).fork()).ldelim();
                return w;
            };

            ProtocolMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ProtocolMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.type = r.int32();
                            break;
                        }
                    case 4: {
                            m.ephemeralExpiration = r.uint32();
                            break;
                        }
                    case 5: {
                            m.ephemeralSettingTimestamp = r.int64();
                            break;
                        }
                    case 6: {
                            m.historySyncNotification = $root.proto.Message.HistorySyncNotification.decode(r, r.uint32());
                            break;
                        }
                    case 7: {
                            m.appStateSyncKeyShare = $root.proto.Message.AppStateSyncKeyShare.decode(r, r.uint32());
                            break;
                        }
                    case 8: {
                            m.appStateSyncKeyRequest = $root.proto.Message.AppStateSyncKeyRequest.decode(r, r.uint32());
                            break;
                        }
                    case 9: {
                            m.initialSecurityNotificationSettingSync = $root.proto.Message.InitialSecurityNotificationSettingSync.decode(r, r.uint32());
                            break;
                        }
                    case 10: {
                            m.appStateFatalExceptionNotification = $root.proto.Message.AppStateFatalExceptionNotification.decode(r, r.uint32());
                            break;
                        }
                    case 11: {
                            m.disappearingMode = $root.proto.DisappearingMode.decode(r, r.uint32());
                            break;
                        }
                    case 14: {
                            m.editedMessage = $root.proto.Message.decode(r, r.uint32());
                            break;
                        }
                    case 15: {
                            m.timestampMs = r.int64();
                            break;
                        }
                    case 16: {
                            m.peerDataOperationRequestMessage = $root.proto.Message.PeerDataOperationRequestMessage.decode(r, r.uint32());
                            break;
                        }
                    case 17: {
                            m.peerDataOperationRequestResponseMessage = $root.proto.Message.PeerDataOperationRequestResponseMessage.decode(r, r.uint32());
                            break;
                        }
                    case 18: {
                            m.botFeedbackMessage = $root.proto.BotFeedbackMessage.decode(r, r.uint32());
                            break;
                        }
                    case 19: {
                            m.invokerJid = r.string();
                            break;
                        }
                    case 20: {
                            m.requestWelcomeMessageMetadata = $root.proto.Message.RequestWelcomeMessageMetadata.decode(r, r.uint32());
                            break;
                        }
                    case 21: {
                            m.mediaNotifyMessage = $root.proto.MediaNotifyMessage.decode(r, r.uint32());
                            break;
                        }
                    case 22: {
                            m.cloudApiThreadControlNotification = $root.proto.Message.CloudAPIThreadControlNotification.decode(r, r.uint32());
                            break;
                        }
                    case 23: {
                            m.lidMigrationMappingSyncMessage = $root.proto.LIDMigrationMappingSyncMessage.decode(r, r.uint32());
                            break;
                        }
                    case 24: {
                            m.limitSharing = $root.proto.LimitSharing.decode(r, r.uint32());
                            break;
                        }
                    case 25: {
                            m.aiPsiMetadata = r.bytes();
                            break;
                        }
                    case 26: {
                            m.aiQueryFanout = $root.proto.AIQueryFanout.decode(r, r.uint32());
                            break;
                        }
                    case 27: {
                            m.memberLabel = $root.proto.MemberLabel.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ProtocolMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ProtocolMessage)
                    return d;
                var m = new $root.proto.Message.ProtocolMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "REVOKE":
                case 0:
                    m.type = 0;
                    break;
                case "EPHEMERAL_SETTING":
                case 3:
                    m.type = 3;
                    break;
                case "EPHEMERAL_SYNC_RESPONSE":
                case 4:
                    m.type = 4;
                    break;
                case "HISTORY_SYNC_NOTIFICATION":
                case 5:
                    m.type = 5;
                    break;
                case "APP_STATE_SYNC_KEY_SHARE":
                case 6:
                    m.type = 6;
                    break;
                case "APP_STATE_SYNC_KEY_REQUEST":
                case 7:
                    m.type = 7;
                    break;
                case "MSG_FANOUT_BACKFILL_REQUEST":
                case 8:
                    m.type = 8;
                    break;
                case "INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC":
                case 9:
                    m.type = 9;
                    break;
                case "APP_STATE_FATAL_EXCEPTION_NOTIFICATION":
                case 10:
                    m.type = 10;
                    break;
                case "SHARE_PHONE_NUMBER":
                case 11:
                    m.type = 11;
                    break;
                case "MESSAGE_EDIT":
                case 14:
                    m.type = 14;
                    break;
                case "PEER_DATA_OPERATION_REQUEST_MESSAGE":
                case 16:
                    m.type = 16;
                    break;
                case "PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE":
                case 17:
                    m.type = 17;
                    break;
                case "REQUEST_WELCOME_MESSAGE":
                case 18:
                    m.type = 18;
                    break;
                case "BOT_FEEDBACK_MESSAGE":
                case 19:
                    m.type = 19;
                    break;
                case "MEDIA_NOTIFY_MESSAGE":
                case 20:
                    m.type = 20;
                    break;
                case "CLOUD_API_THREAD_CONTROL_NOTIFICATION":
                case 21:
                    m.type = 21;
                    break;
                case "LID_MIGRATION_MAPPING_SYNC":
                case 22:
                    m.type = 22;
                    break;
                case "REMINDER_MESSAGE":
                case 23:
                    m.type = 23;
                    break;
                case "BOT_MEMU_ONBOARDING_MESSAGE":
                case 24:
                    m.type = 24;
                    break;
                case "STATUS_MENTION_MESSAGE":
                case 25:
                    m.type = 25;
                    break;
                case "STOP_GENERATION_MESSAGE":
                case 26:
                    m.type = 26;
                    break;
                case "LIMIT_SHARING":
                case 27:
                    m.type = 27;
                    break;
                case "AI_PSI_METADATA":
                case 28:
                    m.type = 28;
                    break;
                case "AI_QUERY_FANOUT":
                case 29:
                    m.type = 29;
                    break;
                case "GROUP_MEMBER_LABEL_CHANGE":
                case 30:
                    m.type = 30;
                    break;
                }
                if (d.ephemeralExpiration != null) {
                    m.ephemeralExpiration = d.ephemeralExpiration >>> 0;
                }
                if (d.ephemeralSettingTimestamp != null) {
                    if ($util.Long)
                        (m.ephemeralSettingTimestamp = $util.Long.fromValue(d.ephemeralSettingTimestamp)).unsigned = false;
                    else if (typeof d.ephemeralSettingTimestamp === "string")
                        m.ephemeralSettingTimestamp = parseInt(d.ephemeralSettingTimestamp, 10);
                    else if (typeof d.ephemeralSettingTimestamp === "number")
                        m.ephemeralSettingTimestamp = d.ephemeralSettingTimestamp;
                    else if (typeof d.ephemeralSettingTimestamp === "object")
                        m.ephemeralSettingTimestamp = new $util.LongBits(d.ephemeralSettingTimestamp.low >>> 0, d.ephemeralSettingTimestamp.high >>> 0).toNumber();
                }
                if (d.historySyncNotification != null) {
                    if (typeof d.historySyncNotification !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.historySyncNotification: object expected");
                    m.historySyncNotification = $root.proto.Message.HistorySyncNotification.fromObject(d.historySyncNotification);
                }
                if (d.appStateSyncKeyShare != null) {
                    if (typeof d.appStateSyncKeyShare !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyShare: object expected");
                    m.appStateSyncKeyShare = $root.proto.Message.AppStateSyncKeyShare.fromObject(d.appStateSyncKeyShare);
                }
                if (d.appStateSyncKeyRequest != null) {
                    if (typeof d.appStateSyncKeyRequest !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyRequest: object expected");
                    m.appStateSyncKeyRequest = $root.proto.Message.AppStateSyncKeyRequest.fromObject(d.appStateSyncKeyRequest);
                }
                if (d.initialSecurityNotificationSettingSync != null) {
                    if (typeof d.initialSecurityNotificationSettingSync !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.initialSecurityNotificationSettingSync: object expected");
                    m.initialSecurityNotificationSettingSync = $root.proto.Message.InitialSecurityNotificationSettingSync.fromObject(d.initialSecurityNotificationSettingSync);
                }
                if (d.appStateFatalExceptionNotification != null) {
                    if (typeof d.appStateFatalExceptionNotification !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.appStateFatalExceptionNotification: object expected");
                    m.appStateFatalExceptionNotification = $root.proto.Message.AppStateFatalExceptionNotification.fromObject(d.appStateFatalExceptionNotification);
                }
                if (d.disappearingMode != null) {
                    if (typeof d.disappearingMode !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.disappearingMode: object expected");
                    m.disappearingMode = $root.proto.DisappearingMode.fromObject(d.disappearingMode);
                }
                if (d.editedMessage != null) {
                    if (typeof d.editedMessage !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.editedMessage: object expected");
                    m.editedMessage = $root.proto.Message.fromObject(d.editedMessage);
                }
                if (d.timestampMs != null) {
                    if ($util.Long)
                        (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false;
                    else if (typeof d.timestampMs === "string")
                        m.timestampMs = parseInt(d.timestampMs, 10);
                    else if (typeof d.timestampMs === "number")
                        m.timestampMs = d.timestampMs;
                    else if (typeof d.timestampMs === "object")
                        m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber();
                }
                if (d.peerDataOperationRequestMessage != null) {
                    if (typeof d.peerDataOperationRequestMessage !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestMessage: object expected");
                    m.peerDataOperationRequestMessage = $root.proto.Message.PeerDataOperationRequestMessage.fromObject(d.peerDataOperationRequestMessage);
                }
                if (d.peerDataOperationRequestResponseMessage != null) {
                    if (typeof d.peerDataOperationRequestResponseMessage !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestResponseMessage: object expected");
                    m.peerDataOperationRequestResponseMessage = $root.proto.Message.PeerDataOperationRequestResponseMessage.fromObject(d.peerDataOperationRequestResponseMessage);
                }
                if (d.botFeedbackMessage != null) {
                    if (typeof d.botFeedbackMessage !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.botFeedbackMessage: object expected");
                    m.botFeedbackMessage = $root.proto.BotFeedbackMessage.fromObject(d.botFeedbackMessage);
                }
                if (d.invokerJid != null) {
                    m.invokerJid = String(d.invokerJid);
                }
                if (d.requestWelcomeMessageMetadata != null) {
                    if (typeof d.requestWelcomeMessageMetadata !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.requestWelcomeMessageMetadata: object expected");
                    m.requestWelcomeMessageMetadata = $root.proto.Message.RequestWelcomeMessageMetadata.fromObject(d.requestWelcomeMessageMetadata);
                }
                if (d.mediaNotifyMessage != null) {
                    if (typeof d.mediaNotifyMessage !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.mediaNotifyMessage: object expected");
                    m.mediaNotifyMessage = $root.proto.MediaNotifyMessage.fromObject(d.mediaNotifyMessage);
                }
                if (d.cloudApiThreadControlNotification != null) {
                    if (typeof d.cloudApiThreadControlNotification !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.cloudApiThreadControlNotification: object expected");
                    m.cloudApiThreadControlNotification = $root.proto.Message.CloudAPIThreadControlNotification.fromObject(d.cloudApiThreadControlNotification);
                }
                if (d.lidMigrationMappingSyncMessage != null) {
                    if (typeof d.lidMigrationMappingSyncMessage !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.lidMigrationMappingSyncMessage: object expected");
                    m.lidMigrationMappingSyncMessage = $root.proto.LIDMigrationMappingSyncMessage.fromObject(d.lidMigrationMappingSyncMessage);
                }
                if (d.limitSharing != null) {
                    if (typeof d.limitSharing !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.limitSharing: object expected");
                    m.limitSharing = $root.proto.LimitSharing.fromObject(d.limitSharing);
                }
                if (d.aiPsiMetadata != null) {
                    if (typeof d.aiPsiMetadata === "string")
                        $util.base64.decode(d.aiPsiMetadata, m.aiPsiMetadata = $util.newBuffer($util.base64.length(d.aiPsiMetadata)), 0);
                    else if (d.aiPsiMetadata.length >= 0)
                        m.aiPsiMetadata = d.aiPsiMetadata;
                }
                if (d.aiQueryFanout != null) {
                    if (typeof d.aiQueryFanout !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.aiQueryFanout: object expected");
                    m.aiQueryFanout = $root.proto.AIQueryFanout.fromObject(d.aiQueryFanout);
                }
                if (d.memberLabel != null) {
                    if (typeof d.memberLabel !== "object")
                        throw TypeError(".proto.Message.ProtocolMessage.memberLabel: object expected");
                    m.memberLabel = $root.proto.MemberLabel.fromObject(d.memberLabel);
                }
                return m;
            };

            ProtocolMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.Message.ProtocolMessage.Type[m.type] === undefined ? m.type : $root.proto.Message.ProtocolMessage.Type[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                if (m.ephemeralExpiration != null && m.hasOwnProperty("ephemeralExpiration")) {
                    d.ephemeralExpiration = m.ephemeralExpiration;
                    if (o.oneofs)
                        d._ephemeralExpiration = "ephemeralExpiration";
                }
                if (m.ephemeralSettingTimestamp != null && m.hasOwnProperty("ephemeralSettingTimestamp")) {
                    if (typeof m.ephemeralSettingTimestamp === "number")
                        d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp;
                    else
                        d.ephemeralSettingTimestamp = o.longs === String ? longToString(m.ephemeralSettingTimestamp) : o.longs === Number ? longToNumber(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp;
                    if (o.oneofs)
                        d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp";
                }
                if (m.historySyncNotification != null && m.hasOwnProperty("historySyncNotification")) {
                    d.historySyncNotification = $root.proto.Message.HistorySyncNotification.toObject(m.historySyncNotification, o);
                    if (o.oneofs)
                        d._historySyncNotification = "historySyncNotification";
                }
                if (m.appStateSyncKeyShare != null && m.hasOwnProperty("appStateSyncKeyShare")) {
                    d.appStateSyncKeyShare = $root.proto.Message.AppStateSyncKeyShare.toObject(m.appStateSyncKeyShare, o);
                    if (o.oneofs)
                        d._appStateSyncKeyShare = "appStateSyncKeyShare";
                }
                if (m.appStateSyncKeyRequest != null && m.hasOwnProperty("appStateSyncKeyRequest")) {
                    d.appStateSyncKeyRequest = $root.proto.Message.AppStateSyncKeyRequest.toObject(m.appStateSyncKeyRequest, o);
                    if (o.oneofs)
                        d._appStateSyncKeyRequest = "appStateSyncKeyRequest";
                }
                if (m.initialSecurityNotificationSettingSync != null && m.hasOwnProperty("initialSecurityNotificationSettingSync")) {
                    d.initialSecurityNotificationSettingSync = $root.proto.Message.InitialSecurityNotificationSettingSync.toObject(m.initialSecurityNotificationSettingSync, o);
                    if (o.oneofs)
                        d._initialSecurityNotificationSettingSync = "initialSecurityNotificationSettingSync";
                }
                if (m.appStateFatalExceptionNotification != null && m.hasOwnProperty("appStateFatalExceptionNotification")) {
                    d.appStateFatalExceptionNotification = $root.proto.Message.AppStateFatalExceptionNotification.toObject(m.appStateFatalExceptionNotification, o);
                    if (o.oneofs)
                        d._appStateFatalExceptionNotification = "appStateFatalExceptionNotification";
                }
                if (m.disappearingMode != null && m.hasOwnProperty("disappearingMode")) {
                    d.disappearingMode = $root.proto.DisappearingMode.toObject(m.disappearingMode, o);
                    if (o.oneofs)
                        d._disappearingMode = "disappearingMode";
                }
                if (m.editedMessage != null && m.hasOwnProperty("editedMessage")) {
                    d.editedMessage = $root.proto.Message.toObject(m.editedMessage, o);
                    if (o.oneofs)
                        d._editedMessage = "editedMessage";
                }
                if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) {
                    if (typeof m.timestampMs === "number")
                        d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs;
                    else
                        d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs;
                    if (o.oneofs)
                        d._timestampMs = "timestampMs";
                }
                if (m.peerDataOperationRequestMessage != null && m.hasOwnProperty("peerDataOperationRequestMessage")) {
                    d.peerDataOperationRequestMessage = $root.proto.Message.PeerDataOperationRequestMessage.toObject(m.peerDataOperationRequestMessage, o);
                    if (o.oneofs)
                        d._peerDataOperationRequestMessage = "peerDataOperationRequestMessage";
                }
                if (m.peerDataOperationRequestResponseMessage != null && m.hasOwnProperty("peerDataOperationRequestResponseMessage")) {
                    d.peerDataOperationRequestResponseMessage = $root.proto.Message.PeerDataOperationRequestResponseMessage.toObject(m.peerDataOperationRequestResponseMessage, o);
                    if (o.oneofs)
                        d._peerDataOperationRequestResponseMessage = "peerDataOperationRequestResponseMessage";
                }
                if (m.botFeedbackMessage != null && m.hasOwnProperty("botFeedbackMessage")) {
                    d.botFeedbackMessage = $root.proto.BotFeedbackMessage.toObject(m.botFeedbackMessage, o);
                    if (o.oneofs)
                        d._botFeedbackMessage = "botFeedbackMessage";
                }
                if (m.invokerJid != null && m.hasOwnProperty("invokerJid")) {
                    d.invokerJid = m.invokerJid;
                    if (o.oneofs)
                        d._invokerJid = "invokerJid";
                }
                if (m.requestWelcomeMessageMetadata != null && m.hasOwnProperty("requestWelcomeMessageMetadata")) {
                    d.requestWelcomeMessageMetadata = $root.proto.Message.RequestWelcomeMessageMetadata.toObject(m.requestWelcomeMessageMetadata, o);
                    if (o.oneofs)
                        d._requestWelcomeMessageMetadata = "requestWelcomeMessageMetadata";
                }
                if (m.mediaNotifyMessage != null && m.hasOwnProperty("mediaNotifyMessage")) {
                    d.mediaNotifyMessage = $root.proto.MediaNotifyMessage.toObject(m.mediaNotifyMessage, o);
                    if (o.oneofs)
                        d._mediaNotifyMessage = "mediaNotifyMessage";
                }
                if (m.cloudApiThreadControlNotification != null && m.hasOwnProperty("cloudApiThreadControlNotification")) {
                    d.cloudApiThreadControlNotification = $root.proto.Message.CloudAPIThreadControlNotification.toObject(m.cloudApiThreadControlNotification, o);
                    if (o.oneofs)
                        d._cloudApiThreadControlNotification = "cloudApiThreadControlNotification";
                }
                if (m.lidMigrationMappingSyncMessage != null && m.hasOwnProperty("lidMigrationMappingSyncMessage")) {
                    d.lidMigrationMappingSyncMessage = $root.proto.LIDMigrationMappingSyncMessage.toObject(m.lidMigrationMappingSyncMessage, o);
                    if (o.oneofs)
                        d._lidMigrationMappingSyncMessage = "lidMigrationMappingSyncMessage";
                }
                if (m.limitSharing != null && m.hasOwnProperty("limitSharing")) {
                    d.limitSharing = $root.proto.LimitSharing.toObject(m.limitSharing, o);
                    if (o.oneofs)
                        d._limitSharing = "limitSharing";
                }
                if (m.aiPsiMetadata != null && m.hasOwnProperty("aiPsiMetadata")) {
                    d.aiPsiMetadata = o.bytes === String ? $util.base64.encode(m.aiPsiMetadata, 0, m.aiPsiMetadata.length) : o.bytes === Array ? Array.prototype.slice.call(m.aiPsiMetadata) : m.aiPsiMetadata;
                    if (o.oneofs)
                        d._aiPsiMetadata = "aiPsiMetadata";
                }
                if (m.aiQueryFanout != null && m.hasOwnProperty("aiQueryFanout")) {
                    d.aiQueryFanout = $root.proto.AIQueryFanout.toObject(m.aiQueryFanout, o);
                    if (o.oneofs)
                        d._aiQueryFanout = "aiQueryFanout";
                }
                if (m.memberLabel != null && m.hasOwnProperty("memberLabel")) {
                    d.memberLabel = $root.proto.MemberLabel.toObject(m.memberLabel, o);
                    if (o.oneofs)
                        d._memberLabel = "memberLabel";
                }
                return d;
            };

            ProtocolMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ProtocolMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ProtocolMessage";
            };

            ProtocolMessage.Type = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "REVOKE"] = 0;
                values[valuesById[3] = "EPHEMERAL_SETTING"] = 3;
                values[valuesById[4] = "EPHEMERAL_SYNC_RESPONSE"] = 4;
                values[valuesById[5] = "HISTORY_SYNC_NOTIFICATION"] = 5;
                values[valuesById[6] = "APP_STATE_SYNC_KEY_SHARE"] = 6;
                values[valuesById[7] = "APP_STATE_SYNC_KEY_REQUEST"] = 7;
                values[valuesById[8] = "MSG_FANOUT_BACKFILL_REQUEST"] = 8;
                values[valuesById[9] = "INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC"] = 9;
                values[valuesById[10] = "APP_STATE_FATAL_EXCEPTION_NOTIFICATION"] = 10;
                values[valuesById[11] = "SHARE_PHONE_NUMBER"] = 11;
                values[valuesById[14] = "MESSAGE_EDIT"] = 14;
                values[valuesById[16] = "PEER_DATA_OPERATION_REQUEST_MESSAGE"] = 16;
                values[valuesById[17] = "PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE"] = 17;
                values[valuesById[18] = "REQUEST_WELCOME_MESSAGE"] = 18;
                values[valuesById[19] = "BOT_FEEDBACK_MESSAGE"] = 19;
                values[valuesById[20] = "MEDIA_NOTIFY_MESSAGE"] = 20;
                values[valuesById[21] = "CLOUD_API_THREAD_CONTROL_NOTIFICATION"] = 21;
                values[valuesById[22] = "LID_MIGRATION_MAPPING_SYNC"] = 22;
                values[valuesById[23] = "REMINDER_MESSAGE"] = 23;
                values[valuesById[24] = "BOT_MEMU_ONBOARDING_MESSAGE"] = 24;
                values[valuesById[25] = "STATUS_MENTION_MESSAGE"] = 25;
                values[valuesById[26] = "STOP_GENERATION_MESSAGE"] = 26;
                values[valuesById[27] = "LIMIT_SHARING"] = 27;
                values[valuesById[28] = "AI_PSI_METADATA"] = 28;
                values[valuesById[29] = "AI_QUERY_FANOUT"] = 29;
                values[valuesById[30] = "GROUP_MEMBER_LABEL_CHANGE"] = 30;
                return values;
            })();

            return ProtocolMessage;
        })();

        Message.QuestionResponseMessage = (function() {

            function QuestionResponseMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            QuestionResponseMessage.prototype.key = null;
            QuestionResponseMessage.prototype.text = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuestionResponseMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuestionResponseMessage.prototype, "_text", {
                get: $util.oneOfGetter($oneOfFields = ["text"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            QuestionResponseMessage.create = function create(properties) {
                return new QuestionResponseMessage(properties);
            };

            QuestionResponseMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                    w.uint32(18).string(m.text);
                return w;
            };

            QuestionResponseMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.QuestionResponseMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.text = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            QuestionResponseMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.QuestionResponseMessage)
                    return d;
                var m = new $root.proto.Message.QuestionResponseMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.QuestionResponseMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                if (d.text != null) {
                    m.text = String(d.text);
                }
                return m;
            };

            QuestionResponseMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.text != null && m.hasOwnProperty("text")) {
                    d.text = m.text;
                    if (o.oneofs)
                        d._text = "text";
                }
                return d;
            };

            QuestionResponseMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            QuestionResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.QuestionResponseMessage";
            };

            return QuestionResponseMessage;
        })();

        Message.ReactionMessage = (function() {

            function ReactionMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ReactionMessage.prototype.key = null;
            ReactionMessage.prototype.text = null;
            ReactionMessage.prototype.groupingKey = null;
            ReactionMessage.prototype.senderTimestampMs = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ReactionMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ReactionMessage.prototype, "_text", {
                get: $util.oneOfGetter($oneOfFields = ["text"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ReactionMessage.prototype, "_groupingKey", {
                get: $util.oneOfGetter($oneOfFields = ["groupingKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ReactionMessage.prototype, "_senderTimestampMs", {
                get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ReactionMessage.create = function create(properties) {
                return new ReactionMessage(properties);
            };

            ReactionMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                    w.uint32(18).string(m.text);
                if (m.groupingKey != null && Object.hasOwnProperty.call(m, "groupingKey"))
                    w.uint32(26).string(m.groupingKey);
                if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
                    w.uint32(32).int64(m.senderTimestampMs);
                return w;
            };

            ReactionMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ReactionMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.text = r.string();
                            break;
                        }
                    case 3: {
                            m.groupingKey = r.string();
                            break;
                        }
                    case 4: {
                            m.senderTimestampMs = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ReactionMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ReactionMessage)
                    return d;
                var m = new $root.proto.Message.ReactionMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.ReactionMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                if (d.text != null) {
                    m.text = String(d.text);
                }
                if (d.groupingKey != null) {
                    m.groupingKey = String(d.groupingKey);
                }
                if (d.senderTimestampMs != null) {
                    if ($util.Long)
                        (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
                    else if (typeof d.senderTimestampMs === "string")
                        m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
                    else if (typeof d.senderTimestampMs === "number")
                        m.senderTimestampMs = d.senderTimestampMs;
                    else if (typeof d.senderTimestampMs === "object")
                        m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
                }
                return m;
            };

            ReactionMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.text != null && m.hasOwnProperty("text")) {
                    d.text = m.text;
                    if (o.oneofs)
                        d._text = "text";
                }
                if (m.groupingKey != null && m.hasOwnProperty("groupingKey")) {
                    d.groupingKey = m.groupingKey;
                    if (o.oneofs)
                        d._groupingKey = "groupingKey";
                }
                if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
                    if (typeof m.senderTimestampMs === "number")
                        d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
                    else
                        d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
                    if (o.oneofs)
                        d._senderTimestampMs = "senderTimestampMs";
                }
                return d;
            };

            ReactionMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ReactionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ReactionMessage";
            };

            return ReactionMessage;
        })();

        Message.RequestPaymentMessage = (function() {

            function RequestPaymentMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            RequestPaymentMessage.prototype.noteMessage = null;
            RequestPaymentMessage.prototype.currencyCodeIso4217 = null;
            RequestPaymentMessage.prototype.amount1000 = null;
            RequestPaymentMessage.prototype.requestFrom = null;
            RequestPaymentMessage.prototype.expiryTimestamp = null;
            RequestPaymentMessage.prototype.amount = null;
            RequestPaymentMessage.prototype.background = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestPaymentMessage.prototype, "_noteMessage", {
                get: $util.oneOfGetter($oneOfFields = ["noteMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestPaymentMessage.prototype, "_currencyCodeIso4217", {
                get: $util.oneOfGetter($oneOfFields = ["currencyCodeIso4217"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestPaymentMessage.prototype, "_amount1000", {
                get: $util.oneOfGetter($oneOfFields = ["amount1000"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestPaymentMessage.prototype, "_requestFrom", {
                get: $util.oneOfGetter($oneOfFields = ["requestFrom"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestPaymentMessage.prototype, "_expiryTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["expiryTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestPaymentMessage.prototype, "_amount", {
                get: $util.oneOfGetter($oneOfFields = ["amount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestPaymentMessage.prototype, "_background", {
                get: $util.oneOfGetter($oneOfFields = ["background"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            RequestPaymentMessage.create = function create(properties) {
                return new RequestPaymentMessage(properties);
            };

            RequestPaymentMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.currencyCodeIso4217 != null && Object.hasOwnProperty.call(m, "currencyCodeIso4217"))
                    w.uint32(10).string(m.currencyCodeIso4217);
                if (m.amount1000 != null && Object.hasOwnProperty.call(m, "amount1000"))
                    w.uint32(16).uint64(m.amount1000);
                if (m.requestFrom != null && Object.hasOwnProperty.call(m, "requestFrom"))
                    w.uint32(26).string(m.requestFrom);
                if (m.noteMessage != null && Object.hasOwnProperty.call(m, "noteMessage"))
                    $root.proto.Message.encode(m.noteMessage, w.uint32(34).fork()).ldelim();
                if (m.expiryTimestamp != null && Object.hasOwnProperty.call(m, "expiryTimestamp"))
                    w.uint32(40).int64(m.expiryTimestamp);
                if (m.amount != null && Object.hasOwnProperty.call(m, "amount"))
                    $root.proto.Money.encode(m.amount, w.uint32(50).fork()).ldelim();
                if (m.background != null && Object.hasOwnProperty.call(m, "background"))
                    $root.proto.PaymentBackground.encode(m.background, w.uint32(58).fork()).ldelim();
                return w;
            };

            RequestPaymentMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.RequestPaymentMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 4: {
                            m.noteMessage = $root.proto.Message.decode(r, r.uint32());
                            break;
                        }
                    case 1: {
                            m.currencyCodeIso4217 = r.string();
                            break;
                        }
                    case 2: {
                            m.amount1000 = r.uint64();
                            break;
                        }
                    case 3: {
                            m.requestFrom = r.string();
                            break;
                        }
                    case 5: {
                            m.expiryTimestamp = r.int64();
                            break;
                        }
                    case 6: {
                            m.amount = $root.proto.Money.decode(r, r.uint32());
                            break;
                        }
                    case 7: {
                            m.background = $root.proto.PaymentBackground.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            RequestPaymentMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.RequestPaymentMessage)
                    return d;
                var m = new $root.proto.Message.RequestPaymentMessage();
                if (d.noteMessage != null) {
                    if (typeof d.noteMessage !== "object")
                        throw TypeError(".proto.Message.RequestPaymentMessage.noteMessage: object expected");
                    m.noteMessage = $root.proto.Message.fromObject(d.noteMessage);
                }
                if (d.currencyCodeIso4217 != null) {
                    m.currencyCodeIso4217 = String(d.currencyCodeIso4217);
                }
                if (d.amount1000 != null) {
                    if ($util.Long)
                        (m.amount1000 = $util.Long.fromValue(d.amount1000)).unsigned = true;
                    else if (typeof d.amount1000 === "string")
                        m.amount1000 = parseInt(d.amount1000, 10);
                    else if (typeof d.amount1000 === "number")
                        m.amount1000 = d.amount1000;
                    else if (typeof d.amount1000 === "object")
                        m.amount1000 = new $util.LongBits(d.amount1000.low >>> 0, d.amount1000.high >>> 0).toNumber(true);
                }
                if (d.requestFrom != null) {
                    m.requestFrom = String(d.requestFrom);
                }
                if (d.expiryTimestamp != null) {
                    if ($util.Long)
                        (m.expiryTimestamp = $util.Long.fromValue(d.expiryTimestamp)).unsigned = false;
                    else if (typeof d.expiryTimestamp === "string")
                        m.expiryTimestamp = parseInt(d.expiryTimestamp, 10);
                    else if (typeof d.expiryTimestamp === "number")
                        m.expiryTimestamp = d.expiryTimestamp;
                    else if (typeof d.expiryTimestamp === "object")
                        m.expiryTimestamp = new $util.LongBits(d.expiryTimestamp.low >>> 0, d.expiryTimestamp.high >>> 0).toNumber();
                }
                if (d.amount != null) {
                    if (typeof d.amount !== "object")
                        throw TypeError(".proto.Message.RequestPaymentMessage.amount: object expected");
                    m.amount = $root.proto.Money.fromObject(d.amount);
                }
                if (d.background != null) {
                    if (typeof d.background !== "object")
                        throw TypeError(".proto.Message.RequestPaymentMessage.background: object expected");
                    m.background = $root.proto.PaymentBackground.fromObject(d.background);
                }
                return m;
            };

            RequestPaymentMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.currencyCodeIso4217 != null && m.hasOwnProperty("currencyCodeIso4217")) {
                    d.currencyCodeIso4217 = m.currencyCodeIso4217;
                    if (o.oneofs)
                        d._currencyCodeIso4217 = "currencyCodeIso4217";
                }
                if (m.amount1000 != null && m.hasOwnProperty("amount1000")) {
                    if (typeof m.amount1000 === "number")
                        d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000;
                    else
                        d.amount1000 = o.longs === String ? longToString(m.amount1000, true) : o.longs === Number ? longToNumber(m.amount1000, true) : m.amount1000;
                    if (o.oneofs)
                        d._amount1000 = "amount1000";
                }
                if (m.requestFrom != null && m.hasOwnProperty("requestFrom")) {
                    d.requestFrom = m.requestFrom;
                    if (o.oneofs)
                        d._requestFrom = "requestFrom";
                }
                if (m.noteMessage != null && m.hasOwnProperty("noteMessage")) {
                    d.noteMessage = $root.proto.Message.toObject(m.noteMessage, o);
                    if (o.oneofs)
                        d._noteMessage = "noteMessage";
                }
                if (m.expiryTimestamp != null && m.hasOwnProperty("expiryTimestamp")) {
                    if (typeof m.expiryTimestamp === "number")
                        d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp;
                    else
                        d.expiryTimestamp = o.longs === String ? longToString(m.expiryTimestamp) : o.longs === Number ? longToNumber(m.expiryTimestamp) : m.expiryTimestamp;
                    if (o.oneofs)
                        d._expiryTimestamp = "expiryTimestamp";
                }
                if (m.amount != null && m.hasOwnProperty("amount")) {
                    d.amount = $root.proto.Money.toObject(m.amount, o);
                    if (o.oneofs)
                        d._amount = "amount";
                }
                if (m.background != null && m.hasOwnProperty("background")) {
                    d.background = $root.proto.PaymentBackground.toObject(m.background, o);
                    if (o.oneofs)
                        d._background = "background";
                }
                return d;
            };

            RequestPaymentMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            RequestPaymentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.RequestPaymentMessage";
            };

            return RequestPaymentMessage;
        })();

        Message.RequestPhoneNumberMessage = (function() {

            function RequestPhoneNumberMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            RequestPhoneNumberMessage.prototype.contextInfo = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestPhoneNumberMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            RequestPhoneNumberMessage.create = function create(properties) {
                return new RequestPhoneNumberMessage(properties);
            };

            RequestPhoneNumberMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(10).fork()).ldelim();
                return w;
            };

            RequestPhoneNumberMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.RequestPhoneNumberMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            RequestPhoneNumberMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.RequestPhoneNumberMessage)
                    return d;
                var m = new $root.proto.Message.RequestPhoneNumberMessage();
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.RequestPhoneNumberMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                return m;
            };

            RequestPhoneNumberMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                return d;
            };

            RequestPhoneNumberMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            RequestPhoneNumberMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.RequestPhoneNumberMessage";
            };

            return RequestPhoneNumberMessage;
        })();

        Message.RequestWelcomeMessageMetadata = (function() {

            function RequestWelcomeMessageMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            RequestWelcomeMessageMetadata.prototype.localChatState = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RequestWelcomeMessageMetadata.prototype, "_localChatState", {
                get: $util.oneOfGetter($oneOfFields = ["localChatState"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            RequestWelcomeMessageMetadata.create = function create(properties) {
                return new RequestWelcomeMessageMetadata(properties);
            };

            RequestWelcomeMessageMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.localChatState != null && Object.hasOwnProperty.call(m, "localChatState"))
                    w.uint32(8).int32(m.localChatState);
                return w;
            };

            RequestWelcomeMessageMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.RequestWelcomeMessageMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.localChatState = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            RequestWelcomeMessageMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.RequestWelcomeMessageMetadata)
                    return d;
                var m = new $root.proto.Message.RequestWelcomeMessageMetadata();
                switch (d.localChatState) {
                default:
                    if (typeof d.localChatState === "number") {
                        m.localChatState = d.localChatState;
                        break;
                    }
                    break;
                case "EMPTY":
                case 0:
                    m.localChatState = 0;
                    break;
                case "NON_EMPTY":
                case 1:
                    m.localChatState = 1;
                    break;
                }
                return m;
            };

            RequestWelcomeMessageMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.localChatState != null && m.hasOwnProperty("localChatState")) {
                    d.localChatState = o.enums === String ? $root.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[m.localChatState] === undefined ? m.localChatState : $root.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[m.localChatState] : m.localChatState;
                    if (o.oneofs)
                        d._localChatState = "localChatState";
                }
                return d;
            };

            RequestWelcomeMessageMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            RequestWelcomeMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.RequestWelcomeMessageMetadata";
            };

            RequestWelcomeMessageMetadata.LocalChatState = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "EMPTY"] = 0;
                values[valuesById[1] = "NON_EMPTY"] = 1;
                return values;
            })();

            return RequestWelcomeMessageMetadata;
        })();

        Message.ScheduledCallCreationMessage = (function() {

            function ScheduledCallCreationMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ScheduledCallCreationMessage.prototype.scheduledTimestampMs = null;
            ScheduledCallCreationMessage.prototype.callType = null;
            ScheduledCallCreationMessage.prototype.title = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ScheduledCallCreationMessage.prototype, "_scheduledTimestampMs", {
                get: $util.oneOfGetter($oneOfFields = ["scheduledTimestampMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ScheduledCallCreationMessage.prototype, "_callType", {
                get: $util.oneOfGetter($oneOfFields = ["callType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ScheduledCallCreationMessage.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ScheduledCallCreationMessage.create = function create(properties) {
                return new ScheduledCallCreationMessage(properties);
            };

            ScheduledCallCreationMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.scheduledTimestampMs != null && Object.hasOwnProperty.call(m, "scheduledTimestampMs"))
                    w.uint32(8).int64(m.scheduledTimestampMs);
                if (m.callType != null && Object.hasOwnProperty.call(m, "callType"))
                    w.uint32(16).int32(m.callType);
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(26).string(m.title);
                return w;
            };

            ScheduledCallCreationMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ScheduledCallCreationMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.scheduledTimestampMs = r.int64();
                            break;
                        }
                    case 2: {
                            m.callType = r.int32();
                            break;
                        }
                    case 3: {
                            m.title = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ScheduledCallCreationMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ScheduledCallCreationMessage)
                    return d;
                var m = new $root.proto.Message.ScheduledCallCreationMessage();
                if (d.scheduledTimestampMs != null) {
                    if ($util.Long)
                        (m.scheduledTimestampMs = $util.Long.fromValue(d.scheduledTimestampMs)).unsigned = false;
                    else if (typeof d.scheduledTimestampMs === "string")
                        m.scheduledTimestampMs = parseInt(d.scheduledTimestampMs, 10);
                    else if (typeof d.scheduledTimestampMs === "number")
                        m.scheduledTimestampMs = d.scheduledTimestampMs;
                    else if (typeof d.scheduledTimestampMs === "object")
                        m.scheduledTimestampMs = new $util.LongBits(d.scheduledTimestampMs.low >>> 0, d.scheduledTimestampMs.high >>> 0).toNumber();
                }
                switch (d.callType) {
                default:
                    if (typeof d.callType === "number") {
                        m.callType = d.callType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.callType = 0;
                    break;
                case "VOICE":
                case 1:
                    m.callType = 1;
                    break;
                case "VIDEO":
                case 2:
                    m.callType = 2;
                    break;
                }
                if (d.title != null) {
                    m.title = String(d.title);
                }
                return m;
            };

            ScheduledCallCreationMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.scheduledTimestampMs != null && m.hasOwnProperty("scheduledTimestampMs")) {
                    if (typeof m.scheduledTimestampMs === "number")
                        d.scheduledTimestampMs = o.longs === String ? String(m.scheduledTimestampMs) : m.scheduledTimestampMs;
                    else
                        d.scheduledTimestampMs = o.longs === String ? longToString(m.scheduledTimestampMs) : o.longs === Number ? longToNumber(m.scheduledTimestampMs) : m.scheduledTimestampMs;
                    if (o.oneofs)
                        d._scheduledTimestampMs = "scheduledTimestampMs";
                }
                if (m.callType != null && m.hasOwnProperty("callType")) {
                    d.callType = o.enums === String ? $root.proto.Message.ScheduledCallCreationMessage.CallType[m.callType] === undefined ? m.callType : $root.proto.Message.ScheduledCallCreationMessage.CallType[m.callType] : m.callType;
                    if (o.oneofs)
                        d._callType = "callType";
                }
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                return d;
            };

            ScheduledCallCreationMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ScheduledCallCreationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ScheduledCallCreationMessage";
            };

            ScheduledCallCreationMessage.CallType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "VOICE"] = 1;
                values[valuesById[2] = "VIDEO"] = 2;
                return values;
            })();

            return ScheduledCallCreationMessage;
        })();

        Message.ScheduledCallEditMessage = (function() {

            function ScheduledCallEditMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ScheduledCallEditMessage.prototype.key = null;
            ScheduledCallEditMessage.prototype.editType = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ScheduledCallEditMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ScheduledCallEditMessage.prototype, "_editType", {
                get: $util.oneOfGetter($oneOfFields = ["editType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ScheduledCallEditMessage.create = function create(properties) {
                return new ScheduledCallEditMessage(properties);
            };

            ScheduledCallEditMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.editType != null && Object.hasOwnProperty.call(m, "editType"))
                    w.uint32(16).int32(m.editType);
                return w;
            };

            ScheduledCallEditMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.ScheduledCallEditMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.editType = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ScheduledCallEditMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.ScheduledCallEditMessage)
                    return d;
                var m = new $root.proto.Message.ScheduledCallEditMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.ScheduledCallEditMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                switch (d.editType) {
                default:
                    if (typeof d.editType === "number") {
                        m.editType = d.editType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.editType = 0;
                    break;
                case "CANCEL":
                case 1:
                    m.editType = 1;
                    break;
                }
                return m;
            };

            ScheduledCallEditMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.editType != null && m.hasOwnProperty("editType")) {
                    d.editType = o.enums === String ? $root.proto.Message.ScheduledCallEditMessage.EditType[m.editType] === undefined ? m.editType : $root.proto.Message.ScheduledCallEditMessage.EditType[m.editType] : m.editType;
                    if (o.oneofs)
                        d._editType = "editType";
                }
                return d;
            };

            ScheduledCallEditMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ScheduledCallEditMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.ScheduledCallEditMessage";
            };

            ScheduledCallEditMessage.EditType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "CANCEL"] = 1;
                return values;
            })();

            return ScheduledCallEditMessage;
        })();

        Message.SecretEncryptedMessage = (function() {

            function SecretEncryptedMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SecretEncryptedMessage.prototype.targetMessageKey = null;
            SecretEncryptedMessage.prototype.encPayload = null;
            SecretEncryptedMessage.prototype.encIv = null;
            SecretEncryptedMessage.prototype.secretEncType = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SecretEncryptedMessage.prototype, "_targetMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SecretEncryptedMessage.prototype, "_encPayload", {
                get: $util.oneOfGetter($oneOfFields = ["encPayload"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SecretEncryptedMessage.prototype, "_encIv", {
                get: $util.oneOfGetter($oneOfFields = ["encIv"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SecretEncryptedMessage.prototype, "_secretEncType", {
                get: $util.oneOfGetter($oneOfFields = ["secretEncType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SecretEncryptedMessage.create = function create(properties) {
                return new SecretEncryptedMessage(properties);
            };

            SecretEncryptedMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.targetMessageKey != null && Object.hasOwnProperty.call(m, "targetMessageKey"))
                    $root.proto.MessageKey.encode(m.targetMessageKey, w.uint32(10).fork()).ldelim();
                if (m.encPayload != null && Object.hasOwnProperty.call(m, "encPayload"))
                    w.uint32(18).bytes(m.encPayload);
                if (m.encIv != null && Object.hasOwnProperty.call(m, "encIv"))
                    w.uint32(26).bytes(m.encIv);
                if (m.secretEncType != null && Object.hasOwnProperty.call(m, "secretEncType"))
                    w.uint32(32).int32(m.secretEncType);
                return w;
            };

            SecretEncryptedMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.SecretEncryptedMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.targetMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.encPayload = r.bytes();
                            break;
                        }
                    case 3: {
                            m.encIv = r.bytes();
                            break;
                        }
                    case 4: {
                            m.secretEncType = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SecretEncryptedMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.SecretEncryptedMessage)
                    return d;
                var m = new $root.proto.Message.SecretEncryptedMessage();
                if (d.targetMessageKey != null) {
                    if (typeof d.targetMessageKey !== "object")
                        throw TypeError(".proto.Message.SecretEncryptedMessage.targetMessageKey: object expected");
                    m.targetMessageKey = $root.proto.MessageKey.fromObject(d.targetMessageKey);
                }
                if (d.encPayload != null) {
                    if (typeof d.encPayload === "string")
                        $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0);
                    else if (d.encPayload.length >= 0)
                        m.encPayload = d.encPayload;
                }
                if (d.encIv != null) {
                    if (typeof d.encIv === "string")
                        $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0);
                    else if (d.encIv.length >= 0)
                        m.encIv = d.encIv;
                }
                switch (d.secretEncType) {
                default:
                    if (typeof d.secretEncType === "number") {
                        m.secretEncType = d.secretEncType;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.secretEncType = 0;
                    break;
                case "EVENT_EDIT":
                case 1:
                    m.secretEncType = 1;
                    break;
                case "MESSAGE_EDIT":
                case 2:
                    m.secretEncType = 2;
                    break;
                }
                return m;
            };

            SecretEncryptedMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) {
                    d.targetMessageKey = $root.proto.MessageKey.toObject(m.targetMessageKey, o);
                    if (o.oneofs)
                        d._targetMessageKey = "targetMessageKey";
                }
                if (m.encPayload != null && m.hasOwnProperty("encPayload")) {
                    d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload;
                    if (o.oneofs)
                        d._encPayload = "encPayload";
                }
                if (m.encIv != null && m.hasOwnProperty("encIv")) {
                    d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv;
                    if (o.oneofs)
                        d._encIv = "encIv";
                }
                if (m.secretEncType != null && m.hasOwnProperty("secretEncType")) {
                    d.secretEncType = o.enums === String ? $root.proto.Message.SecretEncryptedMessage.SecretEncType[m.secretEncType] === undefined ? m.secretEncType : $root.proto.Message.SecretEncryptedMessage.SecretEncType[m.secretEncType] : m.secretEncType;
                    if (o.oneofs)
                        d._secretEncType = "secretEncType";
                }
                return d;
            };

            SecretEncryptedMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SecretEncryptedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.SecretEncryptedMessage";
            };

            SecretEncryptedMessage.SecretEncType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "EVENT_EDIT"] = 1;
                values[valuesById[2] = "MESSAGE_EDIT"] = 2;
                return values;
            })();

            return SecretEncryptedMessage;
        })();

        Message.SendPaymentMessage = (function() {

            function SendPaymentMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SendPaymentMessage.prototype.noteMessage = null;
            SendPaymentMessage.prototype.requestMessageKey = null;
            SendPaymentMessage.prototype.background = null;
            SendPaymentMessage.prototype.transactionData = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SendPaymentMessage.prototype, "_noteMessage", {
                get: $util.oneOfGetter($oneOfFields = ["noteMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SendPaymentMessage.prototype, "_requestMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["requestMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SendPaymentMessage.prototype, "_background", {
                get: $util.oneOfGetter($oneOfFields = ["background"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SendPaymentMessage.prototype, "_transactionData", {
                get: $util.oneOfGetter($oneOfFields = ["transactionData"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SendPaymentMessage.create = function create(properties) {
                return new SendPaymentMessage(properties);
            };

            SendPaymentMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.noteMessage != null && Object.hasOwnProperty.call(m, "noteMessage"))
                    $root.proto.Message.encode(m.noteMessage, w.uint32(18).fork()).ldelim();
                if (m.requestMessageKey != null && Object.hasOwnProperty.call(m, "requestMessageKey"))
                    $root.proto.MessageKey.encode(m.requestMessageKey, w.uint32(26).fork()).ldelim();
                if (m.background != null && Object.hasOwnProperty.call(m, "background"))
                    $root.proto.PaymentBackground.encode(m.background, w.uint32(34).fork()).ldelim();
                if (m.transactionData != null && Object.hasOwnProperty.call(m, "transactionData"))
                    w.uint32(42).string(m.transactionData);
                return w;
            };

            SendPaymentMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.SendPaymentMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 2: {
                            m.noteMessage = $root.proto.Message.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.requestMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.background = $root.proto.PaymentBackground.decode(r, r.uint32());
                            break;
                        }
                    case 5: {
                            m.transactionData = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SendPaymentMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.SendPaymentMessage)
                    return d;
                var m = new $root.proto.Message.SendPaymentMessage();
                if (d.noteMessage != null) {
                    if (typeof d.noteMessage !== "object")
                        throw TypeError(".proto.Message.SendPaymentMessage.noteMessage: object expected");
                    m.noteMessage = $root.proto.Message.fromObject(d.noteMessage);
                }
                if (d.requestMessageKey != null) {
                    if (typeof d.requestMessageKey !== "object")
                        throw TypeError(".proto.Message.SendPaymentMessage.requestMessageKey: object expected");
                    m.requestMessageKey = $root.proto.MessageKey.fromObject(d.requestMessageKey);
                }
                if (d.background != null) {
                    if (typeof d.background !== "object")
                        throw TypeError(".proto.Message.SendPaymentMessage.background: object expected");
                    m.background = $root.proto.PaymentBackground.fromObject(d.background);
                }
                if (d.transactionData != null) {
                    m.transactionData = String(d.transactionData);
                }
                return m;
            };

            SendPaymentMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.noteMessage != null && m.hasOwnProperty("noteMessage")) {
                    d.noteMessage = $root.proto.Message.toObject(m.noteMessage, o);
                    if (o.oneofs)
                        d._noteMessage = "noteMessage";
                }
                if (m.requestMessageKey != null && m.hasOwnProperty("requestMessageKey")) {
                    d.requestMessageKey = $root.proto.MessageKey.toObject(m.requestMessageKey, o);
                    if (o.oneofs)
                        d._requestMessageKey = "requestMessageKey";
                }
                if (m.background != null && m.hasOwnProperty("background")) {
                    d.background = $root.proto.PaymentBackground.toObject(m.background, o);
                    if (o.oneofs)
                        d._background = "background";
                }
                if (m.transactionData != null && m.hasOwnProperty("transactionData")) {
                    d.transactionData = m.transactionData;
                    if (o.oneofs)
                        d._transactionData = "transactionData";
                }
                return d;
            };

            SendPaymentMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SendPaymentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.SendPaymentMessage";
            };

            return SendPaymentMessage;
        })();

        Message.SenderKeyDistributionMessage = (function() {

            function SenderKeyDistributionMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SenderKeyDistributionMessage.prototype.groupId = null;
            SenderKeyDistributionMessage.prototype.axolotlSenderKeyDistributionMessage = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SenderKeyDistributionMessage.prototype, "_groupId", {
                get: $util.oneOfGetter($oneOfFields = ["groupId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SenderKeyDistributionMessage.prototype, "_axolotlSenderKeyDistributionMessage", {
                get: $util.oneOfGetter($oneOfFields = ["axolotlSenderKeyDistributionMessage"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SenderKeyDistributionMessage.create = function create(properties) {
                return new SenderKeyDistributionMessage(properties);
            };

            SenderKeyDistributionMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.groupId != null && Object.hasOwnProperty.call(m, "groupId"))
                    w.uint32(10).string(m.groupId);
                if (m.axolotlSenderKeyDistributionMessage != null && Object.hasOwnProperty.call(m, "axolotlSenderKeyDistributionMessage"))
                    w.uint32(18).bytes(m.axolotlSenderKeyDistributionMessage);
                return w;
            };

            SenderKeyDistributionMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.SenderKeyDistributionMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.groupId = r.string();
                            break;
                        }
                    case 2: {
                            m.axolotlSenderKeyDistributionMessage = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SenderKeyDistributionMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.SenderKeyDistributionMessage)
                    return d;
                var m = new $root.proto.Message.SenderKeyDistributionMessage();
                if (d.groupId != null) {
                    m.groupId = String(d.groupId);
                }
                if (d.axolotlSenderKeyDistributionMessage != null) {
                    if (typeof d.axolotlSenderKeyDistributionMessage === "string")
                        $util.base64.decode(d.axolotlSenderKeyDistributionMessage, m.axolotlSenderKeyDistributionMessage = $util.newBuffer($util.base64.length(d.axolotlSenderKeyDistributionMessage)), 0);
                    else if (d.axolotlSenderKeyDistributionMessage.length >= 0)
                        m.axolotlSenderKeyDistributionMessage = d.axolotlSenderKeyDistributionMessage;
                }
                return m;
            };

            SenderKeyDistributionMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.groupId != null && m.hasOwnProperty("groupId")) {
                    d.groupId = m.groupId;
                    if (o.oneofs)
                        d._groupId = "groupId";
                }
                if (m.axolotlSenderKeyDistributionMessage != null && m.hasOwnProperty("axolotlSenderKeyDistributionMessage")) {
                    d.axolotlSenderKeyDistributionMessage = o.bytes === String ? $util.base64.encode(m.axolotlSenderKeyDistributionMessage, 0, m.axolotlSenderKeyDistributionMessage.length) : o.bytes === Array ? Array.prototype.slice.call(m.axolotlSenderKeyDistributionMessage) : m.axolotlSenderKeyDistributionMessage;
                    if (o.oneofs)
                        d._axolotlSenderKeyDistributionMessage = "axolotlSenderKeyDistributionMessage";
                }
                return d;
            };

            SenderKeyDistributionMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SenderKeyDistributionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.SenderKeyDistributionMessage";
            };

            return SenderKeyDistributionMessage;
        })();

        Message.StatusNotificationMessage = (function() {

            function StatusNotificationMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StatusNotificationMessage.prototype.responseMessageKey = null;
            StatusNotificationMessage.prototype.originalMessageKey = null;
            StatusNotificationMessage.prototype.type = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusNotificationMessage.prototype, "_responseMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["responseMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusNotificationMessage.prototype, "_originalMessageKey", {
                get: $util.oneOfGetter($oneOfFields = ["originalMessageKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusNotificationMessage.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StatusNotificationMessage.create = function create(properties) {
                return new StatusNotificationMessage(properties);
            };

            StatusNotificationMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.responseMessageKey != null && Object.hasOwnProperty.call(m, "responseMessageKey"))
                    $root.proto.MessageKey.encode(m.responseMessageKey, w.uint32(10).fork()).ldelim();
                if (m.originalMessageKey != null && Object.hasOwnProperty.call(m, "originalMessageKey"))
                    $root.proto.MessageKey.encode(m.originalMessageKey, w.uint32(18).fork()).ldelim();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(24).int32(m.type);
                return w;
            };

            StatusNotificationMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.StatusNotificationMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.responseMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.originalMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 3: {
                            m.type = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StatusNotificationMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.StatusNotificationMessage)
                    return d;
                var m = new $root.proto.Message.StatusNotificationMessage();
                if (d.responseMessageKey != null) {
                    if (typeof d.responseMessageKey !== "object")
                        throw TypeError(".proto.Message.StatusNotificationMessage.responseMessageKey: object expected");
                    m.responseMessageKey = $root.proto.MessageKey.fromObject(d.responseMessageKey);
                }
                if (d.originalMessageKey != null) {
                    if (typeof d.originalMessageKey !== "object")
                        throw TypeError(".proto.Message.StatusNotificationMessage.originalMessageKey: object expected");
                    m.originalMessageKey = $root.proto.MessageKey.fromObject(d.originalMessageKey);
                }
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.type = 0;
                    break;
                case "STATUS_ADD_YOURS":
                case 1:
                    m.type = 1;
                    break;
                case "STATUS_RESHARE":
                case 2:
                    m.type = 2;
                    break;
                case "STATUS_QUESTION_ANSWER_RESHARE":
                case 3:
                    m.type = 3;
                    break;
                }
                return m;
            };

            StatusNotificationMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.responseMessageKey != null && m.hasOwnProperty("responseMessageKey")) {
                    d.responseMessageKey = $root.proto.MessageKey.toObject(m.responseMessageKey, o);
                    if (o.oneofs)
                        d._responseMessageKey = "responseMessageKey";
                }
                if (m.originalMessageKey != null && m.hasOwnProperty("originalMessageKey")) {
                    d.originalMessageKey = $root.proto.MessageKey.toObject(m.originalMessageKey, o);
                    if (o.oneofs)
                        d._originalMessageKey = "originalMessageKey";
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.Message.StatusNotificationMessage.StatusNotificationType[m.type] === undefined ? m.type : $root.proto.Message.StatusNotificationMessage.StatusNotificationType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                return d;
            };

            StatusNotificationMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StatusNotificationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.StatusNotificationMessage";
            };

            StatusNotificationMessage.StatusNotificationType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "STATUS_ADD_YOURS"] = 1;
                values[valuesById[2] = "STATUS_RESHARE"] = 2;
                values[valuesById[3] = "STATUS_QUESTION_ANSWER_RESHARE"] = 3;
                return values;
            })();

            return StatusNotificationMessage;
        })();

        Message.StatusQuestionAnswerMessage = (function() {

            function StatusQuestionAnswerMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StatusQuestionAnswerMessage.prototype.key = null;
            StatusQuestionAnswerMessage.prototype.text = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusQuestionAnswerMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusQuestionAnswerMessage.prototype, "_text", {
                get: $util.oneOfGetter($oneOfFields = ["text"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StatusQuestionAnswerMessage.create = function create(properties) {
                return new StatusQuestionAnswerMessage(properties);
            };

            StatusQuestionAnswerMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                    w.uint32(18).string(m.text);
                return w;
            };

            StatusQuestionAnswerMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.StatusQuestionAnswerMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.text = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StatusQuestionAnswerMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.StatusQuestionAnswerMessage)
                    return d;
                var m = new $root.proto.Message.StatusQuestionAnswerMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.StatusQuestionAnswerMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                if (d.text != null) {
                    m.text = String(d.text);
                }
                return m;
            };

            StatusQuestionAnswerMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.text != null && m.hasOwnProperty("text")) {
                    d.text = m.text;
                    if (o.oneofs)
                        d._text = "text";
                }
                return d;
            };

            StatusQuestionAnswerMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StatusQuestionAnswerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.StatusQuestionAnswerMessage";
            };

            return StatusQuestionAnswerMessage;
        })();

        Message.StatusQuotedMessage = (function() {

            function StatusQuotedMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StatusQuotedMessage.prototype.type = null;
            StatusQuotedMessage.prototype.text = null;
            StatusQuotedMessage.prototype.thumbnail = null;
            StatusQuotedMessage.prototype.originalStatusId = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusQuotedMessage.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusQuotedMessage.prototype, "_text", {
                get: $util.oneOfGetter($oneOfFields = ["text"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusQuotedMessage.prototype, "_thumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusQuotedMessage.prototype, "_originalStatusId", {
                get: $util.oneOfGetter($oneOfFields = ["originalStatusId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StatusQuotedMessage.create = function create(properties) {
                return new StatusQuotedMessage(properties);
            };

            StatusQuotedMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(8).int32(m.type);
                if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                    w.uint32(18).string(m.text);
                if (m.thumbnail != null && Object.hasOwnProperty.call(m, "thumbnail"))
                    w.uint32(26).bytes(m.thumbnail);
                if (m.originalStatusId != null && Object.hasOwnProperty.call(m, "originalStatusId"))
                    $root.proto.MessageKey.encode(m.originalStatusId, w.uint32(34).fork()).ldelim();
                return w;
            };

            StatusQuotedMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.StatusQuotedMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.type = r.int32();
                            break;
                        }
                    case 2: {
                            m.text = r.string();
                            break;
                        }
                    case 3: {
                            m.thumbnail = r.bytes();
                            break;
                        }
                    case 4: {
                            m.originalStatusId = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StatusQuotedMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.StatusQuotedMessage)
                    return d;
                var m = new $root.proto.Message.StatusQuotedMessage();
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "QUESTION_ANSWER":
                case 1:
                    m.type = 1;
                    break;
                }
                if (d.text != null) {
                    m.text = String(d.text);
                }
                if (d.thumbnail != null) {
                    if (typeof d.thumbnail === "string")
                        $util.base64.decode(d.thumbnail, m.thumbnail = $util.newBuffer($util.base64.length(d.thumbnail)), 0);
                    else if (d.thumbnail.length >= 0)
                        m.thumbnail = d.thumbnail;
                }
                if (d.originalStatusId != null) {
                    if (typeof d.originalStatusId !== "object")
                        throw TypeError(".proto.Message.StatusQuotedMessage.originalStatusId: object expected");
                    m.originalStatusId = $root.proto.MessageKey.fromObject(d.originalStatusId);
                }
                return m;
            };

            StatusQuotedMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[m.type] === undefined ? m.type : $root.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                if (m.text != null && m.hasOwnProperty("text")) {
                    d.text = m.text;
                    if (o.oneofs)
                        d._text = "text";
                }
                if (m.thumbnail != null && m.hasOwnProperty("thumbnail")) {
                    d.thumbnail = o.bytes === String ? $util.base64.encode(m.thumbnail, 0, m.thumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnail) : m.thumbnail;
                    if (o.oneofs)
                        d._thumbnail = "thumbnail";
                }
                if (m.originalStatusId != null && m.hasOwnProperty("originalStatusId")) {
                    d.originalStatusId = $root.proto.MessageKey.toObject(m.originalStatusId, o);
                    if (o.oneofs)
                        d._originalStatusId = "originalStatusId";
                }
                return d;
            };

            StatusQuotedMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StatusQuotedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.StatusQuotedMessage";
            };

            StatusQuotedMessage.StatusQuotedMessageType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "QUESTION_ANSWER"] = 1;
                return values;
            })();

            return StatusQuotedMessage;
        })();

        Message.StatusStickerInteractionMessage = (function() {

            function StatusStickerInteractionMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StatusStickerInteractionMessage.prototype.key = null;
            StatusStickerInteractionMessage.prototype.stickerKey = null;
            StatusStickerInteractionMessage.prototype.type = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusStickerInteractionMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusStickerInteractionMessage.prototype, "_stickerKey", {
                get: $util.oneOfGetter($oneOfFields = ["stickerKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusStickerInteractionMessage.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StatusStickerInteractionMessage.create = function create(properties) {
                return new StatusStickerInteractionMessage(properties);
            };

            StatusStickerInteractionMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.stickerKey != null && Object.hasOwnProperty.call(m, "stickerKey"))
                    w.uint32(18).string(m.stickerKey);
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(24).int32(m.type);
                return w;
            };

            StatusStickerInteractionMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.StatusStickerInteractionMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.stickerKey = r.string();
                            break;
                        }
                    case 3: {
                            m.type = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StatusStickerInteractionMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.StatusStickerInteractionMessage)
                    return d;
                var m = new $root.proto.Message.StatusStickerInteractionMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.Message.StatusStickerInteractionMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                if (d.stickerKey != null) {
                    m.stickerKey = String(d.stickerKey);
                }
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.type = 0;
                    break;
                case "REACTION":
                case 1:
                    m.type = 1;
                    break;
                }
                return m;
            };

            StatusStickerInteractionMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.stickerKey != null && m.hasOwnProperty("stickerKey")) {
                    d.stickerKey = m.stickerKey;
                    if (o.oneofs)
                        d._stickerKey = "stickerKey";
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.Message.StatusStickerInteractionMessage.StatusStickerType[m.type] === undefined ? m.type : $root.proto.Message.StatusStickerInteractionMessage.StatusStickerType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                return d;
            };

            StatusStickerInteractionMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StatusStickerInteractionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.StatusStickerInteractionMessage";
            };

            StatusStickerInteractionMessage.StatusStickerType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "REACTION"] = 1;
                return values;
            })();

            return StatusStickerInteractionMessage;
        })();

        Message.StickerMessage = (function() {

            function StickerMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StickerMessage.prototype.url = null;
            StickerMessage.prototype.fileSha256 = null;
            StickerMessage.prototype.fileEncSha256 = null;
            StickerMessage.prototype.mediaKey = null;
            StickerMessage.prototype.mimetype = null;
            StickerMessage.prototype.height = null;
            StickerMessage.prototype.width = null;
            StickerMessage.prototype.directPath = null;
            StickerMessage.prototype.fileLength = null;
            StickerMessage.prototype.mediaKeyTimestamp = null;
            StickerMessage.prototype.firstFrameLength = null;
            StickerMessage.prototype.firstFrameSidecar = null;
            StickerMessage.prototype.isAnimated = null;
            StickerMessage.prototype.pngThumbnail = null;
            StickerMessage.prototype.contextInfo = null;
            StickerMessage.prototype.stickerSentTs = null;
            StickerMessage.prototype.isAvatar = null;
            StickerMessage.prototype.isAiSticker = null;
            StickerMessage.prototype.isLottie = null;
            StickerMessage.prototype.accessibilityLabel = null;
            StickerMessage.prototype.mediaKeyDomain = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_mimetype", {
                get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_height", {
                get: $util.oneOfGetter($oneOfFields = ["height"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_width", {
                get: $util.oneOfGetter($oneOfFields = ["width"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_fileLength", {
                get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_firstFrameLength", {
                get: $util.oneOfGetter($oneOfFields = ["firstFrameLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_firstFrameSidecar", {
                get: $util.oneOfGetter($oneOfFields = ["firstFrameSidecar"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_isAnimated", {
                get: $util.oneOfGetter($oneOfFields = ["isAnimated"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_pngThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["pngThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_stickerSentTs", {
                get: $util.oneOfGetter($oneOfFields = ["stickerSentTs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_isAvatar", {
                get: $util.oneOfGetter($oneOfFields = ["isAvatar"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_isAiSticker", {
                get: $util.oneOfGetter($oneOfFields = ["isAiSticker"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_isLottie", {
                get: $util.oneOfGetter($oneOfFields = ["isLottie"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_accessibilityLabel", {
                get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerMessage.prototype, "_mediaKeyDomain", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyDomain"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StickerMessage.create = function create(properties) {
                return new StickerMessage(properties);
            };

            StickerMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(10).string(m.url);
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(18).bytes(m.fileSha256);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(26).bytes(m.fileEncSha256);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(34).bytes(m.mediaKey);
                if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                    w.uint32(42).string(m.mimetype);
                if (m.height != null && Object.hasOwnProperty.call(m, "height"))
                    w.uint32(48).uint32(m.height);
                if (m.width != null && Object.hasOwnProperty.call(m, "width"))
                    w.uint32(56).uint32(m.width);
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(66).string(m.directPath);
                if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                    w.uint32(72).uint64(m.fileLength);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(80).int64(m.mediaKeyTimestamp);
                if (m.firstFrameLength != null && Object.hasOwnProperty.call(m, "firstFrameLength"))
                    w.uint32(88).uint32(m.firstFrameLength);
                if (m.firstFrameSidecar != null && Object.hasOwnProperty.call(m, "firstFrameSidecar"))
                    w.uint32(98).bytes(m.firstFrameSidecar);
                if (m.isAnimated != null && Object.hasOwnProperty.call(m, "isAnimated"))
                    w.uint32(104).bool(m.isAnimated);
                if (m.pngThumbnail != null && Object.hasOwnProperty.call(m, "pngThumbnail"))
                    w.uint32(130).bytes(m.pngThumbnail);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                if (m.stickerSentTs != null && Object.hasOwnProperty.call(m, "stickerSentTs"))
                    w.uint32(144).int64(m.stickerSentTs);
                if (m.isAvatar != null && Object.hasOwnProperty.call(m, "isAvatar"))
                    w.uint32(152).bool(m.isAvatar);
                if (m.isAiSticker != null && Object.hasOwnProperty.call(m, "isAiSticker"))
                    w.uint32(160).bool(m.isAiSticker);
                if (m.isLottie != null && Object.hasOwnProperty.call(m, "isLottie"))
                    w.uint32(168).bool(m.isLottie);
                if (m.accessibilityLabel != null && Object.hasOwnProperty.call(m, "accessibilityLabel"))
                    w.uint32(178).string(m.accessibilityLabel);
                if (m.mediaKeyDomain != null && Object.hasOwnProperty.call(m, "mediaKeyDomain"))
                    w.uint32(184).int32(m.mediaKeyDomain);
                return w;
            };

            StickerMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.StickerMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.url = r.string();
                            break;
                        }
                    case 2: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 3: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 4: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 5: {
                            m.mimetype = r.string();
                            break;
                        }
                    case 6: {
                            m.height = r.uint32();
                            break;
                        }
                    case 7: {
                            m.width = r.uint32();
                            break;
                        }
                    case 8: {
                            m.directPath = r.string();
                            break;
                        }
                    case 9: {
                            m.fileLength = r.uint64();
                            break;
                        }
                    case 10: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 11: {
                            m.firstFrameLength = r.uint32();
                            break;
                        }
                    case 12: {
                            m.firstFrameSidecar = r.bytes();
                            break;
                        }
                    case 13: {
                            m.isAnimated = r.bool();
                            break;
                        }
                    case 16: {
                            m.pngThumbnail = r.bytes();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 18: {
                            m.stickerSentTs = r.int64();
                            break;
                        }
                    case 19: {
                            m.isAvatar = r.bool();
                            break;
                        }
                    case 20: {
                            m.isAiSticker = r.bool();
                            break;
                        }
                    case 21: {
                            m.isLottie = r.bool();
                            break;
                        }
                    case 22: {
                            m.accessibilityLabel = r.string();
                            break;
                        }
                    case 23: {
                            m.mediaKeyDomain = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StickerMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.StickerMessage)
                    return d;
                var m = new $root.proto.Message.StickerMessage();
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.mimetype != null) {
                    m.mimetype = String(d.mimetype);
                }
                if (d.height != null) {
                    m.height = d.height >>> 0;
                }
                if (d.width != null) {
                    m.width = d.width >>> 0;
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                if (d.fileLength != null) {
                    if ($util.Long)
                        (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                    else if (typeof d.fileLength === "string")
                        m.fileLength = parseInt(d.fileLength, 10);
                    else if (typeof d.fileLength === "number")
                        m.fileLength = d.fileLength;
                    else if (typeof d.fileLength === "object")
                        m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.firstFrameLength != null) {
                    m.firstFrameLength = d.firstFrameLength >>> 0;
                }
                if (d.firstFrameSidecar != null) {
                    if (typeof d.firstFrameSidecar === "string")
                        $util.base64.decode(d.firstFrameSidecar, m.firstFrameSidecar = $util.newBuffer($util.base64.length(d.firstFrameSidecar)), 0);
                    else if (d.firstFrameSidecar.length >= 0)
                        m.firstFrameSidecar = d.firstFrameSidecar;
                }
                if (d.isAnimated != null) {
                    m.isAnimated = Boolean(d.isAnimated);
                }
                if (d.pngThumbnail != null) {
                    if (typeof d.pngThumbnail === "string")
                        $util.base64.decode(d.pngThumbnail, m.pngThumbnail = $util.newBuffer($util.base64.length(d.pngThumbnail)), 0);
                    else if (d.pngThumbnail.length >= 0)
                        m.pngThumbnail = d.pngThumbnail;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.StickerMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.stickerSentTs != null) {
                    if ($util.Long)
                        (m.stickerSentTs = $util.Long.fromValue(d.stickerSentTs)).unsigned = false;
                    else if (typeof d.stickerSentTs === "string")
                        m.stickerSentTs = parseInt(d.stickerSentTs, 10);
                    else if (typeof d.stickerSentTs === "number")
                        m.stickerSentTs = d.stickerSentTs;
                    else if (typeof d.stickerSentTs === "object")
                        m.stickerSentTs = new $util.LongBits(d.stickerSentTs.low >>> 0, d.stickerSentTs.high >>> 0).toNumber();
                }
                if (d.isAvatar != null) {
                    m.isAvatar = Boolean(d.isAvatar);
                }
                if (d.isAiSticker != null) {
                    m.isAiSticker = Boolean(d.isAiSticker);
                }
                if (d.isLottie != null) {
                    m.isLottie = Boolean(d.isLottie);
                }
                if (d.accessibilityLabel != null) {
                    m.accessibilityLabel = String(d.accessibilityLabel);
                }
                switch (d.mediaKeyDomain) {
                default:
                    if (typeof d.mediaKeyDomain === "number") {
                        m.mediaKeyDomain = d.mediaKeyDomain;
                        break;
                    }
                    break;
                case "UNSET":
                case 0:
                    m.mediaKeyDomain = 0;
                    break;
                case "E2EE_CHAT":
                case 1:
                    m.mediaKeyDomain = 1;
                    break;
                case "STATUS":
                case 2:
                    m.mediaKeyDomain = 2;
                    break;
                case "CAPI":
                case 3:
                    m.mediaKeyDomain = 3;
                    break;
                case "BOT":
                case 4:
                    m.mediaKeyDomain = 4;
                    break;
                }
                return m;
            };

            StickerMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                    d.mimetype = m.mimetype;
                    if (o.oneofs)
                        d._mimetype = "mimetype";
                }
                if (m.height != null && m.hasOwnProperty("height")) {
                    d.height = m.height;
                    if (o.oneofs)
                        d._height = "height";
                }
                if (m.width != null && m.hasOwnProperty("width")) {
                    d.width = m.width;
                    if (o.oneofs)
                        d._width = "width";
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                    if (typeof m.fileLength === "number")
                        d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                    else
                        d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                    if (o.oneofs)
                        d._fileLength = "fileLength";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.firstFrameLength != null && m.hasOwnProperty("firstFrameLength")) {
                    d.firstFrameLength = m.firstFrameLength;
                    if (o.oneofs)
                        d._firstFrameLength = "firstFrameLength";
                }
                if (m.firstFrameSidecar != null && m.hasOwnProperty("firstFrameSidecar")) {
                    d.firstFrameSidecar = o.bytes === String ? $util.base64.encode(m.firstFrameSidecar, 0, m.firstFrameSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.firstFrameSidecar) : m.firstFrameSidecar;
                    if (o.oneofs)
                        d._firstFrameSidecar = "firstFrameSidecar";
                }
                if (m.isAnimated != null && m.hasOwnProperty("isAnimated")) {
                    d.isAnimated = m.isAnimated;
                    if (o.oneofs)
                        d._isAnimated = "isAnimated";
                }
                if (m.pngThumbnail != null && m.hasOwnProperty("pngThumbnail")) {
                    d.pngThumbnail = o.bytes === String ? $util.base64.encode(m.pngThumbnail, 0, m.pngThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.pngThumbnail) : m.pngThumbnail;
                    if (o.oneofs)
                        d._pngThumbnail = "pngThumbnail";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.stickerSentTs != null && m.hasOwnProperty("stickerSentTs")) {
                    if (typeof m.stickerSentTs === "number")
                        d.stickerSentTs = o.longs === String ? String(m.stickerSentTs) : m.stickerSentTs;
                    else
                        d.stickerSentTs = o.longs === String ? longToString(m.stickerSentTs) : o.longs === Number ? longToNumber(m.stickerSentTs) : m.stickerSentTs;
                    if (o.oneofs)
                        d._stickerSentTs = "stickerSentTs";
                }
                if (m.isAvatar != null && m.hasOwnProperty("isAvatar")) {
                    d.isAvatar = m.isAvatar;
                    if (o.oneofs)
                        d._isAvatar = "isAvatar";
                }
                if (m.isAiSticker != null && m.hasOwnProperty("isAiSticker")) {
                    d.isAiSticker = m.isAiSticker;
                    if (o.oneofs)
                        d._isAiSticker = "isAiSticker";
                }
                if (m.isLottie != null && m.hasOwnProperty("isLottie")) {
                    d.isLottie = m.isLottie;
                    if (o.oneofs)
                        d._isLottie = "isLottie";
                }
                if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) {
                    d.accessibilityLabel = m.accessibilityLabel;
                    if (o.oneofs)
                        d._accessibilityLabel = "accessibilityLabel";
                }
                if (m.mediaKeyDomain != null && m.hasOwnProperty("mediaKeyDomain")) {
                    d.mediaKeyDomain = o.enums === String ? $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] === undefined ? m.mediaKeyDomain : $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] : m.mediaKeyDomain;
                    if (o.oneofs)
                        d._mediaKeyDomain = "mediaKeyDomain";
                }
                return d;
            };

            StickerMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StickerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.StickerMessage";
            };

            return StickerMessage;
        })();

        Message.StickerPackMessage = (function() {

            function StickerPackMessage(p) {
                this.stickers = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StickerPackMessage.prototype.stickerPackId = null;
            StickerPackMessage.prototype.name = null;
            StickerPackMessage.prototype.publisher = null;
            StickerPackMessage.prototype.stickers = $util.emptyArray;
            StickerPackMessage.prototype.fileLength = null;
            StickerPackMessage.prototype.fileSha256 = null;
            StickerPackMessage.prototype.fileEncSha256 = null;
            StickerPackMessage.prototype.mediaKey = null;
            StickerPackMessage.prototype.directPath = null;
            StickerPackMessage.prototype.caption = null;
            StickerPackMessage.prototype.contextInfo = null;
            StickerPackMessage.prototype.packDescription = null;
            StickerPackMessage.prototype.mediaKeyTimestamp = null;
            StickerPackMessage.prototype.trayIconFileName = null;
            StickerPackMessage.prototype.thumbnailDirectPath = null;
            StickerPackMessage.prototype.thumbnailSha256 = null;
            StickerPackMessage.prototype.thumbnailEncSha256 = null;
            StickerPackMessage.prototype.thumbnailHeight = null;
            StickerPackMessage.prototype.thumbnailWidth = null;
            StickerPackMessage.prototype.imageDataHash = null;
            StickerPackMessage.prototype.stickerPackSize = null;
            StickerPackMessage.prototype.stickerPackOrigin = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_stickerPackId", {
                get: $util.oneOfGetter($oneOfFields = ["stickerPackId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_publisher", {
                get: $util.oneOfGetter($oneOfFields = ["publisher"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_fileLength", {
                get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_packDescription", {
                get: $util.oneOfGetter($oneOfFields = ["packDescription"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_trayIconFileName", {
                get: $util.oneOfGetter($oneOfFields = ["trayIconFileName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_thumbnailDirectPath", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_thumbnailSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_thumbnailEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_thumbnailHeight", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailHeight"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_thumbnailWidth", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailWidth"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_imageDataHash", {
                get: $util.oneOfGetter($oneOfFields = ["imageDataHash"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_stickerPackSize", {
                get: $util.oneOfGetter($oneOfFields = ["stickerPackSize"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerPackMessage.prototype, "_stickerPackOrigin", {
                get: $util.oneOfGetter($oneOfFields = ["stickerPackOrigin"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StickerPackMessage.create = function create(properties) {
                return new StickerPackMessage(properties);
            };

            StickerPackMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.stickerPackId != null && Object.hasOwnProperty.call(m, "stickerPackId"))
                    w.uint32(10).string(m.stickerPackId);
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(18).string(m.name);
                if (m.publisher != null && Object.hasOwnProperty.call(m, "publisher"))
                    w.uint32(26).string(m.publisher);
                if (m.stickers != null && m.stickers.length) {
                    for (var i = 0; i < m.stickers.length; ++i)
                        $root.proto.Message.StickerPackMessage.Sticker.encode(m.stickers[i], w.uint32(34).fork()).ldelim();
                }
                if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                    w.uint32(40).uint64(m.fileLength);
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(50).bytes(m.fileSha256);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(58).bytes(m.fileEncSha256);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(66).bytes(m.mediaKey);
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(74).string(m.directPath);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(82).string(m.caption);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(90).fork()).ldelim();
                if (m.packDescription != null && Object.hasOwnProperty.call(m, "packDescription"))
                    w.uint32(98).string(m.packDescription);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(104).int64(m.mediaKeyTimestamp);
                if (m.trayIconFileName != null && Object.hasOwnProperty.call(m, "trayIconFileName"))
                    w.uint32(114).string(m.trayIconFileName);
                if (m.thumbnailDirectPath != null && Object.hasOwnProperty.call(m, "thumbnailDirectPath"))
                    w.uint32(122).string(m.thumbnailDirectPath);
                if (m.thumbnailSha256 != null && Object.hasOwnProperty.call(m, "thumbnailSha256"))
                    w.uint32(130).bytes(m.thumbnailSha256);
                if (m.thumbnailEncSha256 != null && Object.hasOwnProperty.call(m, "thumbnailEncSha256"))
                    w.uint32(138).bytes(m.thumbnailEncSha256);
                if (m.thumbnailHeight != null && Object.hasOwnProperty.call(m, "thumbnailHeight"))
                    w.uint32(144).uint32(m.thumbnailHeight);
                if (m.thumbnailWidth != null && Object.hasOwnProperty.call(m, "thumbnailWidth"))
                    w.uint32(152).uint32(m.thumbnailWidth);
                if (m.imageDataHash != null && Object.hasOwnProperty.call(m, "imageDataHash"))
                    w.uint32(162).string(m.imageDataHash);
                if (m.stickerPackSize != null && Object.hasOwnProperty.call(m, "stickerPackSize"))
                    w.uint32(168).uint64(m.stickerPackSize);
                if (m.stickerPackOrigin != null && Object.hasOwnProperty.call(m, "stickerPackOrigin"))
                    w.uint32(176).int32(m.stickerPackOrigin);
                return w;
            };

            StickerPackMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.StickerPackMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.stickerPackId = r.string();
                            break;
                        }
                    case 2: {
                            m.name = r.string();
                            break;
                        }
                    case 3: {
                            m.publisher = r.string();
                            break;
                        }
                    case 4: {
                            if (!(m.stickers && m.stickers.length))
                                m.stickers = [];
                            m.stickers.push($root.proto.Message.StickerPackMessage.Sticker.decode(r, r.uint32()));
                            break;
                        }
                    case 5: {
                            m.fileLength = r.uint64();
                            break;
                        }
                    case 6: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 7: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 8: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 9: {
                            m.directPath = r.string();
                            break;
                        }
                    case 10: {
                            m.caption = r.string();
                            break;
                        }
                    case 11: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 12: {
                            m.packDescription = r.string();
                            break;
                        }
                    case 13: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 14: {
                            m.trayIconFileName = r.string();
                            break;
                        }
                    case 15: {
                            m.thumbnailDirectPath = r.string();
                            break;
                        }
                    case 16: {
                            m.thumbnailSha256 = r.bytes();
                            break;
                        }
                    case 17: {
                            m.thumbnailEncSha256 = r.bytes();
                            break;
                        }
                    case 18: {
                            m.thumbnailHeight = r.uint32();
                            break;
                        }
                    case 19: {
                            m.thumbnailWidth = r.uint32();
                            break;
                        }
                    case 20: {
                            m.imageDataHash = r.string();
                            break;
                        }
                    case 21: {
                            m.stickerPackSize = r.uint64();
                            break;
                        }
                    case 22: {
                            m.stickerPackOrigin = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StickerPackMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.StickerPackMessage)
                    return d;
                var m = new $root.proto.Message.StickerPackMessage();
                if (d.stickerPackId != null) {
                    m.stickerPackId = String(d.stickerPackId);
                }
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.publisher != null) {
                    m.publisher = String(d.publisher);
                }
                if (d.stickers) {
                    if (!Array.isArray(d.stickers))
                        throw TypeError(".proto.Message.StickerPackMessage.stickers: array expected");
                    m.stickers = [];
                    for (var i = 0; i < d.stickers.length; ++i) {
                        if (typeof d.stickers[i] !== "object")
                            throw TypeError(".proto.Message.StickerPackMessage.stickers: object expected");
                        m.stickers[i] = $root.proto.Message.StickerPackMessage.Sticker.fromObject(d.stickers[i]);
                    }
                }
                if (d.fileLength != null) {
                    if ($util.Long)
                        (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                    else if (typeof d.fileLength === "string")
                        m.fileLength = parseInt(d.fileLength, 10);
                    else if (typeof d.fileLength === "number")
                        m.fileLength = d.fileLength;
                    else if (typeof d.fileLength === "object")
                        m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
                }
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.StickerPackMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.packDescription != null) {
                    m.packDescription = String(d.packDescription);
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.trayIconFileName != null) {
                    m.trayIconFileName = String(d.trayIconFileName);
                }
                if (d.thumbnailDirectPath != null) {
                    m.thumbnailDirectPath = String(d.thumbnailDirectPath);
                }
                if (d.thumbnailSha256 != null) {
                    if (typeof d.thumbnailSha256 === "string")
                        $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0);
                    else if (d.thumbnailSha256.length >= 0)
                        m.thumbnailSha256 = d.thumbnailSha256;
                }
                if (d.thumbnailEncSha256 != null) {
                    if (typeof d.thumbnailEncSha256 === "string")
                        $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0);
                    else if (d.thumbnailEncSha256.length >= 0)
                        m.thumbnailEncSha256 = d.thumbnailEncSha256;
                }
                if (d.thumbnailHeight != null) {
                    m.thumbnailHeight = d.thumbnailHeight >>> 0;
                }
                if (d.thumbnailWidth != null) {
                    m.thumbnailWidth = d.thumbnailWidth >>> 0;
                }
                if (d.imageDataHash != null) {
                    m.imageDataHash = String(d.imageDataHash);
                }
                if (d.stickerPackSize != null) {
                    if ($util.Long)
                        (m.stickerPackSize = $util.Long.fromValue(d.stickerPackSize)).unsigned = true;
                    else if (typeof d.stickerPackSize === "string")
                        m.stickerPackSize = parseInt(d.stickerPackSize, 10);
                    else if (typeof d.stickerPackSize === "number")
                        m.stickerPackSize = d.stickerPackSize;
                    else if (typeof d.stickerPackSize === "object")
                        m.stickerPackSize = new $util.LongBits(d.stickerPackSize.low >>> 0, d.stickerPackSize.high >>> 0).toNumber(true);
                }
                switch (d.stickerPackOrigin) {
                default:
                    if (typeof d.stickerPackOrigin === "number") {
                        m.stickerPackOrigin = d.stickerPackOrigin;
                        break;
                    }
                    break;
                case "FIRST_PARTY":
                case 0:
                    m.stickerPackOrigin = 0;
                    break;
                case "THIRD_PARTY":
                case 1:
                    m.stickerPackOrigin = 1;
                    break;
                case "USER_CREATED":
                case 2:
                    m.stickerPackOrigin = 2;
                    break;
                }
                return m;
            };

            StickerPackMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.stickers = [];
                }
                if (m.stickerPackId != null && m.hasOwnProperty("stickerPackId")) {
                    d.stickerPackId = m.stickerPackId;
                    if (o.oneofs)
                        d._stickerPackId = "stickerPackId";
                }
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.publisher != null && m.hasOwnProperty("publisher")) {
                    d.publisher = m.publisher;
                    if (o.oneofs)
                        d._publisher = "publisher";
                }
                if (m.stickers && m.stickers.length) {
                    d.stickers = [];
                    for (var j = 0; j < m.stickers.length; ++j) {
                        d.stickers[j] = $root.proto.Message.StickerPackMessage.Sticker.toObject(m.stickers[j], o);
                    }
                }
                if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                    if (typeof m.fileLength === "number")
                        d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                    else
                        d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                    if (o.oneofs)
                        d._fileLength = "fileLength";
                }
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.packDescription != null && m.hasOwnProperty("packDescription")) {
                    d.packDescription = m.packDescription;
                    if (o.oneofs)
                        d._packDescription = "packDescription";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.trayIconFileName != null && m.hasOwnProperty("trayIconFileName")) {
                    d.trayIconFileName = m.trayIconFileName;
                    if (o.oneofs)
                        d._trayIconFileName = "trayIconFileName";
                }
                if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) {
                    d.thumbnailDirectPath = m.thumbnailDirectPath;
                    if (o.oneofs)
                        d._thumbnailDirectPath = "thumbnailDirectPath";
                }
                if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) {
                    d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256;
                    if (o.oneofs)
                        d._thumbnailSha256 = "thumbnailSha256";
                }
                if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) {
                    d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256;
                    if (o.oneofs)
                        d._thumbnailEncSha256 = "thumbnailEncSha256";
                }
                if (m.thumbnailHeight != null && m.hasOwnProperty("thumbnailHeight")) {
                    d.thumbnailHeight = m.thumbnailHeight;
                    if (o.oneofs)
                        d._thumbnailHeight = "thumbnailHeight";
                }
                if (m.thumbnailWidth != null && m.hasOwnProperty("thumbnailWidth")) {
                    d.thumbnailWidth = m.thumbnailWidth;
                    if (o.oneofs)
                        d._thumbnailWidth = "thumbnailWidth";
                }
                if (m.imageDataHash != null && m.hasOwnProperty("imageDataHash")) {
                    d.imageDataHash = m.imageDataHash;
                    if (o.oneofs)
                        d._imageDataHash = "imageDataHash";
                }
                if (m.stickerPackSize != null && m.hasOwnProperty("stickerPackSize")) {
                    if (typeof m.stickerPackSize === "number")
                        d.stickerPackSize = o.longs === String ? String(m.stickerPackSize) : m.stickerPackSize;
                    else
                        d.stickerPackSize = o.longs === String ? longToString(m.stickerPackSize, true) : o.longs === Number ? longToNumber(m.stickerPackSize, true) : m.stickerPackSize;
                    if (o.oneofs)
                        d._stickerPackSize = "stickerPackSize";
                }
                if (m.stickerPackOrigin != null && m.hasOwnProperty("stickerPackOrigin")) {
                    d.stickerPackOrigin = o.enums === String ? $root.proto.Message.StickerPackMessage.StickerPackOrigin[m.stickerPackOrigin] === undefined ? m.stickerPackOrigin : $root.proto.Message.StickerPackMessage.StickerPackOrigin[m.stickerPackOrigin] : m.stickerPackOrigin;
                    if (o.oneofs)
                        d._stickerPackOrigin = "stickerPackOrigin";
                }
                return d;
            };

            StickerPackMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StickerPackMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.StickerPackMessage";
            };

            StickerPackMessage.Sticker = (function() {

                function Sticker(p) {
                    this.emojis = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Sticker.prototype.fileName = null;
                Sticker.prototype.isAnimated = null;
                Sticker.prototype.emojis = $util.emptyArray;
                Sticker.prototype.accessibilityLabel = null;
                Sticker.prototype.isLottie = null;
                Sticker.prototype.mimetype = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Sticker.prototype, "_fileName", {
                    get: $util.oneOfGetter($oneOfFields = ["fileName"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Sticker.prototype, "_isAnimated", {
                    get: $util.oneOfGetter($oneOfFields = ["isAnimated"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Sticker.prototype, "_accessibilityLabel", {
                    get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Sticker.prototype, "_isLottie", {
                    get: $util.oneOfGetter($oneOfFields = ["isLottie"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Sticker.prototype, "_mimetype", {
                    get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Sticker.create = function create(properties) {
                    return new Sticker(properties);
                };

                Sticker.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.fileName != null && Object.hasOwnProperty.call(m, "fileName"))
                        w.uint32(10).string(m.fileName);
                    if (m.isAnimated != null && Object.hasOwnProperty.call(m, "isAnimated"))
                        w.uint32(16).bool(m.isAnimated);
                    if (m.emojis != null && m.emojis.length) {
                        for (var i = 0; i < m.emojis.length; ++i)
                            w.uint32(26).string(m.emojis[i]);
                    }
                    if (m.accessibilityLabel != null && Object.hasOwnProperty.call(m, "accessibilityLabel"))
                        w.uint32(34).string(m.accessibilityLabel);
                    if (m.isLottie != null && Object.hasOwnProperty.call(m, "isLottie"))
                        w.uint32(40).bool(m.isLottie);
                    if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                        w.uint32(50).string(m.mimetype);
                    return w;
                };

                Sticker.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.StickerPackMessage.Sticker();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.fileName = r.string();
                                break;
                            }
                        case 2: {
                                m.isAnimated = r.bool();
                                break;
                            }
                        case 3: {
                                if (!(m.emojis && m.emojis.length))
                                    m.emojis = [];
                                m.emojis.push(r.string());
                                break;
                            }
                        case 4: {
                                m.accessibilityLabel = r.string();
                                break;
                            }
                        case 5: {
                                m.isLottie = r.bool();
                                break;
                            }
                        case 6: {
                                m.mimetype = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Sticker.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.StickerPackMessage.Sticker)
                        return d;
                    var m = new $root.proto.Message.StickerPackMessage.Sticker();
                    if (d.fileName != null) {
                        m.fileName = String(d.fileName);
                    }
                    if (d.isAnimated != null) {
                        m.isAnimated = Boolean(d.isAnimated);
                    }
                    if (d.emojis) {
                        if (!Array.isArray(d.emojis))
                            throw TypeError(".proto.Message.StickerPackMessage.Sticker.emojis: array expected");
                        m.emojis = [];
                        for (var i = 0; i < d.emojis.length; ++i) {
                            m.emojis[i] = String(d.emojis[i]);
                        }
                    }
                    if (d.accessibilityLabel != null) {
                        m.accessibilityLabel = String(d.accessibilityLabel);
                    }
                    if (d.isLottie != null) {
                        m.isLottie = Boolean(d.isLottie);
                    }
                    if (d.mimetype != null) {
                        m.mimetype = String(d.mimetype);
                    }
                    return m;
                };

                Sticker.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.emojis = [];
                    }
                    if (m.fileName != null && m.hasOwnProperty("fileName")) {
                        d.fileName = m.fileName;
                        if (o.oneofs)
                            d._fileName = "fileName";
                    }
                    if (m.isAnimated != null && m.hasOwnProperty("isAnimated")) {
                        d.isAnimated = m.isAnimated;
                        if (o.oneofs)
                            d._isAnimated = "isAnimated";
                    }
                    if (m.emojis && m.emojis.length) {
                        d.emojis = [];
                        for (var j = 0; j < m.emojis.length; ++j) {
                            d.emojis[j] = m.emojis[j];
                        }
                    }
                    if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) {
                        d.accessibilityLabel = m.accessibilityLabel;
                        if (o.oneofs)
                            d._accessibilityLabel = "accessibilityLabel";
                    }
                    if (m.isLottie != null && m.hasOwnProperty("isLottie")) {
                        d.isLottie = m.isLottie;
                        if (o.oneofs)
                            d._isLottie = "isLottie";
                    }
                    if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                        d.mimetype = m.mimetype;
                        if (o.oneofs)
                            d._mimetype = "mimetype";
                    }
                    return d;
                };

                Sticker.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Sticker.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.StickerPackMessage.Sticker";
                };

                return Sticker;
            })();

            StickerPackMessage.StickerPackOrigin = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "FIRST_PARTY"] = 0;
                values[valuesById[1] = "THIRD_PARTY"] = 1;
                values[valuesById[2] = "USER_CREATED"] = 2;
                return values;
            })();

            return StickerPackMessage;
        })();

        Message.StickerSyncRMRMessage = (function() {

            function StickerSyncRMRMessage(p) {
                this.filehash = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StickerSyncRMRMessage.prototype.filehash = $util.emptyArray;
            StickerSyncRMRMessage.prototype.rmrSource = null;
            StickerSyncRMRMessage.prototype.requestTimestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerSyncRMRMessage.prototype, "_rmrSource", {
                get: $util.oneOfGetter($oneOfFields = ["rmrSource"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerSyncRMRMessage.prototype, "_requestTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["requestTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StickerSyncRMRMessage.create = function create(properties) {
                return new StickerSyncRMRMessage(properties);
            };

            StickerSyncRMRMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.filehash != null && m.filehash.length) {
                    for (var i = 0; i < m.filehash.length; ++i)
                        w.uint32(10).string(m.filehash[i]);
                }
                if (m.rmrSource != null && Object.hasOwnProperty.call(m, "rmrSource"))
                    w.uint32(18).string(m.rmrSource);
                if (m.requestTimestamp != null && Object.hasOwnProperty.call(m, "requestTimestamp"))
                    w.uint32(24).int64(m.requestTimestamp);
                return w;
            };

            StickerSyncRMRMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.StickerSyncRMRMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.filehash && m.filehash.length))
                                m.filehash = [];
                            m.filehash.push(r.string());
                            break;
                        }
                    case 2: {
                            m.rmrSource = r.string();
                            break;
                        }
                    case 3: {
                            m.requestTimestamp = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StickerSyncRMRMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.StickerSyncRMRMessage)
                    return d;
                var m = new $root.proto.Message.StickerSyncRMRMessage();
                if (d.filehash) {
                    if (!Array.isArray(d.filehash))
                        throw TypeError(".proto.Message.StickerSyncRMRMessage.filehash: array expected");
                    m.filehash = [];
                    for (var i = 0; i < d.filehash.length; ++i) {
                        m.filehash[i] = String(d.filehash[i]);
                    }
                }
                if (d.rmrSource != null) {
                    m.rmrSource = String(d.rmrSource);
                }
                if (d.requestTimestamp != null) {
                    if ($util.Long)
                        (m.requestTimestamp = $util.Long.fromValue(d.requestTimestamp)).unsigned = false;
                    else if (typeof d.requestTimestamp === "string")
                        m.requestTimestamp = parseInt(d.requestTimestamp, 10);
                    else if (typeof d.requestTimestamp === "number")
                        m.requestTimestamp = d.requestTimestamp;
                    else if (typeof d.requestTimestamp === "object")
                        m.requestTimestamp = new $util.LongBits(d.requestTimestamp.low >>> 0, d.requestTimestamp.high >>> 0).toNumber();
                }
                return m;
            };

            StickerSyncRMRMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.filehash = [];
                }
                if (m.filehash && m.filehash.length) {
                    d.filehash = [];
                    for (var j = 0; j < m.filehash.length; ++j) {
                        d.filehash[j] = m.filehash[j];
                    }
                }
                if (m.rmrSource != null && m.hasOwnProperty("rmrSource")) {
                    d.rmrSource = m.rmrSource;
                    if (o.oneofs)
                        d._rmrSource = "rmrSource";
                }
                if (m.requestTimestamp != null && m.hasOwnProperty("requestTimestamp")) {
                    if (typeof m.requestTimestamp === "number")
                        d.requestTimestamp = o.longs === String ? String(m.requestTimestamp) : m.requestTimestamp;
                    else
                        d.requestTimestamp = o.longs === String ? longToString(m.requestTimestamp) : o.longs === Number ? longToNumber(m.requestTimestamp) : m.requestTimestamp;
                    if (o.oneofs)
                        d._requestTimestamp = "requestTimestamp";
                }
                return d;
            };

            StickerSyncRMRMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StickerSyncRMRMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.StickerSyncRMRMessage";
            };

            return StickerSyncRMRMessage;
        })();

        Message.TemplateButtonReplyMessage = (function() {

            function TemplateButtonReplyMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            TemplateButtonReplyMessage.prototype.selectedId = null;
            TemplateButtonReplyMessage.prototype.selectedDisplayText = null;
            TemplateButtonReplyMessage.prototype.contextInfo = null;
            TemplateButtonReplyMessage.prototype.selectedIndex = null;
            TemplateButtonReplyMessage.prototype.selectedCarouselCardIndex = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TemplateButtonReplyMessage.prototype, "_selectedId", {
                get: $util.oneOfGetter($oneOfFields = ["selectedId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TemplateButtonReplyMessage.prototype, "_selectedDisplayText", {
                get: $util.oneOfGetter($oneOfFields = ["selectedDisplayText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TemplateButtonReplyMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TemplateButtonReplyMessage.prototype, "_selectedIndex", {
                get: $util.oneOfGetter($oneOfFields = ["selectedIndex"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TemplateButtonReplyMessage.prototype, "_selectedCarouselCardIndex", {
                get: $util.oneOfGetter($oneOfFields = ["selectedCarouselCardIndex"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            TemplateButtonReplyMessage.create = function create(properties) {
                return new TemplateButtonReplyMessage(properties);
            };

            TemplateButtonReplyMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.selectedId != null && Object.hasOwnProperty.call(m, "selectedId"))
                    w.uint32(10).string(m.selectedId);
                if (m.selectedDisplayText != null && Object.hasOwnProperty.call(m, "selectedDisplayText"))
                    w.uint32(18).string(m.selectedDisplayText);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(26).fork()).ldelim();
                if (m.selectedIndex != null && Object.hasOwnProperty.call(m, "selectedIndex"))
                    w.uint32(32).uint32(m.selectedIndex);
                if (m.selectedCarouselCardIndex != null && Object.hasOwnProperty.call(m, "selectedCarouselCardIndex"))
                    w.uint32(40).uint32(m.selectedCarouselCardIndex);
                return w;
            };

            TemplateButtonReplyMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.TemplateButtonReplyMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.selectedId = r.string();
                            break;
                        }
                    case 2: {
                            m.selectedDisplayText = r.string();
                            break;
                        }
                    case 3: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.selectedIndex = r.uint32();
                            break;
                        }
                    case 5: {
                            m.selectedCarouselCardIndex = r.uint32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            TemplateButtonReplyMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.TemplateButtonReplyMessage)
                    return d;
                var m = new $root.proto.Message.TemplateButtonReplyMessage();
                if (d.selectedId != null) {
                    m.selectedId = String(d.selectedId);
                }
                if (d.selectedDisplayText != null) {
                    m.selectedDisplayText = String(d.selectedDisplayText);
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.TemplateButtonReplyMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.selectedIndex != null) {
                    m.selectedIndex = d.selectedIndex >>> 0;
                }
                if (d.selectedCarouselCardIndex != null) {
                    m.selectedCarouselCardIndex = d.selectedCarouselCardIndex >>> 0;
                }
                return m;
            };

            TemplateButtonReplyMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.selectedId != null && m.hasOwnProperty("selectedId")) {
                    d.selectedId = m.selectedId;
                    if (o.oneofs)
                        d._selectedId = "selectedId";
                }
                if (m.selectedDisplayText != null && m.hasOwnProperty("selectedDisplayText")) {
                    d.selectedDisplayText = m.selectedDisplayText;
                    if (o.oneofs)
                        d._selectedDisplayText = "selectedDisplayText";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.selectedIndex != null && m.hasOwnProperty("selectedIndex")) {
                    d.selectedIndex = m.selectedIndex;
                    if (o.oneofs)
                        d._selectedIndex = "selectedIndex";
                }
                if (m.selectedCarouselCardIndex != null && m.hasOwnProperty("selectedCarouselCardIndex")) {
                    d.selectedCarouselCardIndex = m.selectedCarouselCardIndex;
                    if (o.oneofs)
                        d._selectedCarouselCardIndex = "selectedCarouselCardIndex";
                }
                return d;
            };

            TemplateButtonReplyMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            TemplateButtonReplyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.TemplateButtonReplyMessage";
            };

            return TemplateButtonReplyMessage;
        })();

        Message.TemplateMessage = (function() {

            function TemplateMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            TemplateMessage.prototype.contextInfo = null;
            TemplateMessage.prototype.hydratedTemplate = null;
            TemplateMessage.prototype.templateId = null;
            TemplateMessage.prototype.fourRowTemplate = null;
            TemplateMessage.prototype.hydratedFourRowTemplate = null;
            TemplateMessage.prototype.interactiveMessageTemplate = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TemplateMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TemplateMessage.prototype, "_hydratedTemplate", {
                get: $util.oneOfGetter($oneOfFields = ["hydratedTemplate"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TemplateMessage.prototype, "_templateId", {
                get: $util.oneOfGetter($oneOfFields = ["templateId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Object.defineProperty(TemplateMessage.prototype, "format", {
                get: $util.oneOfGetter($oneOfFields = ["fourRowTemplate", "hydratedFourRowTemplate", "interactiveMessageTemplate"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            TemplateMessage.create = function create(properties) {
                return new TemplateMessage(properties);
            };

            TemplateMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.fourRowTemplate != null && Object.hasOwnProperty.call(m, "fourRowTemplate"))
                    $root.proto.Message.TemplateMessage.FourRowTemplate.encode(m.fourRowTemplate, w.uint32(10).fork()).ldelim();
                if (m.hydratedFourRowTemplate != null && Object.hasOwnProperty.call(m, "hydratedFourRowTemplate"))
                    $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.encode(m.hydratedFourRowTemplate, w.uint32(18).fork()).ldelim();
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(26).fork()).ldelim();
                if (m.hydratedTemplate != null && Object.hasOwnProperty.call(m, "hydratedTemplate"))
                    $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.encode(m.hydratedTemplate, w.uint32(34).fork()).ldelim();
                if (m.interactiveMessageTemplate != null && Object.hasOwnProperty.call(m, "interactiveMessageTemplate"))
                    $root.proto.Message.InteractiveMessage.encode(m.interactiveMessageTemplate, w.uint32(42).fork()).ldelim();
                if (m.templateId != null && Object.hasOwnProperty.call(m, "templateId"))
                    w.uint32(74).string(m.templateId);
                return w;
            };

            TemplateMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.TemplateMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 3: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            m.hydratedTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(r, r.uint32());
                            break;
                        }
                    case 9: {
                            m.templateId = r.string();
                            break;
                        }
                    case 1: {
                            m.fourRowTemplate = $root.proto.Message.TemplateMessage.FourRowTemplate.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.hydratedFourRowTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(r, r.uint32());
                            break;
                        }
                    case 5: {
                            m.interactiveMessageTemplate = $root.proto.Message.InteractiveMessage.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            TemplateMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.TemplateMessage)
                    return d;
                var m = new $root.proto.Message.TemplateMessage();
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.TemplateMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.hydratedTemplate != null) {
                    if (typeof d.hydratedTemplate !== "object")
                        throw TypeError(".proto.Message.TemplateMessage.hydratedTemplate: object expected");
                    m.hydratedTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(d.hydratedTemplate);
                }
                if (d.templateId != null) {
                    m.templateId = String(d.templateId);
                }
                if (d.fourRowTemplate != null) {
                    if (typeof d.fourRowTemplate !== "object")
                        throw TypeError(".proto.Message.TemplateMessage.fourRowTemplate: object expected");
                    m.fourRowTemplate = $root.proto.Message.TemplateMessage.FourRowTemplate.fromObject(d.fourRowTemplate);
                }
                if (d.hydratedFourRowTemplate != null) {
                    if (typeof d.hydratedFourRowTemplate !== "object")
                        throw TypeError(".proto.Message.TemplateMessage.hydratedFourRowTemplate: object expected");
                    m.hydratedFourRowTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(d.hydratedFourRowTemplate);
                }
                if (d.interactiveMessageTemplate != null) {
                    if (typeof d.interactiveMessageTemplate !== "object")
                        throw TypeError(".proto.Message.TemplateMessage.interactiveMessageTemplate: object expected");
                    m.interactiveMessageTemplate = $root.proto.Message.InteractiveMessage.fromObject(d.interactiveMessageTemplate);
                }
                return m;
            };

            TemplateMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.fourRowTemplate != null && m.hasOwnProperty("fourRowTemplate")) {
                    d.fourRowTemplate = $root.proto.Message.TemplateMessage.FourRowTemplate.toObject(m.fourRowTemplate, o);
                    if (o.oneofs)
                        d.format = "fourRowTemplate";
                }
                if (m.hydratedFourRowTemplate != null && m.hasOwnProperty("hydratedFourRowTemplate")) {
                    d.hydratedFourRowTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(m.hydratedFourRowTemplate, o);
                    if (o.oneofs)
                        d.format = "hydratedFourRowTemplate";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.hydratedTemplate != null && m.hasOwnProperty("hydratedTemplate")) {
                    d.hydratedTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(m.hydratedTemplate, o);
                    if (o.oneofs)
                        d._hydratedTemplate = "hydratedTemplate";
                }
                if (m.interactiveMessageTemplate != null && m.hasOwnProperty("interactiveMessageTemplate")) {
                    d.interactiveMessageTemplate = $root.proto.Message.InteractiveMessage.toObject(m.interactiveMessageTemplate, o);
                    if (o.oneofs)
                        d.format = "interactiveMessageTemplate";
                }
                if (m.templateId != null && m.hasOwnProperty("templateId")) {
                    d.templateId = m.templateId;
                    if (o.oneofs)
                        d._templateId = "templateId";
                }
                return d;
            };

            TemplateMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            TemplateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.TemplateMessage";
            };

            TemplateMessage.FourRowTemplate = (function() {

                function FourRowTemplate(p) {
                    this.buttons = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                FourRowTemplate.prototype.content = null;
                FourRowTemplate.prototype.footer = null;
                FourRowTemplate.prototype.buttons = $util.emptyArray;
                FourRowTemplate.prototype.documentMessage = null;
                FourRowTemplate.prototype.highlyStructuredMessage = null;
                FourRowTemplate.prototype.imageMessage = null;
                FourRowTemplate.prototype.videoMessage = null;
                FourRowTemplate.prototype.locationMessage = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(FourRowTemplate.prototype, "_content", {
                    get: $util.oneOfGetter($oneOfFields = ["content"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(FourRowTemplate.prototype, "_footer", {
                    get: $util.oneOfGetter($oneOfFields = ["footer"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Object.defineProperty(FourRowTemplate.prototype, "title", {
                    get: $util.oneOfGetter($oneOfFields = ["documentMessage", "highlyStructuredMessage", "imageMessage", "videoMessage", "locationMessage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                FourRowTemplate.create = function create(properties) {
                    return new FourRowTemplate(properties);
                };

                FourRowTemplate.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.documentMessage != null && Object.hasOwnProperty.call(m, "documentMessage"))
                        $root.proto.Message.DocumentMessage.encode(m.documentMessage, w.uint32(10).fork()).ldelim();
                    if (m.highlyStructuredMessage != null && Object.hasOwnProperty.call(m, "highlyStructuredMessage"))
                        $root.proto.Message.HighlyStructuredMessage.encode(m.highlyStructuredMessage, w.uint32(18).fork()).ldelim();
                    if (m.imageMessage != null && Object.hasOwnProperty.call(m, "imageMessage"))
                        $root.proto.Message.ImageMessage.encode(m.imageMessage, w.uint32(26).fork()).ldelim();
                    if (m.videoMessage != null && Object.hasOwnProperty.call(m, "videoMessage"))
                        $root.proto.Message.VideoMessage.encode(m.videoMessage, w.uint32(34).fork()).ldelim();
                    if (m.locationMessage != null && Object.hasOwnProperty.call(m, "locationMessage"))
                        $root.proto.Message.LocationMessage.encode(m.locationMessage, w.uint32(42).fork()).ldelim();
                    if (m.content != null && Object.hasOwnProperty.call(m, "content"))
                        $root.proto.Message.HighlyStructuredMessage.encode(m.content, w.uint32(50).fork()).ldelim();
                    if (m.footer != null && Object.hasOwnProperty.call(m, "footer"))
                        $root.proto.Message.HighlyStructuredMessage.encode(m.footer, w.uint32(58).fork()).ldelim();
                    if (m.buttons != null && m.buttons.length) {
                        for (var i = 0; i < m.buttons.length; ++i)
                            $root.proto.TemplateButton.encode(m.buttons[i], w.uint32(66).fork()).ldelim();
                    }
                    return w;
                };

                FourRowTemplate.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.TemplateMessage.FourRowTemplate();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 6: {
                                m.content = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                                break;
                            }
                        case 7: {
                                m.footer = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                                break;
                            }
                        case 8: {
                                if (!(m.buttons && m.buttons.length))
                                    m.buttons = [];
                                m.buttons.push($root.proto.TemplateButton.decode(r, r.uint32()));
                                break;
                            }
                        case 1: {
                                m.documentMessage = $root.proto.Message.DocumentMessage.decode(r, r.uint32());
                                break;
                            }
                        case 2: {
                                m.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                                break;
                            }
                        case 3: {
                                m.imageMessage = $root.proto.Message.ImageMessage.decode(r, r.uint32());
                                break;
                            }
                        case 4: {
                                m.videoMessage = $root.proto.Message.VideoMessage.decode(r, r.uint32());
                                break;
                            }
                        case 5: {
                                m.locationMessage = $root.proto.Message.LocationMessage.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                FourRowTemplate.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.TemplateMessage.FourRowTemplate)
                        return d;
                    var m = new $root.proto.Message.TemplateMessage.FourRowTemplate();
                    if (d.content != null) {
                        if (typeof d.content !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.content: object expected");
                        m.content = $root.proto.Message.HighlyStructuredMessage.fromObject(d.content);
                    }
                    if (d.footer != null) {
                        if (typeof d.footer !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.footer: object expected");
                        m.footer = $root.proto.Message.HighlyStructuredMessage.fromObject(d.footer);
                    }
                    if (d.buttons) {
                        if (!Array.isArray(d.buttons))
                            throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: array expected");
                        m.buttons = [];
                        for (var i = 0; i < d.buttons.length; ++i) {
                            if (typeof d.buttons[i] !== "object")
                                throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: object expected");
                            m.buttons[i] = $root.proto.TemplateButton.fromObject(d.buttons[i]);
                        }
                    }
                    if (d.documentMessage != null) {
                        if (typeof d.documentMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.documentMessage: object expected");
                        m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage);
                    }
                    if (d.highlyStructuredMessage != null) {
                        if (typeof d.highlyStructuredMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.highlyStructuredMessage: object expected");
                        m.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.fromObject(d.highlyStructuredMessage);
                    }
                    if (d.imageMessage != null) {
                        if (typeof d.imageMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.imageMessage: object expected");
                        m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage);
                    }
                    if (d.videoMessage != null) {
                        if (typeof d.videoMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.videoMessage: object expected");
                        m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage);
                    }
                    if (d.locationMessage != null) {
                        if (typeof d.locationMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.locationMessage: object expected");
                        m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage);
                    }
                    return m;
                };

                FourRowTemplate.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.buttons = [];
                    }
                    if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) {
                        d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o);
                        if (o.oneofs)
                            d.title = "documentMessage";
                    }
                    if (m.highlyStructuredMessage != null && m.hasOwnProperty("highlyStructuredMessage")) {
                        d.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.toObject(m.highlyStructuredMessage, o);
                        if (o.oneofs)
                            d.title = "highlyStructuredMessage";
                    }
                    if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) {
                        d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o);
                        if (o.oneofs)
                            d.title = "imageMessage";
                    }
                    if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) {
                        d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o);
                        if (o.oneofs)
                            d.title = "videoMessage";
                    }
                    if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) {
                        d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o);
                        if (o.oneofs)
                            d.title = "locationMessage";
                    }
                    if (m.content != null && m.hasOwnProperty("content")) {
                        d.content = $root.proto.Message.HighlyStructuredMessage.toObject(m.content, o);
                        if (o.oneofs)
                            d._content = "content";
                    }
                    if (m.footer != null && m.hasOwnProperty("footer")) {
                        d.footer = $root.proto.Message.HighlyStructuredMessage.toObject(m.footer, o);
                        if (o.oneofs)
                            d._footer = "footer";
                    }
                    if (m.buttons && m.buttons.length) {
                        d.buttons = [];
                        for (var j = 0; j < m.buttons.length; ++j) {
                            d.buttons[j] = $root.proto.TemplateButton.toObject(m.buttons[j], o);
                        }
                    }
                    return d;
                };

                FourRowTemplate.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                FourRowTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.TemplateMessage.FourRowTemplate";
                };

                return FourRowTemplate;
            })();

            TemplateMessage.HydratedFourRowTemplate = (function() {

                function HydratedFourRowTemplate(p) {
                    this.hydratedButtons = [];
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                HydratedFourRowTemplate.prototype.hydratedContentText = null;
                HydratedFourRowTemplate.prototype.hydratedFooterText = null;
                HydratedFourRowTemplate.prototype.hydratedButtons = $util.emptyArray;
                HydratedFourRowTemplate.prototype.templateId = null;
                HydratedFourRowTemplate.prototype.maskLinkedDevices = null;
                HydratedFourRowTemplate.prototype.documentMessage = null;
                HydratedFourRowTemplate.prototype.hydratedTitleText = null;
                HydratedFourRowTemplate.prototype.imageMessage = null;
                HydratedFourRowTemplate.prototype.videoMessage = null;
                HydratedFourRowTemplate.prototype.locationMessage = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HydratedFourRowTemplate.prototype, "_hydratedContentText", {
                    get: $util.oneOfGetter($oneOfFields = ["hydratedContentText"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HydratedFourRowTemplate.prototype, "_hydratedFooterText", {
                    get: $util.oneOfGetter($oneOfFields = ["hydratedFooterText"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HydratedFourRowTemplate.prototype, "_templateId", {
                    get: $util.oneOfGetter($oneOfFields = ["templateId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(HydratedFourRowTemplate.prototype, "_maskLinkedDevices", {
                    get: $util.oneOfGetter($oneOfFields = ["maskLinkedDevices"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Object.defineProperty(HydratedFourRowTemplate.prototype, "title", {
                    get: $util.oneOfGetter($oneOfFields = ["documentMessage", "hydratedTitleText", "imageMessage", "videoMessage", "locationMessage"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                HydratedFourRowTemplate.create = function create(properties) {
                    return new HydratedFourRowTemplate(properties);
                };

                HydratedFourRowTemplate.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.documentMessage != null && Object.hasOwnProperty.call(m, "documentMessage"))
                        $root.proto.Message.DocumentMessage.encode(m.documentMessage, w.uint32(10).fork()).ldelim();
                    if (m.hydratedTitleText != null && Object.hasOwnProperty.call(m, "hydratedTitleText"))
                        w.uint32(18).string(m.hydratedTitleText);
                    if (m.imageMessage != null && Object.hasOwnProperty.call(m, "imageMessage"))
                        $root.proto.Message.ImageMessage.encode(m.imageMessage, w.uint32(26).fork()).ldelim();
                    if (m.videoMessage != null && Object.hasOwnProperty.call(m, "videoMessage"))
                        $root.proto.Message.VideoMessage.encode(m.videoMessage, w.uint32(34).fork()).ldelim();
                    if (m.locationMessage != null && Object.hasOwnProperty.call(m, "locationMessage"))
                        $root.proto.Message.LocationMessage.encode(m.locationMessage, w.uint32(42).fork()).ldelim();
                    if (m.hydratedContentText != null && Object.hasOwnProperty.call(m, "hydratedContentText"))
                        w.uint32(50).string(m.hydratedContentText);
                    if (m.hydratedFooterText != null && Object.hasOwnProperty.call(m, "hydratedFooterText"))
                        w.uint32(58).string(m.hydratedFooterText);
                    if (m.hydratedButtons != null && m.hydratedButtons.length) {
                        for (var i = 0; i < m.hydratedButtons.length; ++i)
                            $root.proto.HydratedTemplateButton.encode(m.hydratedButtons[i], w.uint32(66).fork()).ldelim();
                    }
                    if (m.templateId != null && Object.hasOwnProperty.call(m, "templateId"))
                        w.uint32(74).string(m.templateId);
                    if (m.maskLinkedDevices != null && Object.hasOwnProperty.call(m, "maskLinkedDevices"))
                        w.uint32(80).bool(m.maskLinkedDevices);
                    return w;
                };

                HydratedFourRowTemplate.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.TemplateMessage.HydratedFourRowTemplate();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 6: {
                                m.hydratedContentText = r.string();
                                break;
                            }
                        case 7: {
                                m.hydratedFooterText = r.string();
                                break;
                            }
                        case 8: {
                                if (!(m.hydratedButtons && m.hydratedButtons.length))
                                    m.hydratedButtons = [];
                                m.hydratedButtons.push($root.proto.HydratedTemplateButton.decode(r, r.uint32()));
                                break;
                            }
                        case 9: {
                                m.templateId = r.string();
                                break;
                            }
                        case 10: {
                                m.maskLinkedDevices = r.bool();
                                break;
                            }
                        case 1: {
                                m.documentMessage = $root.proto.Message.DocumentMessage.decode(r, r.uint32());
                                break;
                            }
                        case 2: {
                                m.hydratedTitleText = r.string();
                                break;
                            }
                        case 3: {
                                m.imageMessage = $root.proto.Message.ImageMessage.decode(r, r.uint32());
                                break;
                            }
                        case 4: {
                                m.videoMessage = $root.proto.Message.VideoMessage.decode(r, r.uint32());
                                break;
                            }
                        case 5: {
                                m.locationMessage = $root.proto.Message.LocationMessage.decode(r, r.uint32());
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                HydratedFourRowTemplate.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.Message.TemplateMessage.HydratedFourRowTemplate)
                        return d;
                    var m = new $root.proto.Message.TemplateMessage.HydratedFourRowTemplate();
                    if (d.hydratedContentText != null) {
                        m.hydratedContentText = String(d.hydratedContentText);
                    }
                    if (d.hydratedFooterText != null) {
                        m.hydratedFooterText = String(d.hydratedFooterText);
                    }
                    if (d.hydratedButtons) {
                        if (!Array.isArray(d.hydratedButtons))
                            throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: array expected");
                        m.hydratedButtons = [];
                        for (var i = 0; i < d.hydratedButtons.length; ++i) {
                            if (typeof d.hydratedButtons[i] !== "object")
                                throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: object expected");
                            m.hydratedButtons[i] = $root.proto.HydratedTemplateButton.fromObject(d.hydratedButtons[i]);
                        }
                    }
                    if (d.templateId != null) {
                        m.templateId = String(d.templateId);
                    }
                    if (d.maskLinkedDevices != null) {
                        m.maskLinkedDevices = Boolean(d.maskLinkedDevices);
                    }
                    if (d.documentMessage != null) {
                        if (typeof d.documentMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.documentMessage: object expected");
                        m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage);
                    }
                    if (d.hydratedTitleText != null) {
                        m.hydratedTitleText = String(d.hydratedTitleText);
                    }
                    if (d.imageMessage != null) {
                        if (typeof d.imageMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.imageMessage: object expected");
                        m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage);
                    }
                    if (d.videoMessage != null) {
                        if (typeof d.videoMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.videoMessage: object expected");
                        m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage);
                    }
                    if (d.locationMessage != null) {
                        if (typeof d.locationMessage !== "object")
                            throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.locationMessage: object expected");
                        m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage);
                    }
                    return m;
                };

                HydratedFourRowTemplate.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (o.arrays || o.defaults) {
                        d.hydratedButtons = [];
                    }
                    if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) {
                        d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o);
                        if (o.oneofs)
                            d.title = "documentMessage";
                    }
                    if (m.hydratedTitleText != null && m.hasOwnProperty("hydratedTitleText")) {
                        d.hydratedTitleText = m.hydratedTitleText;
                        if (o.oneofs)
                            d.title = "hydratedTitleText";
                    }
                    if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) {
                        d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o);
                        if (o.oneofs)
                            d.title = "imageMessage";
                    }
                    if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) {
                        d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o);
                        if (o.oneofs)
                            d.title = "videoMessage";
                    }
                    if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) {
                        d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o);
                        if (o.oneofs)
                            d.title = "locationMessage";
                    }
                    if (m.hydratedContentText != null && m.hasOwnProperty("hydratedContentText")) {
                        d.hydratedContentText = m.hydratedContentText;
                        if (o.oneofs)
                            d._hydratedContentText = "hydratedContentText";
                    }
                    if (m.hydratedFooterText != null && m.hasOwnProperty("hydratedFooterText")) {
                        d.hydratedFooterText = m.hydratedFooterText;
                        if (o.oneofs)
                            d._hydratedFooterText = "hydratedFooterText";
                    }
                    if (m.hydratedButtons && m.hydratedButtons.length) {
                        d.hydratedButtons = [];
                        for (var j = 0; j < m.hydratedButtons.length; ++j) {
                            d.hydratedButtons[j] = $root.proto.HydratedTemplateButton.toObject(m.hydratedButtons[j], o);
                        }
                    }
                    if (m.templateId != null && m.hasOwnProperty("templateId")) {
                        d.templateId = m.templateId;
                        if (o.oneofs)
                            d._templateId = "templateId";
                    }
                    if (m.maskLinkedDevices != null && m.hasOwnProperty("maskLinkedDevices")) {
                        d.maskLinkedDevices = m.maskLinkedDevices;
                        if (o.oneofs)
                            d._maskLinkedDevices = "maskLinkedDevices";
                    }
                    return d;
                };

                HydratedFourRowTemplate.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                HydratedFourRowTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.Message.TemplateMessage.HydratedFourRowTemplate";
                };

                return HydratedFourRowTemplate;
            })();

            return TemplateMessage;
        })();

        Message.URLMetadata = (function() {

            function URLMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            URLMetadata.prototype.fbExperimentId = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(URLMetadata.prototype, "_fbExperimentId", {
                get: $util.oneOfGetter($oneOfFields = ["fbExperimentId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            URLMetadata.create = function create(properties) {
                return new URLMetadata(properties);
            };

            URLMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.fbExperimentId != null && Object.hasOwnProperty.call(m, "fbExperimentId"))
                    w.uint32(8).uint32(m.fbExperimentId);
                return w;
            };

            URLMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.URLMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.fbExperimentId = r.uint32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            URLMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.URLMetadata)
                    return d;
                var m = new $root.proto.Message.URLMetadata();
                if (d.fbExperimentId != null) {
                    m.fbExperimentId = d.fbExperimentId >>> 0;
                }
                return m;
            };

            URLMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.fbExperimentId != null && m.hasOwnProperty("fbExperimentId")) {
                    d.fbExperimentId = m.fbExperimentId;
                    if (o.oneofs)
                        d._fbExperimentId = "fbExperimentId";
                }
                return d;
            };

            URLMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            URLMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.URLMetadata";
            };

            return URLMetadata;
        })();

        Message.VideoEndCard = (function() {

            function VideoEndCard(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            VideoEndCard.prototype.username = "";
            VideoEndCard.prototype.caption = "";
            VideoEndCard.prototype.thumbnailImageUrl = "";
            VideoEndCard.prototype.profilePictureUrl = "";

            VideoEndCard.create = function create(properties) {
                return new VideoEndCard(properties);
            };

            VideoEndCard.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.username != null && Object.hasOwnProperty.call(m, "username"))
                    w.uint32(10).string(m.username);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(18).string(m.caption);
                if (m.thumbnailImageUrl != null && Object.hasOwnProperty.call(m, "thumbnailImageUrl"))
                    w.uint32(26).string(m.thumbnailImageUrl);
                if (m.profilePictureUrl != null && Object.hasOwnProperty.call(m, "profilePictureUrl"))
                    w.uint32(34).string(m.profilePictureUrl);
                return w;
            };

            VideoEndCard.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.VideoEndCard();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.username = r.string();
                            break;
                        }
                    case 2: {
                            m.caption = r.string();
                            break;
                        }
                    case 3: {
                            m.thumbnailImageUrl = r.string();
                            break;
                        }
                    case 4: {
                            m.profilePictureUrl = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            VideoEndCard.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.VideoEndCard)
                    return d;
                var m = new $root.proto.Message.VideoEndCard();
                if (d.username != null) {
                    m.username = String(d.username);
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.thumbnailImageUrl != null) {
                    m.thumbnailImageUrl = String(d.thumbnailImageUrl);
                }
                if (d.profilePictureUrl != null) {
                    m.profilePictureUrl = String(d.profilePictureUrl);
                }
                return m;
            };

            VideoEndCard.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.defaults) {
                    d.username = "";
                    d.caption = "";
                    d.thumbnailImageUrl = "";
                    d.profilePictureUrl = "";
                }
                if (m.username != null && m.hasOwnProperty("username")) {
                    d.username = m.username;
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                }
                if (m.thumbnailImageUrl != null && m.hasOwnProperty("thumbnailImageUrl")) {
                    d.thumbnailImageUrl = m.thumbnailImageUrl;
                }
                if (m.profilePictureUrl != null && m.hasOwnProperty("profilePictureUrl")) {
                    d.profilePictureUrl = m.profilePictureUrl;
                }
                return d;
            };

            VideoEndCard.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            VideoEndCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.VideoEndCard";
            };

            return VideoEndCard;
        })();

        Message.VideoMessage = (function() {

            function VideoMessage(p) {
                this.interactiveAnnotations = [];
                this.annotations = [];
                this.processedVideos = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            VideoMessage.prototype.url = null;
            VideoMessage.prototype.mimetype = null;
            VideoMessage.prototype.fileSha256 = null;
            VideoMessage.prototype.fileLength = null;
            VideoMessage.prototype.seconds = null;
            VideoMessage.prototype.mediaKey = null;
            VideoMessage.prototype.caption = null;
            VideoMessage.prototype.gifPlayback = null;
            VideoMessage.prototype.height = null;
            VideoMessage.prototype.width = null;
            VideoMessage.prototype.fileEncSha256 = null;
            VideoMessage.prototype.interactiveAnnotations = $util.emptyArray;
            VideoMessage.prototype.directPath = null;
            VideoMessage.prototype.mediaKeyTimestamp = null;
            VideoMessage.prototype.jpegThumbnail = null;
            VideoMessage.prototype.contextInfo = null;
            VideoMessage.prototype.streamingSidecar = null;
            VideoMessage.prototype.gifAttribution = null;
            VideoMessage.prototype.viewOnce = null;
            VideoMessage.prototype.thumbnailDirectPath = null;
            VideoMessage.prototype.thumbnailSha256 = null;
            VideoMessage.prototype.thumbnailEncSha256 = null;
            VideoMessage.prototype.staticUrl = null;
            VideoMessage.prototype.annotations = $util.emptyArray;
            VideoMessage.prototype.accessibilityLabel = null;
            VideoMessage.prototype.processedVideos = $util.emptyArray;
            VideoMessage.prototype.externalShareFullVideoDurationInSeconds = null;
            VideoMessage.prototype.motionPhotoPresentationOffsetMs = null;
            VideoMessage.prototype.metadataUrl = null;
            VideoMessage.prototype.videoSourceType = null;
            VideoMessage.prototype.mediaKeyDomain = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_mimetype", {
                get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_fileLength", {
                get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_seconds", {
                get: $util.oneOfGetter($oneOfFields = ["seconds"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_caption", {
                get: $util.oneOfGetter($oneOfFields = ["caption"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_gifPlayback", {
                get: $util.oneOfGetter($oneOfFields = ["gifPlayback"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_height", {
                get: $util.oneOfGetter($oneOfFields = ["height"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_width", {
                get: $util.oneOfGetter($oneOfFields = ["width"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_contextInfo", {
                get: $util.oneOfGetter($oneOfFields = ["contextInfo"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_streamingSidecar", {
                get: $util.oneOfGetter($oneOfFields = ["streamingSidecar"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_gifAttribution", {
                get: $util.oneOfGetter($oneOfFields = ["gifAttribution"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_viewOnce", {
                get: $util.oneOfGetter($oneOfFields = ["viewOnce"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_thumbnailDirectPath", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_thumbnailSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_thumbnailEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_staticUrl", {
                get: $util.oneOfGetter($oneOfFields = ["staticUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_accessibilityLabel", {
                get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_externalShareFullVideoDurationInSeconds", {
                get: $util.oneOfGetter($oneOfFields = ["externalShareFullVideoDurationInSeconds"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_motionPhotoPresentationOffsetMs", {
                get: $util.oneOfGetter($oneOfFields = ["motionPhotoPresentationOffsetMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_metadataUrl", {
                get: $util.oneOfGetter($oneOfFields = ["metadataUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_videoSourceType", {
                get: $util.oneOfGetter($oneOfFields = ["videoSourceType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(VideoMessage.prototype, "_mediaKeyDomain", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyDomain"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            VideoMessage.create = function create(properties) {
                return new VideoMessage(properties);
            };

            VideoMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(10).string(m.url);
                if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                    w.uint32(18).string(m.mimetype);
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(26).bytes(m.fileSha256);
                if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                    w.uint32(32).uint64(m.fileLength);
                if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds"))
                    w.uint32(40).uint32(m.seconds);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(50).bytes(m.mediaKey);
                if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                    w.uint32(58).string(m.caption);
                if (m.gifPlayback != null && Object.hasOwnProperty.call(m, "gifPlayback"))
                    w.uint32(64).bool(m.gifPlayback);
                if (m.height != null && Object.hasOwnProperty.call(m, "height"))
                    w.uint32(72).uint32(m.height);
                if (m.width != null && Object.hasOwnProperty.call(m, "width"))
                    w.uint32(80).uint32(m.width);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(90).bytes(m.fileEncSha256);
                if (m.interactiveAnnotations != null && m.interactiveAnnotations.length) {
                    for (var i = 0; i < m.interactiveAnnotations.length; ++i)
                        $root.proto.InteractiveAnnotation.encode(m.interactiveAnnotations[i], w.uint32(98).fork()).ldelim();
                }
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(106).string(m.directPath);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(112).int64(m.mediaKeyTimestamp);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(130).bytes(m.jpegThumbnail);
                if (m.contextInfo != null && Object.hasOwnProperty.call(m, "contextInfo"))
                    $root.proto.ContextInfo.encode(m.contextInfo, w.uint32(138).fork()).ldelim();
                if (m.streamingSidecar != null && Object.hasOwnProperty.call(m, "streamingSidecar"))
                    w.uint32(146).bytes(m.streamingSidecar);
                if (m.gifAttribution != null && Object.hasOwnProperty.call(m, "gifAttribution"))
                    w.uint32(152).int32(m.gifAttribution);
                if (m.viewOnce != null && Object.hasOwnProperty.call(m, "viewOnce"))
                    w.uint32(160).bool(m.viewOnce);
                if (m.thumbnailDirectPath != null && Object.hasOwnProperty.call(m, "thumbnailDirectPath"))
                    w.uint32(170).string(m.thumbnailDirectPath);
                if (m.thumbnailSha256 != null && Object.hasOwnProperty.call(m, "thumbnailSha256"))
                    w.uint32(178).bytes(m.thumbnailSha256);
                if (m.thumbnailEncSha256 != null && Object.hasOwnProperty.call(m, "thumbnailEncSha256"))
                    w.uint32(186).bytes(m.thumbnailEncSha256);
                if (m.staticUrl != null && Object.hasOwnProperty.call(m, "staticUrl"))
                    w.uint32(194).string(m.staticUrl);
                if (m.annotations != null && m.annotations.length) {
                    for (var i = 0; i < m.annotations.length; ++i)
                        $root.proto.InteractiveAnnotation.encode(m.annotations[i], w.uint32(202).fork()).ldelim();
                }
                if (m.accessibilityLabel != null && Object.hasOwnProperty.call(m, "accessibilityLabel"))
                    w.uint32(210).string(m.accessibilityLabel);
                if (m.processedVideos != null && m.processedVideos.length) {
                    for (var i = 0; i < m.processedVideos.length; ++i)
                        $root.proto.ProcessedVideo.encode(m.processedVideos[i], w.uint32(218).fork()).ldelim();
                }
                if (m.externalShareFullVideoDurationInSeconds != null && Object.hasOwnProperty.call(m, "externalShareFullVideoDurationInSeconds"))
                    w.uint32(224).uint32(m.externalShareFullVideoDurationInSeconds);
                if (m.motionPhotoPresentationOffsetMs != null && Object.hasOwnProperty.call(m, "motionPhotoPresentationOffsetMs"))
                    w.uint32(232).uint64(m.motionPhotoPresentationOffsetMs);
                if (m.metadataUrl != null && Object.hasOwnProperty.call(m, "metadataUrl"))
                    w.uint32(242).string(m.metadataUrl);
                if (m.videoSourceType != null && Object.hasOwnProperty.call(m, "videoSourceType"))
                    w.uint32(248).int32(m.videoSourceType);
                if (m.mediaKeyDomain != null && Object.hasOwnProperty.call(m, "mediaKeyDomain"))
                    w.uint32(256).int32(m.mediaKeyDomain);
                return w;
            };

            VideoMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.VideoMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.url = r.string();
                            break;
                        }
                    case 2: {
                            m.mimetype = r.string();
                            break;
                        }
                    case 3: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 4: {
                            m.fileLength = r.uint64();
                            break;
                        }
                    case 5: {
                            m.seconds = r.uint32();
                            break;
                        }
                    case 6: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 7: {
                            m.caption = r.string();
                            break;
                        }
                    case 8: {
                            m.gifPlayback = r.bool();
                            break;
                        }
                    case 9: {
                            m.height = r.uint32();
                            break;
                        }
                    case 10: {
                            m.width = r.uint32();
                            break;
                        }
                    case 11: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 12: {
                            if (!(m.interactiveAnnotations && m.interactiveAnnotations.length))
                                m.interactiveAnnotations = [];
                            m.interactiveAnnotations.push($root.proto.InteractiveAnnotation.decode(r, r.uint32()));
                            break;
                        }
                    case 13: {
                            m.directPath = r.string();
                            break;
                        }
                    case 14: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 16: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    case 17: {
                            m.contextInfo = $root.proto.ContextInfo.decode(r, r.uint32());
                            break;
                        }
                    case 18: {
                            m.streamingSidecar = r.bytes();
                            break;
                        }
                    case 19: {
                            m.gifAttribution = r.int32();
                            break;
                        }
                    case 20: {
                            m.viewOnce = r.bool();
                            break;
                        }
                    case 21: {
                            m.thumbnailDirectPath = r.string();
                            break;
                        }
                    case 22: {
                            m.thumbnailSha256 = r.bytes();
                            break;
                        }
                    case 23: {
                            m.thumbnailEncSha256 = r.bytes();
                            break;
                        }
                    case 24: {
                            m.staticUrl = r.string();
                            break;
                        }
                    case 25: {
                            if (!(m.annotations && m.annotations.length))
                                m.annotations = [];
                            m.annotations.push($root.proto.InteractiveAnnotation.decode(r, r.uint32()));
                            break;
                        }
                    case 26: {
                            m.accessibilityLabel = r.string();
                            break;
                        }
                    case 27: {
                            if (!(m.processedVideos && m.processedVideos.length))
                                m.processedVideos = [];
                            m.processedVideos.push($root.proto.ProcessedVideo.decode(r, r.uint32()));
                            break;
                        }
                    case 28: {
                            m.externalShareFullVideoDurationInSeconds = r.uint32();
                            break;
                        }
                    case 29: {
                            m.motionPhotoPresentationOffsetMs = r.uint64();
                            break;
                        }
                    case 30: {
                            m.metadataUrl = r.string();
                            break;
                        }
                    case 31: {
                            m.videoSourceType = r.int32();
                            break;
                        }
                    case 32: {
                            m.mediaKeyDomain = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            VideoMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.Message.VideoMessage)
                    return d;
                var m = new $root.proto.Message.VideoMessage();
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.mimetype != null) {
                    m.mimetype = String(d.mimetype);
                }
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.fileLength != null) {
                    if ($util.Long)
                        (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                    else if (typeof d.fileLength === "string")
                        m.fileLength = parseInt(d.fileLength, 10);
                    else if (typeof d.fileLength === "number")
                        m.fileLength = d.fileLength;
                    else if (typeof d.fileLength === "object")
                        m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
                }
                if (d.seconds != null) {
                    m.seconds = d.seconds >>> 0;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.caption != null) {
                    m.caption = String(d.caption);
                }
                if (d.gifPlayback != null) {
                    m.gifPlayback = Boolean(d.gifPlayback);
                }
                if (d.height != null) {
                    m.height = d.height >>> 0;
                }
                if (d.width != null) {
                    m.width = d.width >>> 0;
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.interactiveAnnotations) {
                    if (!Array.isArray(d.interactiveAnnotations))
                        throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: array expected");
                    m.interactiveAnnotations = [];
                    for (var i = 0; i < d.interactiveAnnotations.length; ++i) {
                        if (typeof d.interactiveAnnotations[i] !== "object")
                            throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: object expected");
                        m.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(d.interactiveAnnotations[i]);
                    }
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                if (d.contextInfo != null) {
                    if (typeof d.contextInfo !== "object")
                        throw TypeError(".proto.Message.VideoMessage.contextInfo: object expected");
                    m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo);
                }
                if (d.streamingSidecar != null) {
                    if (typeof d.streamingSidecar === "string")
                        $util.base64.decode(d.streamingSidecar, m.streamingSidecar = $util.newBuffer($util.base64.length(d.streamingSidecar)), 0);
                    else if (d.streamingSidecar.length >= 0)
                        m.streamingSidecar = d.streamingSidecar;
                }
                switch (d.gifAttribution) {
                default:
                    if (typeof d.gifAttribution === "number") {
                        m.gifAttribution = d.gifAttribution;
                        break;
                    }
                    break;
                case "NONE":
                case 0:
                    m.gifAttribution = 0;
                    break;
                case "GIPHY":
                case 1:
                    m.gifAttribution = 1;
                    break;
                case "TENOR":
                case 2:
                    m.gifAttribution = 2;
                    break;
                case "KLIPY":
                case 3:
                    m.gifAttribution = 3;
                    break;
                }
                if (d.viewOnce != null) {
                    m.viewOnce = Boolean(d.viewOnce);
                }
                if (d.thumbnailDirectPath != null) {
                    m.thumbnailDirectPath = String(d.thumbnailDirectPath);
                }
                if (d.thumbnailSha256 != null) {
                    if (typeof d.thumbnailSha256 === "string")
                        $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0);
                    else if (d.thumbnailSha256.length >= 0)
                        m.thumbnailSha256 = d.thumbnailSha256;
                }
                if (d.thumbnailEncSha256 != null) {
                    if (typeof d.thumbnailEncSha256 === "string")
                        $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0);
                    else if (d.thumbnailEncSha256.length >= 0)
                        m.thumbnailEncSha256 = d.thumbnailEncSha256;
                }
                if (d.staticUrl != null) {
                    m.staticUrl = String(d.staticUrl);
                }
                if (d.annotations) {
                    if (!Array.isArray(d.annotations))
                        throw TypeError(".proto.Message.VideoMessage.annotations: array expected");
                    m.annotations = [];
                    for (var i = 0; i < d.annotations.length; ++i) {
                        if (typeof d.annotations[i] !== "object")
                            throw TypeError(".proto.Message.VideoMessage.annotations: object expected");
                        m.annotations[i] = $root.proto.InteractiveAnnotation.fromObject(d.annotations[i]);
                    }
                }
                if (d.accessibilityLabel != null) {
                    m.accessibilityLabel = String(d.accessibilityLabel);
                }
                if (d.processedVideos) {
                    if (!Array.isArray(d.processedVideos))
                        throw TypeError(".proto.Message.VideoMessage.processedVideos: array expected");
                    m.processedVideos = [];
                    for (var i = 0; i < d.processedVideos.length; ++i) {
                        if (typeof d.processedVideos[i] !== "object")
                            throw TypeError(".proto.Message.VideoMessage.processedVideos: object expected");
                        m.processedVideos[i] = $root.proto.ProcessedVideo.fromObject(d.processedVideos[i]);
                    }
                }
                if (d.externalShareFullVideoDurationInSeconds != null) {
                    m.externalShareFullVideoDurationInSeconds = d.externalShareFullVideoDurationInSeconds >>> 0;
                }
                if (d.motionPhotoPresentationOffsetMs != null) {
                    if ($util.Long)
                        (m.motionPhotoPresentationOffsetMs = $util.Long.fromValue(d.motionPhotoPresentationOffsetMs)).unsigned = true;
                    else if (typeof d.motionPhotoPresentationOffsetMs === "string")
                        m.motionPhotoPresentationOffsetMs = parseInt(d.motionPhotoPresentationOffsetMs, 10);
                    else if (typeof d.motionPhotoPresentationOffsetMs === "number")
                        m.motionPhotoPresentationOffsetMs = d.motionPhotoPresentationOffsetMs;
                    else if (typeof d.motionPhotoPresentationOffsetMs === "object")
                        m.motionPhotoPresentationOffsetMs = new $util.LongBits(d.motionPhotoPresentationOffsetMs.low >>> 0, d.motionPhotoPresentationOffsetMs.high >>> 0).toNumber(true);
                }
                if (d.metadataUrl != null) {
                    m.metadataUrl = String(d.metadataUrl);
                }
                switch (d.videoSourceType) {
                default:
                    if (typeof d.videoSourceType === "number") {
                        m.videoSourceType = d.videoSourceType;
                        break;
                    }
                    break;
                case "USER_VIDEO":
                case 0:
                    m.videoSourceType = 0;
                    break;
                case "AI_GENERATED":
                case 1:
                    m.videoSourceType = 1;
                    break;
                }
                switch (d.mediaKeyDomain) {
                default:
                    if (typeof d.mediaKeyDomain === "number") {
                        m.mediaKeyDomain = d.mediaKeyDomain;
                        break;
                    }
                    break;
                case "UNSET":
                case 0:
                    m.mediaKeyDomain = 0;
                    break;
                case "E2EE_CHAT":
                case 1:
                    m.mediaKeyDomain = 1;
                    break;
                case "STATUS":
                case 2:
                    m.mediaKeyDomain = 2;
                    break;
                case "CAPI":
                case 3:
                    m.mediaKeyDomain = 3;
                    break;
                case "BOT":
                case 4:
                    m.mediaKeyDomain = 4;
                    break;
                }
                return m;
            };

            VideoMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.interactiveAnnotations = [];
                    d.annotations = [];
                    d.processedVideos = [];
                }
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                    d.mimetype = m.mimetype;
                    if (o.oneofs)
                        d._mimetype = "mimetype";
                }
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                    if (typeof m.fileLength === "number")
                        d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                    else
                        d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                    if (o.oneofs)
                        d._fileLength = "fileLength";
                }
                if (m.seconds != null && m.hasOwnProperty("seconds")) {
                    d.seconds = m.seconds;
                    if (o.oneofs)
                        d._seconds = "seconds";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.caption != null && m.hasOwnProperty("caption")) {
                    d.caption = m.caption;
                    if (o.oneofs)
                        d._caption = "caption";
                }
                if (m.gifPlayback != null && m.hasOwnProperty("gifPlayback")) {
                    d.gifPlayback = m.gifPlayback;
                    if (o.oneofs)
                        d._gifPlayback = "gifPlayback";
                }
                if (m.height != null && m.hasOwnProperty("height")) {
                    d.height = m.height;
                    if (o.oneofs)
                        d._height = "height";
                }
                if (m.width != null && m.hasOwnProperty("width")) {
                    d.width = m.width;
                    if (o.oneofs)
                        d._width = "width";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.interactiveAnnotations && m.interactiveAnnotations.length) {
                    d.interactiveAnnotations = [];
                    for (var j = 0; j < m.interactiveAnnotations.length; ++j) {
                        d.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(m.interactiveAnnotations[j], o);
                    }
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) {
                    d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o);
                    if (o.oneofs)
                        d._contextInfo = "contextInfo";
                }
                if (m.streamingSidecar != null && m.hasOwnProperty("streamingSidecar")) {
                    d.streamingSidecar = o.bytes === String ? $util.base64.encode(m.streamingSidecar, 0, m.streamingSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.streamingSidecar) : m.streamingSidecar;
                    if (o.oneofs)
                        d._streamingSidecar = "streamingSidecar";
                }
                if (m.gifAttribution != null && m.hasOwnProperty("gifAttribution")) {
                    d.gifAttribution = o.enums === String ? $root.proto.Message.VideoMessage.Attribution[m.gifAttribution] === undefined ? m.gifAttribution : $root.proto.Message.VideoMessage.Attribution[m.gifAttribution] : m.gifAttribution;
                    if (o.oneofs)
                        d._gifAttribution = "gifAttribution";
                }
                if (m.viewOnce != null && m.hasOwnProperty("viewOnce")) {
                    d.viewOnce = m.viewOnce;
                    if (o.oneofs)
                        d._viewOnce = "viewOnce";
                }
                if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) {
                    d.thumbnailDirectPath = m.thumbnailDirectPath;
                    if (o.oneofs)
                        d._thumbnailDirectPath = "thumbnailDirectPath";
                }
                if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) {
                    d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256;
                    if (o.oneofs)
                        d._thumbnailSha256 = "thumbnailSha256";
                }
                if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) {
                    d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256;
                    if (o.oneofs)
                        d._thumbnailEncSha256 = "thumbnailEncSha256";
                }
                if (m.staticUrl != null && m.hasOwnProperty("staticUrl")) {
                    d.staticUrl = m.staticUrl;
                    if (o.oneofs)
                        d._staticUrl = "staticUrl";
                }
                if (m.annotations && m.annotations.length) {
                    d.annotations = [];
                    for (var j = 0; j < m.annotations.length; ++j) {
                        d.annotations[j] = $root.proto.InteractiveAnnotation.toObject(m.annotations[j], o);
                    }
                }
                if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) {
                    d.accessibilityLabel = m.accessibilityLabel;
                    if (o.oneofs)
                        d._accessibilityLabel = "accessibilityLabel";
                }
                if (m.processedVideos && m.processedVideos.length) {
                    d.processedVideos = [];
                    for (var j = 0; j < m.processedVideos.length; ++j) {
                        d.processedVideos[j] = $root.proto.ProcessedVideo.toObject(m.processedVideos[j], o);
                    }
                }
                if (m.externalShareFullVideoDurationInSeconds != null && m.hasOwnProperty("externalShareFullVideoDurationInSeconds")) {
                    d.externalShareFullVideoDurationInSeconds = m.externalShareFullVideoDurationInSeconds;
                    if (o.oneofs)
                        d._externalShareFullVideoDurationInSeconds = "externalShareFullVideoDurationInSeconds";
                }
                if (m.motionPhotoPresentationOffsetMs != null && m.hasOwnProperty("motionPhotoPresentationOffsetMs")) {
                    if (typeof m.motionPhotoPresentationOffsetMs === "number")
                        d.motionPhotoPresentationOffsetMs = o.longs === String ? String(m.motionPhotoPresentationOffsetMs) : m.motionPhotoPresentationOffsetMs;
                    else
                        d.motionPhotoPresentationOffsetMs = o.longs === String ? longToString(m.motionPhotoPresentationOffsetMs, true) : o.longs === Number ? longToNumber(m.motionPhotoPresentationOffsetMs, true) : m.motionPhotoPresentationOffsetMs;
                    if (o.oneofs)
                        d._motionPhotoPresentationOffsetMs = "motionPhotoPresentationOffsetMs";
                }
                if (m.metadataUrl != null && m.hasOwnProperty("metadataUrl")) {
                    d.metadataUrl = m.metadataUrl;
                    if (o.oneofs)
                        d._metadataUrl = "metadataUrl";
                }
                if (m.videoSourceType != null && m.hasOwnProperty("videoSourceType")) {
                    d.videoSourceType = o.enums === String ? $root.proto.Message.VideoMessage.VideoSourceType[m.videoSourceType] === undefined ? m.videoSourceType : $root.proto.Message.VideoMessage.VideoSourceType[m.videoSourceType] : m.videoSourceType;
                    if (o.oneofs)
                        d._videoSourceType = "videoSourceType";
                }
                if (m.mediaKeyDomain != null && m.hasOwnProperty("mediaKeyDomain")) {
                    d.mediaKeyDomain = o.enums === String ? $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] === undefined ? m.mediaKeyDomain : $root.proto.Message.MediaKeyDomain[m.mediaKeyDomain] : m.mediaKeyDomain;
                    if (o.oneofs)
                        d._mediaKeyDomain = "mediaKeyDomain";
                }
                return d;
            };

            VideoMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            VideoMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.Message.VideoMessage";
            };

            VideoMessage.Attribution = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "NONE"] = 0;
                values[valuesById[1] = "GIPHY"] = 1;
                values[valuesById[2] = "TENOR"] = 2;
                values[valuesById[3] = "KLIPY"] = 3;
                return values;
            })();

            VideoMessage.VideoSourceType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "USER_VIDEO"] = 0;
                values[valuesById[1] = "AI_GENERATED"] = 1;
                return values;
            })();

            return VideoMessage;
        })();

        return Message;
    })();

    proto.MessageAddOn = (function() {

        function MessageAddOn(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MessageAddOn.prototype.messageAddOnType = null;
        MessageAddOn.prototype.messageAddOn = null;
        MessageAddOn.prototype.senderTimestampMs = null;
        MessageAddOn.prototype.serverTimestampMs = null;
        MessageAddOn.prototype.status = null;
        MessageAddOn.prototype.addOnContextInfo = null;
        MessageAddOn.prototype.messageAddOnKey = null;
        MessageAddOn.prototype.legacyMessage = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOn.prototype, "_messageAddOnType", {
            get: $util.oneOfGetter($oneOfFields = ["messageAddOnType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOn.prototype, "_messageAddOn", {
            get: $util.oneOfGetter($oneOfFields = ["messageAddOn"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOn.prototype, "_senderTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOn.prototype, "_serverTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOn.prototype, "_status", {
            get: $util.oneOfGetter($oneOfFields = ["status"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOn.prototype, "_addOnContextInfo", {
            get: $util.oneOfGetter($oneOfFields = ["addOnContextInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOn.prototype, "_messageAddOnKey", {
            get: $util.oneOfGetter($oneOfFields = ["messageAddOnKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOn.prototype, "_legacyMessage", {
            get: $util.oneOfGetter($oneOfFields = ["legacyMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MessageAddOn.create = function create(properties) {
            return new MessageAddOn(properties);
        };

        MessageAddOn.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.messageAddOnType != null && Object.hasOwnProperty.call(m, "messageAddOnType"))
                w.uint32(8).int32(m.messageAddOnType);
            if (m.messageAddOn != null && Object.hasOwnProperty.call(m, "messageAddOn"))
                $root.proto.Message.encode(m.messageAddOn, w.uint32(18).fork()).ldelim();
            if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
                w.uint32(24).int64(m.senderTimestampMs);
            if (m.serverTimestampMs != null && Object.hasOwnProperty.call(m, "serverTimestampMs"))
                w.uint32(32).int64(m.serverTimestampMs);
            if (m.status != null && Object.hasOwnProperty.call(m, "status"))
                w.uint32(40).int32(m.status);
            if (m.addOnContextInfo != null && Object.hasOwnProperty.call(m, "addOnContextInfo"))
                $root.proto.MessageAddOnContextInfo.encode(m.addOnContextInfo, w.uint32(50).fork()).ldelim();
            if (m.messageAddOnKey != null && Object.hasOwnProperty.call(m, "messageAddOnKey"))
                $root.proto.MessageKey.encode(m.messageAddOnKey, w.uint32(58).fork()).ldelim();
            if (m.legacyMessage != null && Object.hasOwnProperty.call(m, "legacyMessage"))
                $root.proto.LegacyMessage.encode(m.legacyMessage, w.uint32(66).fork()).ldelim();
            return w;
        };

        MessageAddOn.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MessageAddOn();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.messageAddOnType = r.int32();
                        break;
                    }
                case 2: {
                        m.messageAddOn = $root.proto.Message.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.senderTimestampMs = r.int64();
                        break;
                    }
                case 4: {
                        m.serverTimestampMs = r.int64();
                        break;
                    }
                case 5: {
                        m.status = r.int32();
                        break;
                    }
                case 6: {
                        m.addOnContextInfo = $root.proto.MessageAddOnContextInfo.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.messageAddOnKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.legacyMessage = $root.proto.LegacyMessage.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MessageAddOn.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MessageAddOn)
                return d;
            var m = new $root.proto.MessageAddOn();
            switch (d.messageAddOnType) {
            default:
                if (typeof d.messageAddOnType === "number") {
                    m.messageAddOnType = d.messageAddOnType;
                    break;
                }
                break;
            case "UNDEFINED":
            case 0:
                m.messageAddOnType = 0;
                break;
            case "REACTION":
            case 1:
                m.messageAddOnType = 1;
                break;
            case "EVENT_RESPONSE":
            case 2:
                m.messageAddOnType = 2;
                break;
            case "POLL_UPDATE":
            case 3:
                m.messageAddOnType = 3;
                break;
            case "PIN_IN_CHAT":
            case 4:
                m.messageAddOnType = 4;
                break;
            }
            if (d.messageAddOn != null) {
                if (typeof d.messageAddOn !== "object")
                    throw TypeError(".proto.MessageAddOn.messageAddOn: object expected");
                m.messageAddOn = $root.proto.Message.fromObject(d.messageAddOn);
            }
            if (d.senderTimestampMs != null) {
                if ($util.Long)
                    (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
                else if (typeof d.senderTimestampMs === "string")
                    m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
                else if (typeof d.senderTimestampMs === "number")
                    m.senderTimestampMs = d.senderTimestampMs;
                else if (typeof d.senderTimestampMs === "object")
                    m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
            }
            if (d.serverTimestampMs != null) {
                if ($util.Long)
                    (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false;
                else if (typeof d.serverTimestampMs === "string")
                    m.serverTimestampMs = parseInt(d.serverTimestampMs, 10);
                else if (typeof d.serverTimestampMs === "number")
                    m.serverTimestampMs = d.serverTimestampMs;
                else if (typeof d.serverTimestampMs === "object")
                    m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber();
            }
            switch (d.status) {
            default:
                if (typeof d.status === "number") {
                    m.status = d.status;
                    break;
                }
                break;
            case "ERROR":
            case 0:
                m.status = 0;
                break;
            case "PENDING":
            case 1:
                m.status = 1;
                break;
            case "SERVER_ACK":
            case 2:
                m.status = 2;
                break;
            case "DELIVERY_ACK":
            case 3:
                m.status = 3;
                break;
            case "READ":
            case 4:
                m.status = 4;
                break;
            case "PLAYED":
            case 5:
                m.status = 5;
                break;
            }
            if (d.addOnContextInfo != null) {
                if (typeof d.addOnContextInfo !== "object")
                    throw TypeError(".proto.MessageAddOn.addOnContextInfo: object expected");
                m.addOnContextInfo = $root.proto.MessageAddOnContextInfo.fromObject(d.addOnContextInfo);
            }
            if (d.messageAddOnKey != null) {
                if (typeof d.messageAddOnKey !== "object")
                    throw TypeError(".proto.MessageAddOn.messageAddOnKey: object expected");
                m.messageAddOnKey = $root.proto.MessageKey.fromObject(d.messageAddOnKey);
            }
            if (d.legacyMessage != null) {
                if (typeof d.legacyMessage !== "object")
                    throw TypeError(".proto.MessageAddOn.legacyMessage: object expected");
                m.legacyMessage = $root.proto.LegacyMessage.fromObject(d.legacyMessage);
            }
            return m;
        };

        MessageAddOn.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.messageAddOnType != null && m.hasOwnProperty("messageAddOnType")) {
                d.messageAddOnType = o.enums === String ? $root.proto.MessageAddOn.MessageAddOnType[m.messageAddOnType] === undefined ? m.messageAddOnType : $root.proto.MessageAddOn.MessageAddOnType[m.messageAddOnType] : m.messageAddOnType;
                if (o.oneofs)
                    d._messageAddOnType = "messageAddOnType";
            }
            if (m.messageAddOn != null && m.hasOwnProperty("messageAddOn")) {
                d.messageAddOn = $root.proto.Message.toObject(m.messageAddOn, o);
                if (o.oneofs)
                    d._messageAddOn = "messageAddOn";
            }
            if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
                if (typeof m.senderTimestampMs === "number")
                    d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
                else
                    d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
                if (o.oneofs)
                    d._senderTimestampMs = "senderTimestampMs";
            }
            if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) {
                if (typeof m.serverTimestampMs === "number")
                    d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs;
                else
                    d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs;
                if (o.oneofs)
                    d._serverTimestampMs = "serverTimestampMs";
            }
            if (m.status != null && m.hasOwnProperty("status")) {
                d.status = o.enums === String ? $root.proto.WebMessageInfo.Status[m.status] === undefined ? m.status : $root.proto.WebMessageInfo.Status[m.status] : m.status;
                if (o.oneofs)
                    d._status = "status";
            }
            if (m.addOnContextInfo != null && m.hasOwnProperty("addOnContextInfo")) {
                d.addOnContextInfo = $root.proto.MessageAddOnContextInfo.toObject(m.addOnContextInfo, o);
                if (o.oneofs)
                    d._addOnContextInfo = "addOnContextInfo";
            }
            if (m.messageAddOnKey != null && m.hasOwnProperty("messageAddOnKey")) {
                d.messageAddOnKey = $root.proto.MessageKey.toObject(m.messageAddOnKey, o);
                if (o.oneofs)
                    d._messageAddOnKey = "messageAddOnKey";
            }
            if (m.legacyMessage != null && m.hasOwnProperty("legacyMessage")) {
                d.legacyMessage = $root.proto.LegacyMessage.toObject(m.legacyMessage, o);
                if (o.oneofs)
                    d._legacyMessage = "legacyMessage";
            }
            return d;
        };

        MessageAddOn.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MessageAddOn.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MessageAddOn";
        };

        MessageAddOn.MessageAddOnType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNDEFINED"] = 0;
            values[valuesById[1] = "REACTION"] = 1;
            values[valuesById[2] = "EVENT_RESPONSE"] = 2;
            values[valuesById[3] = "POLL_UPDATE"] = 3;
            values[valuesById[4] = "PIN_IN_CHAT"] = 4;
            return values;
        })();

        return MessageAddOn;
    })();

    proto.MessageAddOnContextInfo = (function() {

        function MessageAddOnContextInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MessageAddOnContextInfo.prototype.messageAddOnDurationInSecs = null;
        MessageAddOnContextInfo.prototype.messageAddOnExpiryType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOnContextInfo.prototype, "_messageAddOnDurationInSecs", {
            get: $util.oneOfGetter($oneOfFields = ["messageAddOnDurationInSecs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAddOnContextInfo.prototype, "_messageAddOnExpiryType", {
            get: $util.oneOfGetter($oneOfFields = ["messageAddOnExpiryType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MessageAddOnContextInfo.create = function create(properties) {
            return new MessageAddOnContextInfo(properties);
        };

        MessageAddOnContextInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.messageAddOnDurationInSecs != null && Object.hasOwnProperty.call(m, "messageAddOnDurationInSecs"))
                w.uint32(8).uint32(m.messageAddOnDurationInSecs);
            if (m.messageAddOnExpiryType != null && Object.hasOwnProperty.call(m, "messageAddOnExpiryType"))
                w.uint32(16).int32(m.messageAddOnExpiryType);
            return w;
        };

        MessageAddOnContextInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MessageAddOnContextInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.messageAddOnDurationInSecs = r.uint32();
                        break;
                    }
                case 2: {
                        m.messageAddOnExpiryType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MessageAddOnContextInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MessageAddOnContextInfo)
                return d;
            var m = new $root.proto.MessageAddOnContextInfo();
            if (d.messageAddOnDurationInSecs != null) {
                m.messageAddOnDurationInSecs = d.messageAddOnDurationInSecs >>> 0;
            }
            switch (d.messageAddOnExpiryType) {
            default:
                if (typeof d.messageAddOnExpiryType === "number") {
                    m.messageAddOnExpiryType = d.messageAddOnExpiryType;
                    break;
                }
                break;
            case "STATIC":
            case 1:
                m.messageAddOnExpiryType = 1;
                break;
            case "DEPENDENT_ON_PARENT":
            case 2:
                m.messageAddOnExpiryType = 2;
                break;
            }
            return m;
        };

        MessageAddOnContextInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.messageAddOnDurationInSecs != null && m.hasOwnProperty("messageAddOnDurationInSecs")) {
                d.messageAddOnDurationInSecs = m.messageAddOnDurationInSecs;
                if (o.oneofs)
                    d._messageAddOnDurationInSecs = "messageAddOnDurationInSecs";
            }
            if (m.messageAddOnExpiryType != null && m.hasOwnProperty("messageAddOnExpiryType")) {
                d.messageAddOnExpiryType = o.enums === String ? $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] === undefined ? m.messageAddOnExpiryType : $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] : m.messageAddOnExpiryType;
                if (o.oneofs)
                    d._messageAddOnExpiryType = "messageAddOnExpiryType";
            }
            return d;
        };

        MessageAddOnContextInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MessageAddOnContextInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MessageAddOnContextInfo";
        };

        return MessageAddOnContextInfo;
    })();

    proto.MessageAssociation = (function() {

        function MessageAssociation(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MessageAssociation.prototype.associationType = null;
        MessageAssociation.prototype.parentMessageKey = null;
        MessageAssociation.prototype.messageIndex = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAssociation.prototype, "_associationType", {
            get: $util.oneOfGetter($oneOfFields = ["associationType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAssociation.prototype, "_parentMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["parentMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageAssociation.prototype, "_messageIndex", {
            get: $util.oneOfGetter($oneOfFields = ["messageIndex"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MessageAssociation.create = function create(properties) {
            return new MessageAssociation(properties);
        };

        MessageAssociation.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.associationType != null && Object.hasOwnProperty.call(m, "associationType"))
                w.uint32(8).int32(m.associationType);
            if (m.parentMessageKey != null && Object.hasOwnProperty.call(m, "parentMessageKey"))
                $root.proto.MessageKey.encode(m.parentMessageKey, w.uint32(18).fork()).ldelim();
            if (m.messageIndex != null && Object.hasOwnProperty.call(m, "messageIndex"))
                w.uint32(24).int32(m.messageIndex);
            return w;
        };

        MessageAssociation.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MessageAssociation();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.associationType = r.int32();
                        break;
                    }
                case 2: {
                        m.parentMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.messageIndex = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MessageAssociation.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MessageAssociation)
                return d;
            var m = new $root.proto.MessageAssociation();
            switch (d.associationType) {
            default:
                if (typeof d.associationType === "number") {
                    m.associationType = d.associationType;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.associationType = 0;
                break;
            case "MEDIA_ALBUM":
            case 1:
                m.associationType = 1;
                break;
            case "BOT_PLUGIN":
            case 2:
                m.associationType = 2;
                break;
            case "EVENT_COVER_IMAGE":
            case 3:
                m.associationType = 3;
                break;
            case "STATUS_POLL":
            case 4:
                m.associationType = 4;
                break;
            case "HD_VIDEO_DUAL_UPLOAD":
            case 5:
                m.associationType = 5;
                break;
            case "STATUS_EXTERNAL_RESHARE":
            case 6:
                m.associationType = 6;
                break;
            case "MEDIA_POLL":
            case 7:
                m.associationType = 7;
                break;
            case "STATUS_ADD_YOURS":
            case 8:
                m.associationType = 8;
                break;
            case "STATUS_NOTIFICATION":
            case 9:
                m.associationType = 9;
                break;
            case "HD_IMAGE_DUAL_UPLOAD":
            case 10:
                m.associationType = 10;
                break;
            case "STICKER_ANNOTATION":
            case 11:
                m.associationType = 11;
                break;
            case "MOTION_PHOTO":
            case 12:
                m.associationType = 12;
                break;
            case "STATUS_LINK_ACTION":
            case 13:
                m.associationType = 13;
                break;
            case "VIEW_ALL_REPLIES":
            case 14:
                m.associationType = 14;
                break;
            case "STATUS_ADD_YOURS_AI_IMAGINE":
            case 15:
                m.associationType = 15;
                break;
            case "STATUS_QUESTION":
            case 16:
                m.associationType = 16;
                break;
            case "STATUS_ADD_YOURS_DIWALI":
            case 17:
                m.associationType = 17;
                break;
            case "STATUS_REACTION":
            case 18:
                m.associationType = 18;
                break;
            case "HEVC_VIDEO_DUAL_UPLOAD":
            case 19:
                m.associationType = 19;
                break;
            }
            if (d.parentMessageKey != null) {
                if (typeof d.parentMessageKey !== "object")
                    throw TypeError(".proto.MessageAssociation.parentMessageKey: object expected");
                m.parentMessageKey = $root.proto.MessageKey.fromObject(d.parentMessageKey);
            }
            if (d.messageIndex != null) {
                m.messageIndex = d.messageIndex | 0;
            }
            return m;
        };

        MessageAssociation.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.associationType != null && m.hasOwnProperty("associationType")) {
                d.associationType = o.enums === String ? $root.proto.MessageAssociation.AssociationType[m.associationType] === undefined ? m.associationType : $root.proto.MessageAssociation.AssociationType[m.associationType] : m.associationType;
                if (o.oneofs)
                    d._associationType = "associationType";
            }
            if (m.parentMessageKey != null && m.hasOwnProperty("parentMessageKey")) {
                d.parentMessageKey = $root.proto.MessageKey.toObject(m.parentMessageKey, o);
                if (o.oneofs)
                    d._parentMessageKey = "parentMessageKey";
            }
            if (m.messageIndex != null && m.hasOwnProperty("messageIndex")) {
                d.messageIndex = m.messageIndex;
                if (o.oneofs)
                    d._messageIndex = "messageIndex";
            }
            return d;
        };

        MessageAssociation.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MessageAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MessageAssociation";
        };

        MessageAssociation.AssociationType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "MEDIA_ALBUM"] = 1;
            values[valuesById[2] = "BOT_PLUGIN"] = 2;
            values[valuesById[3] = "EVENT_COVER_IMAGE"] = 3;
            values[valuesById[4] = "STATUS_POLL"] = 4;
            values[valuesById[5] = "HD_VIDEO_DUAL_UPLOAD"] = 5;
            values[valuesById[6] = "STATUS_EXTERNAL_RESHARE"] = 6;
            values[valuesById[7] = "MEDIA_POLL"] = 7;
            values[valuesById[8] = "STATUS_ADD_YOURS"] = 8;
            values[valuesById[9] = "STATUS_NOTIFICATION"] = 9;
            values[valuesById[10] = "HD_IMAGE_DUAL_UPLOAD"] = 10;
            values[valuesById[11] = "STICKER_ANNOTATION"] = 11;
            values[valuesById[12] = "MOTION_PHOTO"] = 12;
            values[valuesById[13] = "STATUS_LINK_ACTION"] = 13;
            values[valuesById[14] = "VIEW_ALL_REPLIES"] = 14;
            values[valuesById[15] = "STATUS_ADD_YOURS_AI_IMAGINE"] = 15;
            values[valuesById[16] = "STATUS_QUESTION"] = 16;
            values[valuesById[17] = "STATUS_ADD_YOURS_DIWALI"] = 17;
            values[valuesById[18] = "STATUS_REACTION"] = 18;
            values[valuesById[19] = "HEVC_VIDEO_DUAL_UPLOAD"] = 19;
            return values;
        })();

        return MessageAssociation;
    })();

    proto.MessageContextInfo = (function() {

        function MessageContextInfo(p) {
            this.threadId = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MessageContextInfo.prototype.deviceListMetadata = null;
        MessageContextInfo.prototype.deviceListMetadataVersion = null;
        MessageContextInfo.prototype.messageSecret = null;
        MessageContextInfo.prototype.paddingBytes = null;
        MessageContextInfo.prototype.messageAddOnDurationInSecs = null;
        MessageContextInfo.prototype.botMessageSecret = null;
        MessageContextInfo.prototype.botMetadata = null;
        MessageContextInfo.prototype.reportingTokenVersion = null;
        MessageContextInfo.prototype.messageAddOnExpiryType = null;
        MessageContextInfo.prototype.messageAssociation = null;
        MessageContextInfo.prototype.capiCreatedGroup = null;
        MessageContextInfo.prototype.supportPayload = null;
        MessageContextInfo.prototype.limitSharing = null;
        MessageContextInfo.prototype.limitSharingV2 = null;
        MessageContextInfo.prototype.threadId = $util.emptyArray;
        MessageContextInfo.prototype.weblinkRenderConfig = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_deviceListMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["deviceListMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_deviceListMetadataVersion", {
            get: $util.oneOfGetter($oneOfFields = ["deviceListMetadataVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_messageSecret", {
            get: $util.oneOfGetter($oneOfFields = ["messageSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_paddingBytes", {
            get: $util.oneOfGetter($oneOfFields = ["paddingBytes"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_messageAddOnDurationInSecs", {
            get: $util.oneOfGetter($oneOfFields = ["messageAddOnDurationInSecs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_botMessageSecret", {
            get: $util.oneOfGetter($oneOfFields = ["botMessageSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_botMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["botMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_reportingTokenVersion", {
            get: $util.oneOfGetter($oneOfFields = ["reportingTokenVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_messageAddOnExpiryType", {
            get: $util.oneOfGetter($oneOfFields = ["messageAddOnExpiryType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_messageAssociation", {
            get: $util.oneOfGetter($oneOfFields = ["messageAssociation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_capiCreatedGroup", {
            get: $util.oneOfGetter($oneOfFields = ["capiCreatedGroup"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_supportPayload", {
            get: $util.oneOfGetter($oneOfFields = ["supportPayload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_limitSharing", {
            get: $util.oneOfGetter($oneOfFields = ["limitSharing"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_limitSharingV2", {
            get: $util.oneOfGetter($oneOfFields = ["limitSharingV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageContextInfo.prototype, "_weblinkRenderConfig", {
            get: $util.oneOfGetter($oneOfFields = ["weblinkRenderConfig"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MessageContextInfo.create = function create(properties) {
            return new MessageContextInfo(properties);
        };

        MessageContextInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.deviceListMetadata != null && Object.hasOwnProperty.call(m, "deviceListMetadata"))
                $root.proto.DeviceListMetadata.encode(m.deviceListMetadata, w.uint32(10).fork()).ldelim();
            if (m.deviceListMetadataVersion != null && Object.hasOwnProperty.call(m, "deviceListMetadataVersion"))
                w.uint32(16).int32(m.deviceListMetadataVersion);
            if (m.messageSecret != null && Object.hasOwnProperty.call(m, "messageSecret"))
                w.uint32(26).bytes(m.messageSecret);
            if (m.paddingBytes != null && Object.hasOwnProperty.call(m, "paddingBytes"))
                w.uint32(34).bytes(m.paddingBytes);
            if (m.messageAddOnDurationInSecs != null && Object.hasOwnProperty.call(m, "messageAddOnDurationInSecs"))
                w.uint32(40).uint32(m.messageAddOnDurationInSecs);
            if (m.botMessageSecret != null && Object.hasOwnProperty.call(m, "botMessageSecret"))
                w.uint32(50).bytes(m.botMessageSecret);
            if (m.botMetadata != null && Object.hasOwnProperty.call(m, "botMetadata"))
                $root.proto.BotMetadata.encode(m.botMetadata, w.uint32(58).fork()).ldelim();
            if (m.reportingTokenVersion != null && Object.hasOwnProperty.call(m, "reportingTokenVersion"))
                w.uint32(64).int32(m.reportingTokenVersion);
            if (m.messageAddOnExpiryType != null && Object.hasOwnProperty.call(m, "messageAddOnExpiryType"))
                w.uint32(72).int32(m.messageAddOnExpiryType);
            if (m.messageAssociation != null && Object.hasOwnProperty.call(m, "messageAssociation"))
                $root.proto.MessageAssociation.encode(m.messageAssociation, w.uint32(82).fork()).ldelim();
            if (m.capiCreatedGroup != null && Object.hasOwnProperty.call(m, "capiCreatedGroup"))
                w.uint32(88).bool(m.capiCreatedGroup);
            if (m.supportPayload != null && Object.hasOwnProperty.call(m, "supportPayload"))
                w.uint32(98).string(m.supportPayload);
            if (m.limitSharing != null && Object.hasOwnProperty.call(m, "limitSharing"))
                $root.proto.LimitSharing.encode(m.limitSharing, w.uint32(106).fork()).ldelim();
            if (m.limitSharingV2 != null && Object.hasOwnProperty.call(m, "limitSharingV2"))
                $root.proto.LimitSharing.encode(m.limitSharingV2, w.uint32(114).fork()).ldelim();
            if (m.threadId != null && m.threadId.length) {
                for (var i = 0; i < m.threadId.length; ++i)
                    $root.proto.ThreadID.encode(m.threadId[i], w.uint32(122).fork()).ldelim();
            }
            if (m.weblinkRenderConfig != null && Object.hasOwnProperty.call(m, "weblinkRenderConfig"))
                w.uint32(128).int32(m.weblinkRenderConfig);
            return w;
        };

        MessageContextInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MessageContextInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.deviceListMetadata = $root.proto.DeviceListMetadata.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.deviceListMetadataVersion = r.int32();
                        break;
                    }
                case 3: {
                        m.messageSecret = r.bytes();
                        break;
                    }
                case 4: {
                        m.paddingBytes = r.bytes();
                        break;
                    }
                case 5: {
                        m.messageAddOnDurationInSecs = r.uint32();
                        break;
                    }
                case 6: {
                        m.botMessageSecret = r.bytes();
                        break;
                    }
                case 7: {
                        m.botMetadata = $root.proto.BotMetadata.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.reportingTokenVersion = r.int32();
                        break;
                    }
                case 9: {
                        m.messageAddOnExpiryType = r.int32();
                        break;
                    }
                case 10: {
                        m.messageAssociation = $root.proto.MessageAssociation.decode(r, r.uint32());
                        break;
                    }
                case 11: {
                        m.capiCreatedGroup = r.bool();
                        break;
                    }
                case 12: {
                        m.supportPayload = r.string();
                        break;
                    }
                case 13: {
                        m.limitSharing = $root.proto.LimitSharing.decode(r, r.uint32());
                        break;
                    }
                case 14: {
                        m.limitSharingV2 = $root.proto.LimitSharing.decode(r, r.uint32());
                        break;
                    }
                case 15: {
                        if (!(m.threadId && m.threadId.length))
                            m.threadId = [];
                        m.threadId.push($root.proto.ThreadID.decode(r, r.uint32()));
                        break;
                    }
                case 16: {
                        m.weblinkRenderConfig = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MessageContextInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MessageContextInfo)
                return d;
            var m = new $root.proto.MessageContextInfo();
            if (d.deviceListMetadata != null) {
                if (typeof d.deviceListMetadata !== "object")
                    throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected");
                m.deviceListMetadata = $root.proto.DeviceListMetadata.fromObject(d.deviceListMetadata);
            }
            if (d.deviceListMetadataVersion != null) {
                m.deviceListMetadataVersion = d.deviceListMetadataVersion | 0;
            }
            if (d.messageSecret != null) {
                if (typeof d.messageSecret === "string")
                    $util.base64.decode(d.messageSecret, m.messageSecret = $util.newBuffer($util.base64.length(d.messageSecret)), 0);
                else if (d.messageSecret.length >= 0)
                    m.messageSecret = d.messageSecret;
            }
            if (d.paddingBytes != null) {
                if (typeof d.paddingBytes === "string")
                    $util.base64.decode(d.paddingBytes, m.paddingBytes = $util.newBuffer($util.base64.length(d.paddingBytes)), 0);
                else if (d.paddingBytes.length >= 0)
                    m.paddingBytes = d.paddingBytes;
            }
            if (d.messageAddOnDurationInSecs != null) {
                m.messageAddOnDurationInSecs = d.messageAddOnDurationInSecs >>> 0;
            }
            if (d.botMessageSecret != null) {
                if (typeof d.botMessageSecret === "string")
                    $util.base64.decode(d.botMessageSecret, m.botMessageSecret = $util.newBuffer($util.base64.length(d.botMessageSecret)), 0);
                else if (d.botMessageSecret.length >= 0)
                    m.botMessageSecret = d.botMessageSecret;
            }
            if (d.botMetadata != null) {
                if (typeof d.botMetadata !== "object")
                    throw TypeError(".proto.MessageContextInfo.botMetadata: object expected");
                m.botMetadata = $root.proto.BotMetadata.fromObject(d.botMetadata);
            }
            if (d.reportingTokenVersion != null) {
                m.reportingTokenVersion = d.reportingTokenVersion | 0;
            }
            switch (d.messageAddOnExpiryType) {
            default:
                if (typeof d.messageAddOnExpiryType === "number") {
                    m.messageAddOnExpiryType = d.messageAddOnExpiryType;
                    break;
                }
                break;
            case "STATIC":
            case 1:
                m.messageAddOnExpiryType = 1;
                break;
            case "DEPENDENT_ON_PARENT":
            case 2:
                m.messageAddOnExpiryType = 2;
                break;
            }
            if (d.messageAssociation != null) {
                if (typeof d.messageAssociation !== "object")
                    throw TypeError(".proto.MessageContextInfo.messageAssociation: object expected");
                m.messageAssociation = $root.proto.MessageAssociation.fromObject(d.messageAssociation);
            }
            if (d.capiCreatedGroup != null) {
                m.capiCreatedGroup = Boolean(d.capiCreatedGroup);
            }
            if (d.supportPayload != null) {
                m.supportPayload = String(d.supportPayload);
            }
            if (d.limitSharing != null) {
                if (typeof d.limitSharing !== "object")
                    throw TypeError(".proto.MessageContextInfo.limitSharing: object expected");
                m.limitSharing = $root.proto.LimitSharing.fromObject(d.limitSharing);
            }
            if (d.limitSharingV2 != null) {
                if (typeof d.limitSharingV2 !== "object")
                    throw TypeError(".proto.MessageContextInfo.limitSharingV2: object expected");
                m.limitSharingV2 = $root.proto.LimitSharing.fromObject(d.limitSharingV2);
            }
            if (d.threadId) {
                if (!Array.isArray(d.threadId))
                    throw TypeError(".proto.MessageContextInfo.threadId: array expected");
                m.threadId = [];
                for (var i = 0; i < d.threadId.length; ++i) {
                    if (typeof d.threadId[i] !== "object")
                        throw TypeError(".proto.MessageContextInfo.threadId: object expected");
                    m.threadId[i] = $root.proto.ThreadID.fromObject(d.threadId[i]);
                }
            }
            switch (d.weblinkRenderConfig) {
            default:
                if (typeof d.weblinkRenderConfig === "number") {
                    m.weblinkRenderConfig = d.weblinkRenderConfig;
                    break;
                }
                break;
            case "WEBVIEW":
            case 0:
                m.weblinkRenderConfig = 0;
                break;
            case "SYSTEM":
            case 1:
                m.weblinkRenderConfig = 1;
                break;
            }
            return m;
        };

        MessageContextInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.threadId = [];
            }
            if (m.deviceListMetadata != null && m.hasOwnProperty("deviceListMetadata")) {
                d.deviceListMetadata = $root.proto.DeviceListMetadata.toObject(m.deviceListMetadata, o);
                if (o.oneofs)
                    d._deviceListMetadata = "deviceListMetadata";
            }
            if (m.deviceListMetadataVersion != null && m.hasOwnProperty("deviceListMetadataVersion")) {
                d.deviceListMetadataVersion = m.deviceListMetadataVersion;
                if (o.oneofs)
                    d._deviceListMetadataVersion = "deviceListMetadataVersion";
            }
            if (m.messageSecret != null && m.hasOwnProperty("messageSecret")) {
                d.messageSecret = o.bytes === String ? $util.base64.encode(m.messageSecret, 0, m.messageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.messageSecret) : m.messageSecret;
                if (o.oneofs)
                    d._messageSecret = "messageSecret";
            }
            if (m.paddingBytes != null && m.hasOwnProperty("paddingBytes")) {
                d.paddingBytes = o.bytes === String ? $util.base64.encode(m.paddingBytes, 0, m.paddingBytes.length) : o.bytes === Array ? Array.prototype.slice.call(m.paddingBytes) : m.paddingBytes;
                if (o.oneofs)
                    d._paddingBytes = "paddingBytes";
            }
            if (m.messageAddOnDurationInSecs != null && m.hasOwnProperty("messageAddOnDurationInSecs")) {
                d.messageAddOnDurationInSecs = m.messageAddOnDurationInSecs;
                if (o.oneofs)
                    d._messageAddOnDurationInSecs = "messageAddOnDurationInSecs";
            }
            if (m.botMessageSecret != null && m.hasOwnProperty("botMessageSecret")) {
                d.botMessageSecret = o.bytes === String ? $util.base64.encode(m.botMessageSecret, 0, m.botMessageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.botMessageSecret) : m.botMessageSecret;
                if (o.oneofs)
                    d._botMessageSecret = "botMessageSecret";
            }
            if (m.botMetadata != null && m.hasOwnProperty("botMetadata")) {
                d.botMetadata = $root.proto.BotMetadata.toObject(m.botMetadata, o);
                if (o.oneofs)
                    d._botMetadata = "botMetadata";
            }
            if (m.reportingTokenVersion != null && m.hasOwnProperty("reportingTokenVersion")) {
                d.reportingTokenVersion = m.reportingTokenVersion;
                if (o.oneofs)
                    d._reportingTokenVersion = "reportingTokenVersion";
            }
            if (m.messageAddOnExpiryType != null && m.hasOwnProperty("messageAddOnExpiryType")) {
                d.messageAddOnExpiryType = o.enums === String ? $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] === undefined ? m.messageAddOnExpiryType : $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] : m.messageAddOnExpiryType;
                if (o.oneofs)
                    d._messageAddOnExpiryType = "messageAddOnExpiryType";
            }
            if (m.messageAssociation != null && m.hasOwnProperty("messageAssociation")) {
                d.messageAssociation = $root.proto.MessageAssociation.toObject(m.messageAssociation, o);
                if (o.oneofs)
                    d._messageAssociation = "messageAssociation";
            }
            if (m.capiCreatedGroup != null && m.hasOwnProperty("capiCreatedGroup")) {
                d.capiCreatedGroup = m.capiCreatedGroup;
                if (o.oneofs)
                    d._capiCreatedGroup = "capiCreatedGroup";
            }
            if (m.supportPayload != null && m.hasOwnProperty("supportPayload")) {
                d.supportPayload = m.supportPayload;
                if (o.oneofs)
                    d._supportPayload = "supportPayload";
            }
            if (m.limitSharing != null && m.hasOwnProperty("limitSharing")) {
                d.limitSharing = $root.proto.LimitSharing.toObject(m.limitSharing, o);
                if (o.oneofs)
                    d._limitSharing = "limitSharing";
            }
            if (m.limitSharingV2 != null && m.hasOwnProperty("limitSharingV2")) {
                d.limitSharingV2 = $root.proto.LimitSharing.toObject(m.limitSharingV2, o);
                if (o.oneofs)
                    d._limitSharingV2 = "limitSharingV2";
            }
            if (m.threadId && m.threadId.length) {
                d.threadId = [];
                for (var j = 0; j < m.threadId.length; ++j) {
                    d.threadId[j] = $root.proto.ThreadID.toObject(m.threadId[j], o);
                }
            }
            if (m.weblinkRenderConfig != null && m.hasOwnProperty("weblinkRenderConfig")) {
                d.weblinkRenderConfig = o.enums === String ? $root.proto.WebLinkRenderConfig[m.weblinkRenderConfig] === undefined ? m.weblinkRenderConfig : $root.proto.WebLinkRenderConfig[m.weblinkRenderConfig] : m.weblinkRenderConfig;
                if (o.oneofs)
                    d._weblinkRenderConfig = "weblinkRenderConfig";
            }
            return d;
        };

        MessageContextInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MessageContextInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MessageContextInfo";
        };

        MessageContextInfo.MessageAddonExpiryType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[1] = "STATIC"] = 1;
            values[valuesById[2] = "DEPENDENT_ON_PARENT"] = 2;
            return values;
        })();

        return MessageContextInfo;
    })();

    proto.MessageKey = (function() {

        function MessageKey(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MessageKey.prototype.remoteJid = null;
        MessageKey.prototype.fromMe = null;
        MessageKey.prototype.id = null;
        MessageKey.prototype.participant = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageKey.prototype, "_remoteJid", {
            get: $util.oneOfGetter($oneOfFields = ["remoteJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageKey.prototype, "_fromMe", {
            get: $util.oneOfGetter($oneOfFields = ["fromMe"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageKey.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageKey.prototype, "_participant", {
            get: $util.oneOfGetter($oneOfFields = ["participant"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MessageKey.create = function create(properties) {
            return new MessageKey(properties);
        };

        MessageKey.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.remoteJid != null && Object.hasOwnProperty.call(m, "remoteJid"))
                w.uint32(10).string(m.remoteJid);
            if (m.fromMe != null && Object.hasOwnProperty.call(m, "fromMe"))
                w.uint32(16).bool(m.fromMe);
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(26).string(m.id);
            if (m.participant != null && Object.hasOwnProperty.call(m, "participant"))
                w.uint32(34).string(m.participant);
            return w;
        };

        MessageKey.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MessageKey();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.remoteJid = r.string();
                        break;
                    }
                case 2: {
                        m.fromMe = r.bool();
                        break;
                    }
                case 3: {
                        m.id = r.string();
                        break;
                    }
                case 4: {
                        m.participant = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MessageKey.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MessageKey)
                return d;
            var m = new $root.proto.MessageKey();
            if (d.remoteJid != null) {
                m.remoteJid = String(d.remoteJid);
            }
            if (d.fromMe != null) {
                m.fromMe = Boolean(d.fromMe);
            }
            if (d.id != null) {
                m.id = String(d.id);
            }
            if (d.participant != null) {
                m.participant = String(d.participant);
            }
            return m;
        };

        MessageKey.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.remoteJid != null && m.hasOwnProperty("remoteJid")) {
                d.remoteJid = m.remoteJid;
                if (o.oneofs)
                    d._remoteJid = "remoteJid";
            }
            if (m.fromMe != null && m.hasOwnProperty("fromMe")) {
                d.fromMe = m.fromMe;
                if (o.oneofs)
                    d._fromMe = "fromMe";
            }
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            if (m.participant != null && m.hasOwnProperty("participant")) {
                d.participant = m.participant;
                if (o.oneofs)
                    d._participant = "participant";
            }
            return d;
        };

        MessageKey.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MessageKey";
        };

        return MessageKey;
    })();

    proto.MessageSecretMessage = (function() {

        function MessageSecretMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MessageSecretMessage.prototype.version = null;
        MessageSecretMessage.prototype.encIv = null;
        MessageSecretMessage.prototype.encPayload = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageSecretMessage.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageSecretMessage.prototype, "_encIv", {
            get: $util.oneOfGetter($oneOfFields = ["encIv"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MessageSecretMessage.prototype, "_encPayload", {
            get: $util.oneOfGetter($oneOfFields = ["encPayload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MessageSecretMessage.create = function create(properties) {
            return new MessageSecretMessage(properties);
        };

        MessageSecretMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                w.uint32(13).sfixed32(m.version);
            if (m.encIv != null && Object.hasOwnProperty.call(m, "encIv"))
                w.uint32(18).bytes(m.encIv);
            if (m.encPayload != null && Object.hasOwnProperty.call(m, "encPayload"))
                w.uint32(26).bytes(m.encPayload);
            return w;
        };

        MessageSecretMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MessageSecretMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.version = r.sfixed32();
                        break;
                    }
                case 2: {
                        m.encIv = r.bytes();
                        break;
                    }
                case 3: {
                        m.encPayload = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MessageSecretMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MessageSecretMessage)
                return d;
            var m = new $root.proto.MessageSecretMessage();
            if (d.version != null) {
                m.version = d.version | 0;
            }
            if (d.encIv != null) {
                if (typeof d.encIv === "string")
                    $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0);
                else if (d.encIv.length >= 0)
                    m.encIv = d.encIv;
            }
            if (d.encPayload != null) {
                if (typeof d.encPayload === "string")
                    $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0);
                else if (d.encPayload.length >= 0)
                    m.encPayload = d.encPayload;
            }
            return m;
        };

        MessageSecretMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.version != null && m.hasOwnProperty("version")) {
                d.version = m.version;
                if (o.oneofs)
                    d._version = "version";
            }
            if (m.encIv != null && m.hasOwnProperty("encIv")) {
                d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv;
                if (o.oneofs)
                    d._encIv = "encIv";
            }
            if (m.encPayload != null && m.hasOwnProperty("encPayload")) {
                d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload;
                if (o.oneofs)
                    d._encPayload = "encPayload";
            }
            return d;
        };

        MessageSecretMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MessageSecretMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MessageSecretMessage";
        };

        return MessageSecretMessage;
    })();

    proto.Money = (function() {

        function Money(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Money.prototype.value = null;
        Money.prototype.offset = null;
        Money.prototype.currencyCode = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Money.prototype, "_value", {
            get: $util.oneOfGetter($oneOfFields = ["value"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Money.prototype, "_offset", {
            get: $util.oneOfGetter($oneOfFields = ["offset"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Money.prototype, "_currencyCode", {
            get: $util.oneOfGetter($oneOfFields = ["currencyCode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Money.create = function create(properties) {
            return new Money(properties);
        };

        Money.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.value != null && Object.hasOwnProperty.call(m, "value"))
                w.uint32(8).int64(m.value);
            if (m.offset != null && Object.hasOwnProperty.call(m, "offset"))
                w.uint32(16).uint32(m.offset);
            if (m.currencyCode != null && Object.hasOwnProperty.call(m, "currencyCode"))
                w.uint32(26).string(m.currencyCode);
            return w;
        };

        Money.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Money();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.value = r.int64();
                        break;
                    }
                case 2: {
                        m.offset = r.uint32();
                        break;
                    }
                case 3: {
                        m.currencyCode = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Money.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Money)
                return d;
            var m = new $root.proto.Money();
            if (d.value != null) {
                if ($util.Long)
                    (m.value = $util.Long.fromValue(d.value)).unsigned = false;
                else if (typeof d.value === "string")
                    m.value = parseInt(d.value, 10);
                else if (typeof d.value === "number")
                    m.value = d.value;
                else if (typeof d.value === "object")
                    m.value = new $util.LongBits(d.value.low >>> 0, d.value.high >>> 0).toNumber();
            }
            if (d.offset != null) {
                m.offset = d.offset >>> 0;
            }
            if (d.currencyCode != null) {
                m.currencyCode = String(d.currencyCode);
            }
            return m;
        };

        Money.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.value != null && m.hasOwnProperty("value")) {
                if (typeof m.value === "number")
                    d.value = o.longs === String ? String(m.value) : m.value;
                else
                    d.value = o.longs === String ? longToString(m.value) : o.longs === Number ? longToNumber(m.value) : m.value;
                if (o.oneofs)
                    d._value = "value";
            }
            if (m.offset != null && m.hasOwnProperty("offset")) {
                d.offset = m.offset;
                if (o.oneofs)
                    d._offset = "offset";
            }
            if (m.currencyCode != null && m.hasOwnProperty("currencyCode")) {
                d.currencyCode = m.currencyCode;
                if (o.oneofs)
                    d._currencyCode = "currencyCode";
            }
            return d;
        };

        Money.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Money";
        };

        return Money;
    })();

    proto.MsgOpaqueData = (function() {

        function MsgOpaqueData(p) {
            this.pollOptions = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MsgOpaqueData.prototype.body = null;
        MsgOpaqueData.prototype.caption = null;
        MsgOpaqueData.prototype.lng = null;
        MsgOpaqueData.prototype.isLive = null;
        MsgOpaqueData.prototype.lat = null;
        MsgOpaqueData.prototype.paymentAmount1000 = null;
        MsgOpaqueData.prototype.paymentNoteMsgBody = null;
        MsgOpaqueData.prototype.matchedText = null;
        MsgOpaqueData.prototype.title = null;
        MsgOpaqueData.prototype.description = null;
        MsgOpaqueData.prototype.futureproofBuffer = null;
        MsgOpaqueData.prototype.clientUrl = null;
        MsgOpaqueData.prototype.loc = null;
        MsgOpaqueData.prototype.pollName = null;
        MsgOpaqueData.prototype.pollOptions = $util.emptyArray;
        MsgOpaqueData.prototype.pollSelectableOptionsCount = null;
        MsgOpaqueData.prototype.messageSecret = null;
        MsgOpaqueData.prototype.originalSelfAuthor = null;
        MsgOpaqueData.prototype.senderTimestampMs = null;
        MsgOpaqueData.prototype.pollUpdateParentKey = null;
        MsgOpaqueData.prototype.encPollVote = null;
        MsgOpaqueData.prototype.isSentCagPollCreation = null;
        MsgOpaqueData.prototype.pollContentType = null;
        MsgOpaqueData.prototype.pollType = null;
        MsgOpaqueData.prototype.correctOptionIndex = null;
        MsgOpaqueData.prototype.pollVotesSnapshot = null;
        MsgOpaqueData.prototype.encReactionTargetMessageKey = null;
        MsgOpaqueData.prototype.encReactionEncPayload = null;
        MsgOpaqueData.prototype.encReactionEncIv = null;
        MsgOpaqueData.prototype.botMessageSecret = null;
        MsgOpaqueData.prototype.targetMessageKey = null;
        MsgOpaqueData.prototype.encPayload = null;
        MsgOpaqueData.prototype.encIv = null;
        MsgOpaqueData.prototype.eventName = null;
        MsgOpaqueData.prototype.isEventCanceled = null;
        MsgOpaqueData.prototype.eventDescription = null;
        MsgOpaqueData.prototype.eventJoinLink = null;
        MsgOpaqueData.prototype.eventStartTime = null;
        MsgOpaqueData.prototype.eventLocation = null;
        MsgOpaqueData.prototype.eventEndTime = null;
        MsgOpaqueData.prototype.eventIsScheduledCall = null;
        MsgOpaqueData.prototype.eventExtraGuestsAllowed = null;
        MsgOpaqueData.prototype.plainProtobufBytes = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_body", {
            get: $util.oneOfGetter($oneOfFields = ["body"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_caption", {
            get: $util.oneOfGetter($oneOfFields = ["caption"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_lng", {
            get: $util.oneOfGetter($oneOfFields = ["lng"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_isLive", {
            get: $util.oneOfGetter($oneOfFields = ["isLive"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_lat", {
            get: $util.oneOfGetter($oneOfFields = ["lat"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_paymentAmount1000", {
            get: $util.oneOfGetter($oneOfFields = ["paymentAmount1000"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_paymentNoteMsgBody", {
            get: $util.oneOfGetter($oneOfFields = ["paymentNoteMsgBody"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_matchedText", {
            get: $util.oneOfGetter($oneOfFields = ["matchedText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_title", {
            get: $util.oneOfGetter($oneOfFields = ["title"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_description", {
            get: $util.oneOfGetter($oneOfFields = ["description"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_futureproofBuffer", {
            get: $util.oneOfGetter($oneOfFields = ["futureproofBuffer"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_clientUrl", {
            get: $util.oneOfGetter($oneOfFields = ["clientUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_loc", {
            get: $util.oneOfGetter($oneOfFields = ["loc"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_pollName", {
            get: $util.oneOfGetter($oneOfFields = ["pollName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_pollSelectableOptionsCount", {
            get: $util.oneOfGetter($oneOfFields = ["pollSelectableOptionsCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_messageSecret", {
            get: $util.oneOfGetter($oneOfFields = ["messageSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_originalSelfAuthor", {
            get: $util.oneOfGetter($oneOfFields = ["originalSelfAuthor"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_senderTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_pollUpdateParentKey", {
            get: $util.oneOfGetter($oneOfFields = ["pollUpdateParentKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_encPollVote", {
            get: $util.oneOfGetter($oneOfFields = ["encPollVote"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_isSentCagPollCreation", {
            get: $util.oneOfGetter($oneOfFields = ["isSentCagPollCreation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_pollContentType", {
            get: $util.oneOfGetter($oneOfFields = ["pollContentType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_pollType", {
            get: $util.oneOfGetter($oneOfFields = ["pollType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_correctOptionIndex", {
            get: $util.oneOfGetter($oneOfFields = ["correctOptionIndex"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_pollVotesSnapshot", {
            get: $util.oneOfGetter($oneOfFields = ["pollVotesSnapshot"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_encReactionTargetMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["encReactionTargetMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_encReactionEncPayload", {
            get: $util.oneOfGetter($oneOfFields = ["encReactionEncPayload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_encReactionEncIv", {
            get: $util.oneOfGetter($oneOfFields = ["encReactionEncIv"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_botMessageSecret", {
            get: $util.oneOfGetter($oneOfFields = ["botMessageSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_targetMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_encPayload", {
            get: $util.oneOfGetter($oneOfFields = ["encPayload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_encIv", {
            get: $util.oneOfGetter($oneOfFields = ["encIv"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_eventName", {
            get: $util.oneOfGetter($oneOfFields = ["eventName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_isEventCanceled", {
            get: $util.oneOfGetter($oneOfFields = ["isEventCanceled"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_eventDescription", {
            get: $util.oneOfGetter($oneOfFields = ["eventDescription"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_eventJoinLink", {
            get: $util.oneOfGetter($oneOfFields = ["eventJoinLink"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_eventStartTime", {
            get: $util.oneOfGetter($oneOfFields = ["eventStartTime"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_eventLocation", {
            get: $util.oneOfGetter($oneOfFields = ["eventLocation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_eventEndTime", {
            get: $util.oneOfGetter($oneOfFields = ["eventEndTime"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_eventIsScheduledCall", {
            get: $util.oneOfGetter($oneOfFields = ["eventIsScheduledCall"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_eventExtraGuestsAllowed", {
            get: $util.oneOfGetter($oneOfFields = ["eventExtraGuestsAllowed"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgOpaqueData.prototype, "_plainProtobufBytes", {
            get: $util.oneOfGetter($oneOfFields = ["plainProtobufBytes"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MsgOpaqueData.create = function create(properties) {
            return new MsgOpaqueData(properties);
        };

        MsgOpaqueData.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.body != null && Object.hasOwnProperty.call(m, "body"))
                w.uint32(10).string(m.body);
            if (m.caption != null && Object.hasOwnProperty.call(m, "caption"))
                w.uint32(26).string(m.caption);
            if (m.lng != null && Object.hasOwnProperty.call(m, "lng"))
                w.uint32(41).double(m.lng);
            if (m.isLive != null && Object.hasOwnProperty.call(m, "isLive"))
                w.uint32(48).bool(m.isLive);
            if (m.lat != null && Object.hasOwnProperty.call(m, "lat"))
                w.uint32(57).double(m.lat);
            if (m.paymentAmount1000 != null && Object.hasOwnProperty.call(m, "paymentAmount1000"))
                w.uint32(64).int32(m.paymentAmount1000);
            if (m.paymentNoteMsgBody != null && Object.hasOwnProperty.call(m, "paymentNoteMsgBody"))
                w.uint32(74).string(m.paymentNoteMsgBody);
            if (m.matchedText != null && Object.hasOwnProperty.call(m, "matchedText"))
                w.uint32(90).string(m.matchedText);
            if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                w.uint32(98).string(m.title);
            if (m.description != null && Object.hasOwnProperty.call(m, "description"))
                w.uint32(106).string(m.description);
            if (m.futureproofBuffer != null && Object.hasOwnProperty.call(m, "futureproofBuffer"))
                w.uint32(114).bytes(m.futureproofBuffer);
            if (m.clientUrl != null && Object.hasOwnProperty.call(m, "clientUrl"))
                w.uint32(122).string(m.clientUrl);
            if (m.loc != null && Object.hasOwnProperty.call(m, "loc"))
                w.uint32(130).string(m.loc);
            if (m.pollName != null && Object.hasOwnProperty.call(m, "pollName"))
                w.uint32(138).string(m.pollName);
            if (m.pollOptions != null && m.pollOptions.length) {
                for (var i = 0; i < m.pollOptions.length; ++i)
                    $root.proto.MsgOpaqueData.PollOption.encode(m.pollOptions[i], w.uint32(146).fork()).ldelim();
            }
            if (m.pollSelectableOptionsCount != null && Object.hasOwnProperty.call(m, "pollSelectableOptionsCount"))
                w.uint32(160).uint32(m.pollSelectableOptionsCount);
            if (m.messageSecret != null && Object.hasOwnProperty.call(m, "messageSecret"))
                w.uint32(170).bytes(m.messageSecret);
            if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
                w.uint32(176).int64(m.senderTimestampMs);
            if (m.pollUpdateParentKey != null && Object.hasOwnProperty.call(m, "pollUpdateParentKey"))
                w.uint32(186).string(m.pollUpdateParentKey);
            if (m.encPollVote != null && Object.hasOwnProperty.call(m, "encPollVote"))
                $root.proto.PollEncValue.encode(m.encPollVote, w.uint32(194).fork()).ldelim();
            if (m.encReactionTargetMessageKey != null && Object.hasOwnProperty.call(m, "encReactionTargetMessageKey"))
                w.uint32(202).string(m.encReactionTargetMessageKey);
            if (m.encReactionEncPayload != null && Object.hasOwnProperty.call(m, "encReactionEncPayload"))
                w.uint32(210).bytes(m.encReactionEncPayload);
            if (m.encReactionEncIv != null && Object.hasOwnProperty.call(m, "encReactionEncIv"))
                w.uint32(218).bytes(m.encReactionEncIv);
            if (m.isSentCagPollCreation != null && Object.hasOwnProperty.call(m, "isSentCagPollCreation"))
                w.uint32(224).bool(m.isSentCagPollCreation);
            if (m.botMessageSecret != null && Object.hasOwnProperty.call(m, "botMessageSecret"))
                w.uint32(234).bytes(m.botMessageSecret);
            if (m.targetMessageKey != null && Object.hasOwnProperty.call(m, "targetMessageKey"))
                w.uint32(242).string(m.targetMessageKey);
            if (m.encPayload != null && Object.hasOwnProperty.call(m, "encPayload"))
                w.uint32(250).bytes(m.encPayload);
            if (m.encIv != null && Object.hasOwnProperty.call(m, "encIv"))
                w.uint32(258).bytes(m.encIv);
            if (m.eventName != null && Object.hasOwnProperty.call(m, "eventName"))
                w.uint32(266).string(m.eventName);
            if (m.isEventCanceled != null && Object.hasOwnProperty.call(m, "isEventCanceled"))
                w.uint32(272).bool(m.isEventCanceled);
            if (m.eventDescription != null && Object.hasOwnProperty.call(m, "eventDescription"))
                w.uint32(282).string(m.eventDescription);
            if (m.eventJoinLink != null && Object.hasOwnProperty.call(m, "eventJoinLink"))
                w.uint32(290).string(m.eventJoinLink);
            if (m.eventStartTime != null && Object.hasOwnProperty.call(m, "eventStartTime"))
                w.uint32(296).int64(m.eventStartTime);
            if (m.eventLocation != null && Object.hasOwnProperty.call(m, "eventLocation"))
                $root.proto.MsgOpaqueData.EventLocation.encode(m.eventLocation, w.uint32(306).fork()).ldelim();
            if (m.eventEndTime != null && Object.hasOwnProperty.call(m, "eventEndTime"))
                w.uint32(320).int64(m.eventEndTime);
            if (m.pollVotesSnapshot != null && Object.hasOwnProperty.call(m, "pollVotesSnapshot"))
                $root.proto.MsgOpaqueData.PollVotesSnapshot.encode(m.pollVotesSnapshot, w.uint32(330).fork()).ldelim();
            if (m.pollContentType != null && Object.hasOwnProperty.call(m, "pollContentType"))
                w.uint32(336).int32(m.pollContentType);
            if (m.plainProtobufBytes != null && Object.hasOwnProperty.call(m, "plainProtobufBytes"))
                w.uint32(346).bytes(m.plainProtobufBytes);
            if (m.eventIsScheduledCall != null && Object.hasOwnProperty.call(m, "eventIsScheduledCall"))
                w.uint32(352).bool(m.eventIsScheduledCall);
            if (m.eventExtraGuestsAllowed != null && Object.hasOwnProperty.call(m, "eventExtraGuestsAllowed"))
                w.uint32(360).bool(m.eventExtraGuestsAllowed);
            if (m.pollType != null && Object.hasOwnProperty.call(m, "pollType"))
                w.uint32(368).int32(m.pollType);
            if (m.correctOptionIndex != null && Object.hasOwnProperty.call(m, "correctOptionIndex"))
                w.uint32(376).int32(m.correctOptionIndex);
            if (m.originalSelfAuthor != null && Object.hasOwnProperty.call(m, "originalSelfAuthor"))
                w.uint32(410).string(m.originalSelfAuthor);
            return w;
        };

        MsgOpaqueData.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MsgOpaqueData();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.body = r.string();
                        break;
                    }
                case 3: {
                        m.caption = r.string();
                        break;
                    }
                case 5: {
                        m.lng = r.double();
                        break;
                    }
                case 6: {
                        m.isLive = r.bool();
                        break;
                    }
                case 7: {
                        m.lat = r.double();
                        break;
                    }
                case 8: {
                        m.paymentAmount1000 = r.int32();
                        break;
                    }
                case 9: {
                        m.paymentNoteMsgBody = r.string();
                        break;
                    }
                case 11: {
                        m.matchedText = r.string();
                        break;
                    }
                case 12: {
                        m.title = r.string();
                        break;
                    }
                case 13: {
                        m.description = r.string();
                        break;
                    }
                case 14: {
                        m.futureproofBuffer = r.bytes();
                        break;
                    }
                case 15: {
                        m.clientUrl = r.string();
                        break;
                    }
                case 16: {
                        m.loc = r.string();
                        break;
                    }
                case 17: {
                        m.pollName = r.string();
                        break;
                    }
                case 18: {
                        if (!(m.pollOptions && m.pollOptions.length))
                            m.pollOptions = [];
                        m.pollOptions.push($root.proto.MsgOpaqueData.PollOption.decode(r, r.uint32()));
                        break;
                    }
                case 20: {
                        m.pollSelectableOptionsCount = r.uint32();
                        break;
                    }
                case 21: {
                        m.messageSecret = r.bytes();
                        break;
                    }
                case 51: {
                        m.originalSelfAuthor = r.string();
                        break;
                    }
                case 22: {
                        m.senderTimestampMs = r.int64();
                        break;
                    }
                case 23: {
                        m.pollUpdateParentKey = r.string();
                        break;
                    }
                case 24: {
                        m.encPollVote = $root.proto.PollEncValue.decode(r, r.uint32());
                        break;
                    }
                case 28: {
                        m.isSentCagPollCreation = r.bool();
                        break;
                    }
                case 42: {
                        m.pollContentType = r.int32();
                        break;
                    }
                case 46: {
                        m.pollType = r.int32();
                        break;
                    }
                case 47: {
                        m.correctOptionIndex = r.int32();
                        break;
                    }
                case 41: {
                        m.pollVotesSnapshot = $root.proto.MsgOpaqueData.PollVotesSnapshot.decode(r, r.uint32());
                        break;
                    }
                case 25: {
                        m.encReactionTargetMessageKey = r.string();
                        break;
                    }
                case 26: {
                        m.encReactionEncPayload = r.bytes();
                        break;
                    }
                case 27: {
                        m.encReactionEncIv = r.bytes();
                        break;
                    }
                case 29: {
                        m.botMessageSecret = r.bytes();
                        break;
                    }
                case 30: {
                        m.targetMessageKey = r.string();
                        break;
                    }
                case 31: {
                        m.encPayload = r.bytes();
                        break;
                    }
                case 32: {
                        m.encIv = r.bytes();
                        break;
                    }
                case 33: {
                        m.eventName = r.string();
                        break;
                    }
                case 34: {
                        m.isEventCanceled = r.bool();
                        break;
                    }
                case 35: {
                        m.eventDescription = r.string();
                        break;
                    }
                case 36: {
                        m.eventJoinLink = r.string();
                        break;
                    }
                case 37: {
                        m.eventStartTime = r.int64();
                        break;
                    }
                case 38: {
                        m.eventLocation = $root.proto.MsgOpaqueData.EventLocation.decode(r, r.uint32());
                        break;
                    }
                case 40: {
                        m.eventEndTime = r.int64();
                        break;
                    }
                case 44: {
                        m.eventIsScheduledCall = r.bool();
                        break;
                    }
                case 45: {
                        m.eventExtraGuestsAllowed = r.bool();
                        break;
                    }
                case 43: {
                        m.plainProtobufBytes = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MsgOpaqueData.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MsgOpaqueData)
                return d;
            var m = new $root.proto.MsgOpaqueData();
            if (d.body != null) {
                m.body = String(d.body);
            }
            if (d.caption != null) {
                m.caption = String(d.caption);
            }
            if (d.lng != null) {
                m.lng = Number(d.lng);
            }
            if (d.isLive != null) {
                m.isLive = Boolean(d.isLive);
            }
            if (d.lat != null) {
                m.lat = Number(d.lat);
            }
            if (d.paymentAmount1000 != null) {
                m.paymentAmount1000 = d.paymentAmount1000 | 0;
            }
            if (d.paymentNoteMsgBody != null) {
                m.paymentNoteMsgBody = String(d.paymentNoteMsgBody);
            }
            if (d.matchedText != null) {
                m.matchedText = String(d.matchedText);
            }
            if (d.title != null) {
                m.title = String(d.title);
            }
            if (d.description != null) {
                m.description = String(d.description);
            }
            if (d.futureproofBuffer != null) {
                if (typeof d.futureproofBuffer === "string")
                    $util.base64.decode(d.futureproofBuffer, m.futureproofBuffer = $util.newBuffer($util.base64.length(d.futureproofBuffer)), 0);
                else if (d.futureproofBuffer.length >= 0)
                    m.futureproofBuffer = d.futureproofBuffer;
            }
            if (d.clientUrl != null) {
                m.clientUrl = String(d.clientUrl);
            }
            if (d.loc != null) {
                m.loc = String(d.loc);
            }
            if (d.pollName != null) {
                m.pollName = String(d.pollName);
            }
            if (d.pollOptions) {
                if (!Array.isArray(d.pollOptions))
                    throw TypeError(".proto.MsgOpaqueData.pollOptions: array expected");
                m.pollOptions = [];
                for (var i = 0; i < d.pollOptions.length; ++i) {
                    if (typeof d.pollOptions[i] !== "object")
                        throw TypeError(".proto.MsgOpaqueData.pollOptions: object expected");
                    m.pollOptions[i] = $root.proto.MsgOpaqueData.PollOption.fromObject(d.pollOptions[i]);
                }
            }
            if (d.pollSelectableOptionsCount != null) {
                m.pollSelectableOptionsCount = d.pollSelectableOptionsCount >>> 0;
            }
            if (d.messageSecret != null) {
                if (typeof d.messageSecret === "string")
                    $util.base64.decode(d.messageSecret, m.messageSecret = $util.newBuffer($util.base64.length(d.messageSecret)), 0);
                else if (d.messageSecret.length >= 0)
                    m.messageSecret = d.messageSecret;
            }
            if (d.originalSelfAuthor != null) {
                m.originalSelfAuthor = String(d.originalSelfAuthor);
            }
            if (d.senderTimestampMs != null) {
                if ($util.Long)
                    (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
                else if (typeof d.senderTimestampMs === "string")
                    m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
                else if (typeof d.senderTimestampMs === "number")
                    m.senderTimestampMs = d.senderTimestampMs;
                else if (typeof d.senderTimestampMs === "object")
                    m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
            }
            if (d.pollUpdateParentKey != null) {
                m.pollUpdateParentKey = String(d.pollUpdateParentKey);
            }
            if (d.encPollVote != null) {
                if (typeof d.encPollVote !== "object")
                    throw TypeError(".proto.MsgOpaqueData.encPollVote: object expected");
                m.encPollVote = $root.proto.PollEncValue.fromObject(d.encPollVote);
            }
            if (d.isSentCagPollCreation != null) {
                m.isSentCagPollCreation = Boolean(d.isSentCagPollCreation);
            }
            switch (d.pollContentType) {
            default:
                if (typeof d.pollContentType === "number") {
                    m.pollContentType = d.pollContentType;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.pollContentType = 0;
                break;
            case "TEXT":
            case 1:
                m.pollContentType = 1;
                break;
            case "IMAGE":
            case 2:
                m.pollContentType = 2;
                break;
            }
            switch (d.pollType) {
            default:
                if (typeof d.pollType === "number") {
                    m.pollType = d.pollType;
                    break;
                }
                break;
            case "POLL":
            case 0:
                m.pollType = 0;
                break;
            case "QUIZ":
            case 1:
                m.pollType = 1;
                break;
            }
            if (d.correctOptionIndex != null) {
                m.correctOptionIndex = d.correctOptionIndex | 0;
            }
            if (d.pollVotesSnapshot != null) {
                if (typeof d.pollVotesSnapshot !== "object")
                    throw TypeError(".proto.MsgOpaqueData.pollVotesSnapshot: object expected");
                m.pollVotesSnapshot = $root.proto.MsgOpaqueData.PollVotesSnapshot.fromObject(d.pollVotesSnapshot);
            }
            if (d.encReactionTargetMessageKey != null) {
                m.encReactionTargetMessageKey = String(d.encReactionTargetMessageKey);
            }
            if (d.encReactionEncPayload != null) {
                if (typeof d.encReactionEncPayload === "string")
                    $util.base64.decode(d.encReactionEncPayload, m.encReactionEncPayload = $util.newBuffer($util.base64.length(d.encReactionEncPayload)), 0);
                else if (d.encReactionEncPayload.length >= 0)
                    m.encReactionEncPayload = d.encReactionEncPayload;
            }
            if (d.encReactionEncIv != null) {
                if (typeof d.encReactionEncIv === "string")
                    $util.base64.decode(d.encReactionEncIv, m.encReactionEncIv = $util.newBuffer($util.base64.length(d.encReactionEncIv)), 0);
                else if (d.encReactionEncIv.length >= 0)
                    m.encReactionEncIv = d.encReactionEncIv;
            }
            if (d.botMessageSecret != null) {
                if (typeof d.botMessageSecret === "string")
                    $util.base64.decode(d.botMessageSecret, m.botMessageSecret = $util.newBuffer($util.base64.length(d.botMessageSecret)), 0);
                else if (d.botMessageSecret.length >= 0)
                    m.botMessageSecret = d.botMessageSecret;
            }
            if (d.targetMessageKey != null) {
                m.targetMessageKey = String(d.targetMessageKey);
            }
            if (d.encPayload != null) {
                if (typeof d.encPayload === "string")
                    $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0);
                else if (d.encPayload.length >= 0)
                    m.encPayload = d.encPayload;
            }
            if (d.encIv != null) {
                if (typeof d.encIv === "string")
                    $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0);
                else if (d.encIv.length >= 0)
                    m.encIv = d.encIv;
            }
            if (d.eventName != null) {
                m.eventName = String(d.eventName);
            }
            if (d.isEventCanceled != null) {
                m.isEventCanceled = Boolean(d.isEventCanceled);
            }
            if (d.eventDescription != null) {
                m.eventDescription = String(d.eventDescription);
            }
            if (d.eventJoinLink != null) {
                m.eventJoinLink = String(d.eventJoinLink);
            }
            if (d.eventStartTime != null) {
                if ($util.Long)
                    (m.eventStartTime = $util.Long.fromValue(d.eventStartTime)).unsigned = false;
                else if (typeof d.eventStartTime === "string")
                    m.eventStartTime = parseInt(d.eventStartTime, 10);
                else if (typeof d.eventStartTime === "number")
                    m.eventStartTime = d.eventStartTime;
                else if (typeof d.eventStartTime === "object")
                    m.eventStartTime = new $util.LongBits(d.eventStartTime.low >>> 0, d.eventStartTime.high >>> 0).toNumber();
            }
            if (d.eventLocation != null) {
                if (typeof d.eventLocation !== "object")
                    throw TypeError(".proto.MsgOpaqueData.eventLocation: object expected");
                m.eventLocation = $root.proto.MsgOpaqueData.EventLocation.fromObject(d.eventLocation);
            }
            if (d.eventEndTime != null) {
                if ($util.Long)
                    (m.eventEndTime = $util.Long.fromValue(d.eventEndTime)).unsigned = false;
                else if (typeof d.eventEndTime === "string")
                    m.eventEndTime = parseInt(d.eventEndTime, 10);
                else if (typeof d.eventEndTime === "number")
                    m.eventEndTime = d.eventEndTime;
                else if (typeof d.eventEndTime === "object")
                    m.eventEndTime = new $util.LongBits(d.eventEndTime.low >>> 0, d.eventEndTime.high >>> 0).toNumber();
            }
            if (d.eventIsScheduledCall != null) {
                m.eventIsScheduledCall = Boolean(d.eventIsScheduledCall);
            }
            if (d.eventExtraGuestsAllowed != null) {
                m.eventExtraGuestsAllowed = Boolean(d.eventExtraGuestsAllowed);
            }
            if (d.plainProtobufBytes != null) {
                if (typeof d.plainProtobufBytes === "string")
                    $util.base64.decode(d.plainProtobufBytes, m.plainProtobufBytes = $util.newBuffer($util.base64.length(d.plainProtobufBytes)), 0);
                else if (d.plainProtobufBytes.length >= 0)
                    m.plainProtobufBytes = d.plainProtobufBytes;
            }
            return m;
        };

        MsgOpaqueData.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.pollOptions = [];
            }
            if (m.body != null && m.hasOwnProperty("body")) {
                d.body = m.body;
                if (o.oneofs)
                    d._body = "body";
            }
            if (m.caption != null && m.hasOwnProperty("caption")) {
                d.caption = m.caption;
                if (o.oneofs)
                    d._caption = "caption";
            }
            if (m.lng != null && m.hasOwnProperty("lng")) {
                d.lng = o.json && !isFinite(m.lng) ? String(m.lng) : m.lng;
                if (o.oneofs)
                    d._lng = "lng";
            }
            if (m.isLive != null && m.hasOwnProperty("isLive")) {
                d.isLive = m.isLive;
                if (o.oneofs)
                    d._isLive = "isLive";
            }
            if (m.lat != null && m.hasOwnProperty("lat")) {
                d.lat = o.json && !isFinite(m.lat) ? String(m.lat) : m.lat;
                if (o.oneofs)
                    d._lat = "lat";
            }
            if (m.paymentAmount1000 != null && m.hasOwnProperty("paymentAmount1000")) {
                d.paymentAmount1000 = m.paymentAmount1000;
                if (o.oneofs)
                    d._paymentAmount1000 = "paymentAmount1000";
            }
            if (m.paymentNoteMsgBody != null && m.hasOwnProperty("paymentNoteMsgBody")) {
                d.paymentNoteMsgBody = m.paymentNoteMsgBody;
                if (o.oneofs)
                    d._paymentNoteMsgBody = "paymentNoteMsgBody";
            }
            if (m.matchedText != null && m.hasOwnProperty("matchedText")) {
                d.matchedText = m.matchedText;
                if (o.oneofs)
                    d._matchedText = "matchedText";
            }
            if (m.title != null && m.hasOwnProperty("title")) {
                d.title = m.title;
                if (o.oneofs)
                    d._title = "title";
            }
            if (m.description != null && m.hasOwnProperty("description")) {
                d.description = m.description;
                if (o.oneofs)
                    d._description = "description";
            }
            if (m.futureproofBuffer != null && m.hasOwnProperty("futureproofBuffer")) {
                d.futureproofBuffer = o.bytes === String ? $util.base64.encode(m.futureproofBuffer, 0, m.futureproofBuffer.length) : o.bytes === Array ? Array.prototype.slice.call(m.futureproofBuffer) : m.futureproofBuffer;
                if (o.oneofs)
                    d._futureproofBuffer = "futureproofBuffer";
            }
            if (m.clientUrl != null && m.hasOwnProperty("clientUrl")) {
                d.clientUrl = m.clientUrl;
                if (o.oneofs)
                    d._clientUrl = "clientUrl";
            }
            if (m.loc != null && m.hasOwnProperty("loc")) {
                d.loc = m.loc;
                if (o.oneofs)
                    d._loc = "loc";
            }
            if (m.pollName != null && m.hasOwnProperty("pollName")) {
                d.pollName = m.pollName;
                if (o.oneofs)
                    d._pollName = "pollName";
            }
            if (m.pollOptions && m.pollOptions.length) {
                d.pollOptions = [];
                for (var j = 0; j < m.pollOptions.length; ++j) {
                    d.pollOptions[j] = $root.proto.MsgOpaqueData.PollOption.toObject(m.pollOptions[j], o);
                }
            }
            if (m.pollSelectableOptionsCount != null && m.hasOwnProperty("pollSelectableOptionsCount")) {
                d.pollSelectableOptionsCount = m.pollSelectableOptionsCount;
                if (o.oneofs)
                    d._pollSelectableOptionsCount = "pollSelectableOptionsCount";
            }
            if (m.messageSecret != null && m.hasOwnProperty("messageSecret")) {
                d.messageSecret = o.bytes === String ? $util.base64.encode(m.messageSecret, 0, m.messageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.messageSecret) : m.messageSecret;
                if (o.oneofs)
                    d._messageSecret = "messageSecret";
            }
            if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
                if (typeof m.senderTimestampMs === "number")
                    d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
                else
                    d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
                if (o.oneofs)
                    d._senderTimestampMs = "senderTimestampMs";
            }
            if (m.pollUpdateParentKey != null && m.hasOwnProperty("pollUpdateParentKey")) {
                d.pollUpdateParentKey = m.pollUpdateParentKey;
                if (o.oneofs)
                    d._pollUpdateParentKey = "pollUpdateParentKey";
            }
            if (m.encPollVote != null && m.hasOwnProperty("encPollVote")) {
                d.encPollVote = $root.proto.PollEncValue.toObject(m.encPollVote, o);
                if (o.oneofs)
                    d._encPollVote = "encPollVote";
            }
            if (m.encReactionTargetMessageKey != null && m.hasOwnProperty("encReactionTargetMessageKey")) {
                d.encReactionTargetMessageKey = m.encReactionTargetMessageKey;
                if (o.oneofs)
                    d._encReactionTargetMessageKey = "encReactionTargetMessageKey";
            }
            if (m.encReactionEncPayload != null && m.hasOwnProperty("encReactionEncPayload")) {
                d.encReactionEncPayload = o.bytes === String ? $util.base64.encode(m.encReactionEncPayload, 0, m.encReactionEncPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encReactionEncPayload) : m.encReactionEncPayload;
                if (o.oneofs)
                    d._encReactionEncPayload = "encReactionEncPayload";
            }
            if (m.encReactionEncIv != null && m.hasOwnProperty("encReactionEncIv")) {
                d.encReactionEncIv = o.bytes === String ? $util.base64.encode(m.encReactionEncIv, 0, m.encReactionEncIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encReactionEncIv) : m.encReactionEncIv;
                if (o.oneofs)
                    d._encReactionEncIv = "encReactionEncIv";
            }
            if (m.isSentCagPollCreation != null && m.hasOwnProperty("isSentCagPollCreation")) {
                d.isSentCagPollCreation = m.isSentCagPollCreation;
                if (o.oneofs)
                    d._isSentCagPollCreation = "isSentCagPollCreation";
            }
            if (m.botMessageSecret != null && m.hasOwnProperty("botMessageSecret")) {
                d.botMessageSecret = o.bytes === String ? $util.base64.encode(m.botMessageSecret, 0, m.botMessageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.botMessageSecret) : m.botMessageSecret;
                if (o.oneofs)
                    d._botMessageSecret = "botMessageSecret";
            }
            if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) {
                d.targetMessageKey = m.targetMessageKey;
                if (o.oneofs)
                    d._targetMessageKey = "targetMessageKey";
            }
            if (m.encPayload != null && m.hasOwnProperty("encPayload")) {
                d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload;
                if (o.oneofs)
                    d._encPayload = "encPayload";
            }
            if (m.encIv != null && m.hasOwnProperty("encIv")) {
                d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv;
                if (o.oneofs)
                    d._encIv = "encIv";
            }
            if (m.eventName != null && m.hasOwnProperty("eventName")) {
                d.eventName = m.eventName;
                if (o.oneofs)
                    d._eventName = "eventName";
            }
            if (m.isEventCanceled != null && m.hasOwnProperty("isEventCanceled")) {
                d.isEventCanceled = m.isEventCanceled;
                if (o.oneofs)
                    d._isEventCanceled = "isEventCanceled";
            }
            if (m.eventDescription != null && m.hasOwnProperty("eventDescription")) {
                d.eventDescription = m.eventDescription;
                if (o.oneofs)
                    d._eventDescription = "eventDescription";
            }
            if (m.eventJoinLink != null && m.hasOwnProperty("eventJoinLink")) {
                d.eventJoinLink = m.eventJoinLink;
                if (o.oneofs)
                    d._eventJoinLink = "eventJoinLink";
            }
            if (m.eventStartTime != null && m.hasOwnProperty("eventStartTime")) {
                if (typeof m.eventStartTime === "number")
                    d.eventStartTime = o.longs === String ? String(m.eventStartTime) : m.eventStartTime;
                else
                    d.eventStartTime = o.longs === String ? longToString(m.eventStartTime) : o.longs === Number ? longToNumber(m.eventStartTime) : m.eventStartTime;
                if (o.oneofs)
                    d._eventStartTime = "eventStartTime";
            }
            if (m.eventLocation != null && m.hasOwnProperty("eventLocation")) {
                d.eventLocation = $root.proto.MsgOpaqueData.EventLocation.toObject(m.eventLocation, o);
                if (o.oneofs)
                    d._eventLocation = "eventLocation";
            }
            if (m.eventEndTime != null && m.hasOwnProperty("eventEndTime")) {
                if (typeof m.eventEndTime === "number")
                    d.eventEndTime = o.longs === String ? String(m.eventEndTime) : m.eventEndTime;
                else
                    d.eventEndTime = o.longs === String ? longToString(m.eventEndTime) : o.longs === Number ? longToNumber(m.eventEndTime) : m.eventEndTime;
                if (o.oneofs)
                    d._eventEndTime = "eventEndTime";
            }
            if (m.pollVotesSnapshot != null && m.hasOwnProperty("pollVotesSnapshot")) {
                d.pollVotesSnapshot = $root.proto.MsgOpaqueData.PollVotesSnapshot.toObject(m.pollVotesSnapshot, o);
                if (o.oneofs)
                    d._pollVotesSnapshot = "pollVotesSnapshot";
            }
            if (m.pollContentType != null && m.hasOwnProperty("pollContentType")) {
                d.pollContentType = o.enums === String ? $root.proto.MsgOpaqueData.PollContentType[m.pollContentType] === undefined ? m.pollContentType : $root.proto.MsgOpaqueData.PollContentType[m.pollContentType] : m.pollContentType;
                if (o.oneofs)
                    d._pollContentType = "pollContentType";
            }
            if (m.plainProtobufBytes != null && m.hasOwnProperty("plainProtobufBytes")) {
                d.plainProtobufBytes = o.bytes === String ? $util.base64.encode(m.plainProtobufBytes, 0, m.plainProtobufBytes.length) : o.bytes === Array ? Array.prototype.slice.call(m.plainProtobufBytes) : m.plainProtobufBytes;
                if (o.oneofs)
                    d._plainProtobufBytes = "plainProtobufBytes";
            }
            if (m.eventIsScheduledCall != null && m.hasOwnProperty("eventIsScheduledCall")) {
                d.eventIsScheduledCall = m.eventIsScheduledCall;
                if (o.oneofs)
                    d._eventIsScheduledCall = "eventIsScheduledCall";
            }
            if (m.eventExtraGuestsAllowed != null && m.hasOwnProperty("eventExtraGuestsAllowed")) {
                d.eventExtraGuestsAllowed = m.eventExtraGuestsAllowed;
                if (o.oneofs)
                    d._eventExtraGuestsAllowed = "eventExtraGuestsAllowed";
            }
            if (m.pollType != null && m.hasOwnProperty("pollType")) {
                d.pollType = o.enums === String ? $root.proto.MsgOpaqueData.PollType[m.pollType] === undefined ? m.pollType : $root.proto.MsgOpaqueData.PollType[m.pollType] : m.pollType;
                if (o.oneofs)
                    d._pollType = "pollType";
            }
            if (m.correctOptionIndex != null && m.hasOwnProperty("correctOptionIndex")) {
                d.correctOptionIndex = m.correctOptionIndex;
                if (o.oneofs)
                    d._correctOptionIndex = "correctOptionIndex";
            }
            if (m.originalSelfAuthor != null && m.hasOwnProperty("originalSelfAuthor")) {
                d.originalSelfAuthor = m.originalSelfAuthor;
                if (o.oneofs)
                    d._originalSelfAuthor = "originalSelfAuthor";
            }
            return d;
        };

        MsgOpaqueData.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MsgOpaqueData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MsgOpaqueData";
        };

        MsgOpaqueData.EventLocation = (function() {

            function EventLocation(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            EventLocation.prototype.degreesLatitude = null;
            EventLocation.prototype.degreesLongitude = null;
            EventLocation.prototype.name = null;
            EventLocation.prototype.address = null;
            EventLocation.prototype.url = null;
            EventLocation.prototype.jpegThumbnail = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventLocation.prototype, "_degreesLatitude", {
                get: $util.oneOfGetter($oneOfFields = ["degreesLatitude"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventLocation.prototype, "_degreesLongitude", {
                get: $util.oneOfGetter($oneOfFields = ["degreesLongitude"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventLocation.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventLocation.prototype, "_address", {
                get: $util.oneOfGetter($oneOfFields = ["address"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventLocation.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(EventLocation.prototype, "_jpegThumbnail", {
                get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            EventLocation.create = function create(properties) {
                return new EventLocation(properties);
            };

            EventLocation.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.degreesLatitude != null && Object.hasOwnProperty.call(m, "degreesLatitude"))
                    w.uint32(9).double(m.degreesLatitude);
                if (m.degreesLongitude != null && Object.hasOwnProperty.call(m, "degreesLongitude"))
                    w.uint32(17).double(m.degreesLongitude);
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(26).string(m.name);
                if (m.address != null && Object.hasOwnProperty.call(m, "address"))
                    w.uint32(34).string(m.address);
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(42).string(m.url);
                if (m.jpegThumbnail != null && Object.hasOwnProperty.call(m, "jpegThumbnail"))
                    w.uint32(50).bytes(m.jpegThumbnail);
                return w;
            };

            EventLocation.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MsgOpaqueData.EventLocation();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.degreesLatitude = r.double();
                            break;
                        }
                    case 2: {
                            m.degreesLongitude = r.double();
                            break;
                        }
                    case 3: {
                            m.name = r.string();
                            break;
                        }
                    case 4: {
                            m.address = r.string();
                            break;
                        }
                    case 5: {
                            m.url = r.string();
                            break;
                        }
                    case 6: {
                            m.jpegThumbnail = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            EventLocation.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.MsgOpaqueData.EventLocation)
                    return d;
                var m = new $root.proto.MsgOpaqueData.EventLocation();
                if (d.degreesLatitude != null) {
                    m.degreesLatitude = Number(d.degreesLatitude);
                }
                if (d.degreesLongitude != null) {
                    m.degreesLongitude = Number(d.degreesLongitude);
                }
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.address != null) {
                    m.address = String(d.address);
                }
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.jpegThumbnail != null) {
                    if (typeof d.jpegThumbnail === "string")
                        $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0);
                    else if (d.jpegThumbnail.length >= 0)
                        m.jpegThumbnail = d.jpegThumbnail;
                }
                return m;
            };

            EventLocation.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.degreesLatitude != null && m.hasOwnProperty("degreesLatitude")) {
                    d.degreesLatitude = o.json && !isFinite(m.degreesLatitude) ? String(m.degreesLatitude) : m.degreesLatitude;
                    if (o.oneofs)
                        d._degreesLatitude = "degreesLatitude";
                }
                if (m.degreesLongitude != null && m.hasOwnProperty("degreesLongitude")) {
                    d.degreesLongitude = o.json && !isFinite(m.degreesLongitude) ? String(m.degreesLongitude) : m.degreesLongitude;
                    if (o.oneofs)
                        d._degreesLongitude = "degreesLongitude";
                }
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.address != null && m.hasOwnProperty("address")) {
                    d.address = m.address;
                    if (o.oneofs)
                        d._address = "address";
                }
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) {
                    d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail;
                    if (o.oneofs)
                        d._jpegThumbnail = "jpegThumbnail";
                }
                return d;
            };

            EventLocation.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            EventLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.MsgOpaqueData.EventLocation";
            };

            return EventLocation;
        })();

        MsgOpaqueData.PollContentType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "TEXT"] = 1;
            values[valuesById[2] = "IMAGE"] = 2;
            return values;
        })();

        MsgOpaqueData.PollOption = (function() {

            function PollOption(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollOption.prototype.name = null;
            PollOption.prototype.hash = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollOption.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollOption.prototype, "_hash", {
                get: $util.oneOfGetter($oneOfFields = ["hash"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PollOption.create = function create(properties) {
                return new PollOption(properties);
            };

            PollOption.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(10).string(m.name);
                if (m.hash != null && Object.hasOwnProperty.call(m, "hash"))
                    w.uint32(18).string(m.hash);
                return w;
            };

            PollOption.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MsgOpaqueData.PollOption();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.name = r.string();
                            break;
                        }
                    case 2: {
                            m.hash = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollOption.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.MsgOpaqueData.PollOption)
                    return d;
                var m = new $root.proto.MsgOpaqueData.PollOption();
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.hash != null) {
                    m.hash = String(d.hash);
                }
                return m;
            };

            PollOption.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.hash != null && m.hasOwnProperty("hash")) {
                    d.hash = m.hash;
                    if (o.oneofs)
                        d._hash = "hash";
                }
                return d;
            };

            PollOption.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.MsgOpaqueData.PollOption";
            };

            return PollOption;
        })();

        MsgOpaqueData.PollType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "POLL"] = 0;
            values[valuesById[1] = "QUIZ"] = 1;
            return values;
        })();

        MsgOpaqueData.PollVoteSnapshot = (function() {

            function PollVoteSnapshot(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollVoteSnapshot.prototype.option = null;
            PollVoteSnapshot.prototype.optionVoteCount = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollVoteSnapshot.prototype, "_option", {
                get: $util.oneOfGetter($oneOfFields = ["option"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PollVoteSnapshot.prototype, "_optionVoteCount", {
                get: $util.oneOfGetter($oneOfFields = ["optionVoteCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PollVoteSnapshot.create = function create(properties) {
                return new PollVoteSnapshot(properties);
            };

            PollVoteSnapshot.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.option != null && Object.hasOwnProperty.call(m, "option"))
                    $root.proto.MsgOpaqueData.PollOption.encode(m.option, w.uint32(10).fork()).ldelim();
                if (m.optionVoteCount != null && Object.hasOwnProperty.call(m, "optionVoteCount"))
                    w.uint32(16).int32(m.optionVoteCount);
                return w;
            };

            PollVoteSnapshot.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MsgOpaqueData.PollVoteSnapshot();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.option = $root.proto.MsgOpaqueData.PollOption.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.optionVoteCount = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollVoteSnapshot.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.MsgOpaqueData.PollVoteSnapshot)
                    return d;
                var m = new $root.proto.MsgOpaqueData.PollVoteSnapshot();
                if (d.option != null) {
                    if (typeof d.option !== "object")
                        throw TypeError(".proto.MsgOpaqueData.PollVoteSnapshot.option: object expected");
                    m.option = $root.proto.MsgOpaqueData.PollOption.fromObject(d.option);
                }
                if (d.optionVoteCount != null) {
                    m.optionVoteCount = d.optionVoteCount | 0;
                }
                return m;
            };

            PollVoteSnapshot.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.option != null && m.hasOwnProperty("option")) {
                    d.option = $root.proto.MsgOpaqueData.PollOption.toObject(m.option, o);
                    if (o.oneofs)
                        d._option = "option";
                }
                if (m.optionVoteCount != null && m.hasOwnProperty("optionVoteCount")) {
                    d.optionVoteCount = m.optionVoteCount;
                    if (o.oneofs)
                        d._optionVoteCount = "optionVoteCount";
                }
                return d;
            };

            PollVoteSnapshot.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollVoteSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.MsgOpaqueData.PollVoteSnapshot";
            };

            return PollVoteSnapshot;
        })();

        MsgOpaqueData.PollVotesSnapshot = (function() {

            function PollVotesSnapshot(p) {
                this.pollVotes = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PollVotesSnapshot.prototype.pollVotes = $util.emptyArray;

            PollVotesSnapshot.create = function create(properties) {
                return new PollVotesSnapshot(properties);
            };

            PollVotesSnapshot.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.pollVotes != null && m.pollVotes.length) {
                    for (var i = 0; i < m.pollVotes.length; ++i)
                        $root.proto.MsgOpaqueData.PollVoteSnapshot.encode(m.pollVotes[i], w.uint32(10).fork()).ldelim();
                }
                return w;
            };

            PollVotesSnapshot.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MsgOpaqueData.PollVotesSnapshot();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.pollVotes && m.pollVotes.length))
                                m.pollVotes = [];
                            m.pollVotes.push($root.proto.MsgOpaqueData.PollVoteSnapshot.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PollVotesSnapshot.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.MsgOpaqueData.PollVotesSnapshot)
                    return d;
                var m = new $root.proto.MsgOpaqueData.PollVotesSnapshot();
                if (d.pollVotes) {
                    if (!Array.isArray(d.pollVotes))
                        throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: array expected");
                    m.pollVotes = [];
                    for (var i = 0; i < d.pollVotes.length; ++i) {
                        if (typeof d.pollVotes[i] !== "object")
                            throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: object expected");
                        m.pollVotes[i] = $root.proto.MsgOpaqueData.PollVoteSnapshot.fromObject(d.pollVotes[i]);
                    }
                }
                return m;
            };

            PollVotesSnapshot.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.pollVotes = [];
                }
                if (m.pollVotes && m.pollVotes.length) {
                    d.pollVotes = [];
                    for (var j = 0; j < m.pollVotes.length; ++j) {
                        d.pollVotes[j] = $root.proto.MsgOpaqueData.PollVoteSnapshot.toObject(m.pollVotes[j], o);
                    }
                }
                return d;
            };

            PollVotesSnapshot.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PollVotesSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.MsgOpaqueData.PollVotesSnapshot";
            };

            return PollVotesSnapshot;
        })();

        return MsgOpaqueData;
    })();

    proto.MsgRowOpaqueData = (function() {

        function MsgRowOpaqueData(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        MsgRowOpaqueData.prototype.currentMsg = null;
        MsgRowOpaqueData.prototype.quotedMsg = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgRowOpaqueData.prototype, "_currentMsg", {
            get: $util.oneOfGetter($oneOfFields = ["currentMsg"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(MsgRowOpaqueData.prototype, "_quotedMsg", {
            get: $util.oneOfGetter($oneOfFields = ["quotedMsg"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        MsgRowOpaqueData.create = function create(properties) {
            return new MsgRowOpaqueData(properties);
        };

        MsgRowOpaqueData.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.currentMsg != null && Object.hasOwnProperty.call(m, "currentMsg"))
                $root.proto.MsgOpaqueData.encode(m.currentMsg, w.uint32(10).fork()).ldelim();
            if (m.quotedMsg != null && Object.hasOwnProperty.call(m, "quotedMsg"))
                $root.proto.MsgOpaqueData.encode(m.quotedMsg, w.uint32(18).fork()).ldelim();
            return w;
        };

        MsgRowOpaqueData.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MsgRowOpaqueData();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.currentMsg = $root.proto.MsgOpaqueData.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.quotedMsg = $root.proto.MsgOpaqueData.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        MsgRowOpaqueData.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.MsgRowOpaqueData)
                return d;
            var m = new $root.proto.MsgRowOpaqueData();
            if (d.currentMsg != null) {
                if (typeof d.currentMsg !== "object")
                    throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected");
                m.currentMsg = $root.proto.MsgOpaqueData.fromObject(d.currentMsg);
            }
            if (d.quotedMsg != null) {
                if (typeof d.quotedMsg !== "object")
                    throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected");
                m.quotedMsg = $root.proto.MsgOpaqueData.fromObject(d.quotedMsg);
            }
            return m;
        };

        MsgRowOpaqueData.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.currentMsg != null && m.hasOwnProperty("currentMsg")) {
                d.currentMsg = $root.proto.MsgOpaqueData.toObject(m.currentMsg, o);
                if (o.oneofs)
                    d._currentMsg = "currentMsg";
            }
            if (m.quotedMsg != null && m.hasOwnProperty("quotedMsg")) {
                d.quotedMsg = $root.proto.MsgOpaqueData.toObject(m.quotedMsg, o);
                if (o.oneofs)
                    d._quotedMsg = "quotedMsg";
            }
            return d;
        };

        MsgRowOpaqueData.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        MsgRowOpaqueData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.MsgRowOpaqueData";
        };

        return MsgRowOpaqueData;
    })();

    proto.MutationProps = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[2] = "STAR_ACTION"] = 2;
        values[valuesById[3] = "CONTACT_ACTION"] = 3;
        values[valuesById[4] = "MUTE_ACTION"] = 4;
        values[valuesById[5] = "PIN_ACTION"] = 5;
        values[valuesById[6] = "SECURITY_NOTIFICATION_SETTING"] = 6;
        values[valuesById[7] = "PUSH_NAME_SETTING"] = 7;
        values[valuesById[8] = "QUICK_REPLY_ACTION"] = 8;
        values[valuesById[11] = "RECENT_EMOJI_WEIGHTS_ACTION"] = 11;
        values[valuesById[13] = "LABEL_MESSAGE_ACTION"] = 13;
        values[valuesById[14] = "LABEL_EDIT_ACTION"] = 14;
        values[valuesById[15] = "LABEL_ASSOCIATION_ACTION"] = 15;
        values[valuesById[16] = "LOCALE_SETTING"] = 16;
        values[valuesById[17] = "ARCHIVE_CHAT_ACTION"] = 17;
        values[valuesById[18] = "DELETE_MESSAGE_FOR_ME_ACTION"] = 18;
        values[valuesById[19] = "KEY_EXPIRATION"] = 19;
        values[valuesById[20] = "MARK_CHAT_AS_READ_ACTION"] = 20;
        values[valuesById[21] = "CLEAR_CHAT_ACTION"] = 21;
        values[valuesById[22] = "DELETE_CHAT_ACTION"] = 22;
        values[valuesById[23] = "UNARCHIVE_CHATS_SETTING"] = 23;
        values[valuesById[24] = "PRIMARY_FEATURE"] = 24;
        values[valuesById[26] = "ANDROID_UNSUPPORTED_ACTIONS"] = 26;
        values[valuesById[27] = "AGENT_ACTION"] = 27;
        values[valuesById[28] = "SUBSCRIPTION_ACTION"] = 28;
        values[valuesById[29] = "USER_STATUS_MUTE_ACTION"] = 29;
        values[valuesById[30] = "TIME_FORMAT_ACTION"] = 30;
        values[valuesById[31] = "NUX_ACTION"] = 31;
        values[valuesById[32] = "PRIMARY_VERSION_ACTION"] = 32;
        values[valuesById[33] = "STICKER_ACTION"] = 33;
        values[valuesById[34] = "REMOVE_RECENT_STICKER_ACTION"] = 34;
        values[valuesById[35] = "CHAT_ASSIGNMENT"] = 35;
        values[valuesById[36] = "CHAT_ASSIGNMENT_OPENED_STATUS"] = 36;
        values[valuesById[37] = "PN_FOR_LID_CHAT_ACTION"] = 37;
        values[valuesById[38] = "MARKETING_MESSAGE_ACTION"] = 38;
        values[valuesById[39] = "MARKETING_MESSAGE_BROADCAST_ACTION"] = 39;
        values[valuesById[40] = "EXTERNAL_WEB_BETA_ACTION"] = 40;
        values[valuesById[41] = "PRIVACY_SETTING_RELAY_ALL_CALLS"] = 41;
        values[valuesById[42] = "CALL_LOG_ACTION"] = 42;
        values[valuesById[43] = "UGC_BOT"] = 43;
        values[valuesById[44] = "STATUS_PRIVACY"] = 44;
        values[valuesById[45] = "BOT_WELCOME_REQUEST_ACTION"] = 45;
        values[valuesById[46] = "DELETE_INDIVIDUAL_CALL_LOG"] = 46;
        values[valuesById[47] = "LABEL_REORDERING_ACTION"] = 47;
        values[valuesById[48] = "PAYMENT_INFO_ACTION"] = 48;
        values[valuesById[49] = "CUSTOM_PAYMENT_METHODS_ACTION"] = 49;
        values[valuesById[50] = "LOCK_CHAT_ACTION"] = 50;
        values[valuesById[51] = "CHAT_LOCK_SETTINGS"] = 51;
        values[valuesById[52] = "WAMO_USER_IDENTIFIER_ACTION"] = 52;
        values[valuesById[53] = "PRIVACY_SETTING_DISABLE_LINK_PREVIEWS_ACTION"] = 53;
        values[valuesById[54] = "DEVICE_CAPABILITIES"] = 54;
        values[valuesById[55] = "NOTE_EDIT_ACTION"] = 55;
        values[valuesById[56] = "FAVORITES_ACTION"] = 56;
        values[valuesById[57] = "MERCHANT_PAYMENT_PARTNER_ACTION"] = 57;
        values[valuesById[58] = "WAFFLE_ACCOUNT_LINK_STATE_ACTION"] = 58;
        values[valuesById[59] = "USERNAME_CHAT_START_MODE"] = 59;
        values[valuesById[60] = "NOTIFICATION_ACTIVITY_SETTING_ACTION"] = 60;
        values[valuesById[61] = "LID_CONTACT_ACTION"] = 61;
        values[valuesById[62] = "CTWA_PER_CUSTOMER_DATA_SHARING_ACTION"] = 62;
        values[valuesById[63] = "PAYMENT_TOS_ACTION"] = 63;
        values[valuesById[64] = "PRIVACY_SETTING_CHANNELS_PERSONALISED_RECOMMENDATION_ACTION"] = 64;
        values[valuesById[65] = "BUSINESS_BROADCAST_ASSOCIATION_ACTION"] = 65;
        values[valuesById[66] = "DETECTED_OUTCOMES_STATUS_ACTION"] = 66;
        values[valuesById[68] = "MAIBA_AI_FEATURES_CONTROL_ACTION"] = 68;
        values[valuesById[69] = "BUSINESS_BROADCAST_LIST_ACTION"] = 69;
        values[valuesById[70] = "MUSIC_USER_ID_ACTION"] = 70;
        values[valuesById[71] = "STATUS_POST_OPT_IN_NOTIFICATION_PREFERENCES_ACTION"] = 71;
        values[valuesById[72] = "AVATAR_UPDATED_ACTION"] = 72;
        values[valuesById[73] = "GALAXY_FLOW_ACTION"] = 73;
        values[valuesById[74] = "PRIVATE_PROCESSING_SETTING_ACTION"] = 74;
        values[valuesById[75] = "NEWSLETTER_SAVED_INTERESTS_ACTION"] = 75;
        values[valuesById[76] = "AI_THREAD_RENAME_ACTION"] = 76;
        values[valuesById[77] = "INTERACTIVE_MESSAGE_ACTION"] = 77;
        values[valuesById[10001] = "SHARE_OWN_PN"] = 10001;
        values[valuesById[10002] = "BUSINESS_BROADCAST_ACTION"] = 10002;
        return values;
    })();

    proto.NoiseCertificate = (function() {

        function NoiseCertificate(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        NoiseCertificate.prototype.details = null;
        NoiseCertificate.prototype.signature = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NoiseCertificate.prototype, "_details", {
            get: $util.oneOfGetter($oneOfFields = ["details"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NoiseCertificate.prototype, "_signature", {
            get: $util.oneOfGetter($oneOfFields = ["signature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        NoiseCertificate.create = function create(properties) {
            return new NoiseCertificate(properties);
        };

        NoiseCertificate.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.details != null && Object.hasOwnProperty.call(m, "details"))
                w.uint32(10).bytes(m.details);
            if (m.signature != null && Object.hasOwnProperty.call(m, "signature"))
                w.uint32(18).bytes(m.signature);
            return w;
        };

        NoiseCertificate.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NoiseCertificate();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.details = r.bytes();
                        break;
                    }
                case 2: {
                        m.signature = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        NoiseCertificate.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.NoiseCertificate)
                return d;
            var m = new $root.proto.NoiseCertificate();
            if (d.details != null) {
                if (typeof d.details === "string")
                    $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0);
                else if (d.details.length >= 0)
                    m.details = d.details;
            }
            if (d.signature != null) {
                if (typeof d.signature === "string")
                    $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0);
                else if (d.signature.length >= 0)
                    m.signature = d.signature;
            }
            return m;
        };

        NoiseCertificate.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.details != null && m.hasOwnProperty("details")) {
                d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details;
                if (o.oneofs)
                    d._details = "details";
            }
            if (m.signature != null && m.hasOwnProperty("signature")) {
                d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature;
                if (o.oneofs)
                    d._signature = "signature";
            }
            return d;
        };

        NoiseCertificate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        NoiseCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.NoiseCertificate";
        };

        NoiseCertificate.Details = (function() {

            function Details(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            Details.prototype.serial = null;
            Details.prototype.issuer = null;
            Details.prototype.expires = null;
            Details.prototype.subject = null;
            Details.prototype.key = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_serial", {
                get: $util.oneOfGetter($oneOfFields = ["serial"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_issuer", {
                get: $util.oneOfGetter($oneOfFields = ["issuer"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_expires", {
                get: $util.oneOfGetter($oneOfFields = ["expires"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_subject", {
                get: $util.oneOfGetter($oneOfFields = ["subject"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Details.create = function create(properties) {
                return new Details(properties);
            };

            Details.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.serial != null && Object.hasOwnProperty.call(m, "serial"))
                    w.uint32(8).uint32(m.serial);
                if (m.issuer != null && Object.hasOwnProperty.call(m, "issuer"))
                    w.uint32(18).string(m.issuer);
                if (m.expires != null && Object.hasOwnProperty.call(m, "expires"))
                    w.uint32(24).uint64(m.expires);
                if (m.subject != null && Object.hasOwnProperty.call(m, "subject"))
                    w.uint32(34).string(m.subject);
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    w.uint32(42).bytes(m.key);
                return w;
            };

            Details.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NoiseCertificate.Details();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.serial = r.uint32();
                            break;
                        }
                    case 2: {
                            m.issuer = r.string();
                            break;
                        }
                    case 3: {
                            m.expires = r.uint64();
                            break;
                        }
                    case 4: {
                            m.subject = r.string();
                            break;
                        }
                    case 5: {
                            m.key = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            Details.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.NoiseCertificate.Details)
                    return d;
                var m = new $root.proto.NoiseCertificate.Details();
                if (d.serial != null) {
                    m.serial = d.serial >>> 0;
                }
                if (d.issuer != null) {
                    m.issuer = String(d.issuer);
                }
                if (d.expires != null) {
                    if ($util.Long)
                        (m.expires = $util.Long.fromValue(d.expires)).unsigned = true;
                    else if (typeof d.expires === "string")
                        m.expires = parseInt(d.expires, 10);
                    else if (typeof d.expires === "number")
                        m.expires = d.expires;
                    else if (typeof d.expires === "object")
                        m.expires = new $util.LongBits(d.expires.low >>> 0, d.expires.high >>> 0).toNumber(true);
                }
                if (d.subject != null) {
                    m.subject = String(d.subject);
                }
                if (d.key != null) {
                    if (typeof d.key === "string")
                        $util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0);
                    else if (d.key.length >= 0)
                        m.key = d.key;
                }
                return m;
            };

            Details.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.serial != null && m.hasOwnProperty("serial")) {
                    d.serial = m.serial;
                    if (o.oneofs)
                        d._serial = "serial";
                }
                if (m.issuer != null && m.hasOwnProperty("issuer")) {
                    d.issuer = m.issuer;
                    if (o.oneofs)
                        d._issuer = "issuer";
                }
                if (m.expires != null && m.hasOwnProperty("expires")) {
                    if (typeof m.expires === "number")
                        d.expires = o.longs === String ? String(m.expires) : m.expires;
                    else
                        d.expires = o.longs === String ? longToString(m.expires, true) : o.longs === Number ? longToNumber(m.expires, true) : m.expires;
                    if (o.oneofs)
                        d._expires = "expires";
                }
                if (m.subject != null && m.hasOwnProperty("subject")) {
                    d.subject = m.subject;
                    if (o.oneofs)
                        d._subject = "subject";
                }
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key;
                    if (o.oneofs)
                        d._key = "key";
                }
                return d;
            };

            Details.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.NoiseCertificate.Details";
            };

            return Details;
        })();

        return NoiseCertificate;
    })();

    proto.NotificationMessageInfo = (function() {

        function NotificationMessageInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        NotificationMessageInfo.prototype.key = null;
        NotificationMessageInfo.prototype.message = null;
        NotificationMessageInfo.prototype.messageTimestamp = null;
        NotificationMessageInfo.prototype.participant = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationMessageInfo.prototype, "_key", {
            get: $util.oneOfGetter($oneOfFields = ["key"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationMessageInfo.prototype, "_message", {
            get: $util.oneOfGetter($oneOfFields = ["message"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationMessageInfo.prototype, "_messageTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["messageTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationMessageInfo.prototype, "_participant", {
            get: $util.oneOfGetter($oneOfFields = ["participant"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        NotificationMessageInfo.create = function create(properties) {
            return new NotificationMessageInfo(properties);
        };

        NotificationMessageInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
            if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                $root.proto.Message.encode(m.message, w.uint32(18).fork()).ldelim();
            if (m.messageTimestamp != null && Object.hasOwnProperty.call(m, "messageTimestamp"))
                w.uint32(24).uint64(m.messageTimestamp);
            if (m.participant != null && Object.hasOwnProperty.call(m, "participant"))
                w.uint32(34).string(m.participant);
            return w;
        };

        NotificationMessageInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NotificationMessageInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.key = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.message = $root.proto.Message.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.messageTimestamp = r.uint64();
                        break;
                    }
                case 4: {
                        m.participant = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        NotificationMessageInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.NotificationMessageInfo)
                return d;
            var m = new $root.proto.NotificationMessageInfo();
            if (d.key != null) {
                if (typeof d.key !== "object")
                    throw TypeError(".proto.NotificationMessageInfo.key: object expected");
                m.key = $root.proto.MessageKey.fromObject(d.key);
            }
            if (d.message != null) {
                if (typeof d.message !== "object")
                    throw TypeError(".proto.NotificationMessageInfo.message: object expected");
                m.message = $root.proto.Message.fromObject(d.message);
            }
            if (d.messageTimestamp != null) {
                if ($util.Long)
                    (m.messageTimestamp = $util.Long.fromValue(d.messageTimestamp)).unsigned = true;
                else if (typeof d.messageTimestamp === "string")
                    m.messageTimestamp = parseInt(d.messageTimestamp, 10);
                else if (typeof d.messageTimestamp === "number")
                    m.messageTimestamp = d.messageTimestamp;
                else if (typeof d.messageTimestamp === "object")
                    m.messageTimestamp = new $util.LongBits(d.messageTimestamp.low >>> 0, d.messageTimestamp.high >>> 0).toNumber(true);
            }
            if (d.participant != null) {
                m.participant = String(d.participant);
            }
            return m;
        };

        NotificationMessageInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.key != null && m.hasOwnProperty("key")) {
                d.key = $root.proto.MessageKey.toObject(m.key, o);
                if (o.oneofs)
                    d._key = "key";
            }
            if (m.message != null && m.hasOwnProperty("message")) {
                d.message = $root.proto.Message.toObject(m.message, o);
                if (o.oneofs)
                    d._message = "message";
            }
            if (m.messageTimestamp != null && m.hasOwnProperty("messageTimestamp")) {
                if (typeof m.messageTimestamp === "number")
                    d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp;
                else
                    d.messageTimestamp = o.longs === String ? longToString(m.messageTimestamp, true) : o.longs === Number ? longToNumber(m.messageTimestamp, true) : m.messageTimestamp;
                if (o.oneofs)
                    d._messageTimestamp = "messageTimestamp";
            }
            if (m.participant != null && m.hasOwnProperty("participant")) {
                d.participant = m.participant;
                if (o.oneofs)
                    d._participant = "participant";
            }
            return d;
        };

        NotificationMessageInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        NotificationMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.NotificationMessageInfo";
        };

        return NotificationMessageInfo;
    })();

    proto.NotificationSettings = (function() {

        function NotificationSettings(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        NotificationSettings.prototype.messageVibrate = null;
        NotificationSettings.prototype.messagePopup = null;
        NotificationSettings.prototype.messageLight = null;
        NotificationSettings.prototype.lowPriorityNotifications = null;
        NotificationSettings.prototype.reactionsMuted = null;
        NotificationSettings.prototype.callVibrate = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationSettings.prototype, "_messageVibrate", {
            get: $util.oneOfGetter($oneOfFields = ["messageVibrate"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationSettings.prototype, "_messagePopup", {
            get: $util.oneOfGetter($oneOfFields = ["messagePopup"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationSettings.prototype, "_messageLight", {
            get: $util.oneOfGetter($oneOfFields = ["messageLight"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationSettings.prototype, "_lowPriorityNotifications", {
            get: $util.oneOfGetter($oneOfFields = ["lowPriorityNotifications"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationSettings.prototype, "_reactionsMuted", {
            get: $util.oneOfGetter($oneOfFields = ["reactionsMuted"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(NotificationSettings.prototype, "_callVibrate", {
            get: $util.oneOfGetter($oneOfFields = ["callVibrate"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        NotificationSettings.create = function create(properties) {
            return new NotificationSettings(properties);
        };

        NotificationSettings.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.messageVibrate != null && Object.hasOwnProperty.call(m, "messageVibrate"))
                w.uint32(10).string(m.messageVibrate);
            if (m.messagePopup != null && Object.hasOwnProperty.call(m, "messagePopup"))
                w.uint32(18).string(m.messagePopup);
            if (m.messageLight != null && Object.hasOwnProperty.call(m, "messageLight"))
                w.uint32(26).string(m.messageLight);
            if (m.lowPriorityNotifications != null && Object.hasOwnProperty.call(m, "lowPriorityNotifications"))
                w.uint32(32).bool(m.lowPriorityNotifications);
            if (m.reactionsMuted != null && Object.hasOwnProperty.call(m, "reactionsMuted"))
                w.uint32(40).bool(m.reactionsMuted);
            if (m.callVibrate != null && Object.hasOwnProperty.call(m, "callVibrate"))
                w.uint32(50).string(m.callVibrate);
            return w;
        };

        NotificationSettings.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NotificationSettings();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.messageVibrate = r.string();
                        break;
                    }
                case 2: {
                        m.messagePopup = r.string();
                        break;
                    }
                case 3: {
                        m.messageLight = r.string();
                        break;
                    }
                case 4: {
                        m.lowPriorityNotifications = r.bool();
                        break;
                    }
                case 5: {
                        m.reactionsMuted = r.bool();
                        break;
                    }
                case 6: {
                        m.callVibrate = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        NotificationSettings.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.NotificationSettings)
                return d;
            var m = new $root.proto.NotificationSettings();
            if (d.messageVibrate != null) {
                m.messageVibrate = String(d.messageVibrate);
            }
            if (d.messagePopup != null) {
                m.messagePopup = String(d.messagePopup);
            }
            if (d.messageLight != null) {
                m.messageLight = String(d.messageLight);
            }
            if (d.lowPriorityNotifications != null) {
                m.lowPriorityNotifications = Boolean(d.lowPriorityNotifications);
            }
            if (d.reactionsMuted != null) {
                m.reactionsMuted = Boolean(d.reactionsMuted);
            }
            if (d.callVibrate != null) {
                m.callVibrate = String(d.callVibrate);
            }
            return m;
        };

        NotificationSettings.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.messageVibrate != null && m.hasOwnProperty("messageVibrate")) {
                d.messageVibrate = m.messageVibrate;
                if (o.oneofs)
                    d._messageVibrate = "messageVibrate";
            }
            if (m.messagePopup != null && m.hasOwnProperty("messagePopup")) {
                d.messagePopup = m.messagePopup;
                if (o.oneofs)
                    d._messagePopup = "messagePopup";
            }
            if (m.messageLight != null && m.hasOwnProperty("messageLight")) {
                d.messageLight = m.messageLight;
                if (o.oneofs)
                    d._messageLight = "messageLight";
            }
            if (m.lowPriorityNotifications != null && m.hasOwnProperty("lowPriorityNotifications")) {
                d.lowPriorityNotifications = m.lowPriorityNotifications;
                if (o.oneofs)
                    d._lowPriorityNotifications = "lowPriorityNotifications";
            }
            if (m.reactionsMuted != null && m.hasOwnProperty("reactionsMuted")) {
                d.reactionsMuted = m.reactionsMuted;
                if (o.oneofs)
                    d._reactionsMuted = "reactionsMuted";
            }
            if (m.callVibrate != null && m.hasOwnProperty("callVibrate")) {
                d.callVibrate = m.callVibrate;
                if (o.oneofs)
                    d._callVibrate = "callVibrate";
            }
            return d;
        };

        NotificationSettings.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        NotificationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.NotificationSettings";
        };

        return NotificationSettings;
    })();

    proto.PairingRequest = (function() {

        function PairingRequest(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PairingRequest.prototype.companionPublicKey = null;
        PairingRequest.prototype.companionIdentityKey = null;
        PairingRequest.prototype.advSecret = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PairingRequest.prototype, "_companionPublicKey", {
            get: $util.oneOfGetter($oneOfFields = ["companionPublicKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PairingRequest.prototype, "_companionIdentityKey", {
            get: $util.oneOfGetter($oneOfFields = ["companionIdentityKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PairingRequest.prototype, "_advSecret", {
            get: $util.oneOfGetter($oneOfFields = ["advSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PairingRequest.create = function create(properties) {
            return new PairingRequest(properties);
        };

        PairingRequest.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.companionPublicKey != null && Object.hasOwnProperty.call(m, "companionPublicKey"))
                w.uint32(10).bytes(m.companionPublicKey);
            if (m.companionIdentityKey != null && Object.hasOwnProperty.call(m, "companionIdentityKey"))
                w.uint32(18).bytes(m.companionIdentityKey);
            if (m.advSecret != null && Object.hasOwnProperty.call(m, "advSecret"))
                w.uint32(26).bytes(m.advSecret);
            return w;
        };

        PairingRequest.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PairingRequest();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.companionPublicKey = r.bytes();
                        break;
                    }
                case 2: {
                        m.companionIdentityKey = r.bytes();
                        break;
                    }
                case 3: {
                        m.advSecret = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PairingRequest.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PairingRequest)
                return d;
            var m = new $root.proto.PairingRequest();
            if (d.companionPublicKey != null) {
                if (typeof d.companionPublicKey === "string")
                    $util.base64.decode(d.companionPublicKey, m.companionPublicKey = $util.newBuffer($util.base64.length(d.companionPublicKey)), 0);
                else if (d.companionPublicKey.length >= 0)
                    m.companionPublicKey = d.companionPublicKey;
            }
            if (d.companionIdentityKey != null) {
                if (typeof d.companionIdentityKey === "string")
                    $util.base64.decode(d.companionIdentityKey, m.companionIdentityKey = $util.newBuffer($util.base64.length(d.companionIdentityKey)), 0);
                else if (d.companionIdentityKey.length >= 0)
                    m.companionIdentityKey = d.companionIdentityKey;
            }
            if (d.advSecret != null) {
                if (typeof d.advSecret === "string")
                    $util.base64.decode(d.advSecret, m.advSecret = $util.newBuffer($util.base64.length(d.advSecret)), 0);
                else if (d.advSecret.length >= 0)
                    m.advSecret = d.advSecret;
            }
            return m;
        };

        PairingRequest.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.companionPublicKey != null && m.hasOwnProperty("companionPublicKey")) {
                d.companionPublicKey = o.bytes === String ? $util.base64.encode(m.companionPublicKey, 0, m.companionPublicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.companionPublicKey) : m.companionPublicKey;
                if (o.oneofs)
                    d._companionPublicKey = "companionPublicKey";
            }
            if (m.companionIdentityKey != null && m.hasOwnProperty("companionIdentityKey")) {
                d.companionIdentityKey = o.bytes === String ? $util.base64.encode(m.companionIdentityKey, 0, m.companionIdentityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.companionIdentityKey) : m.companionIdentityKey;
                if (o.oneofs)
                    d._companionIdentityKey = "companionIdentityKey";
            }
            if (m.advSecret != null && m.hasOwnProperty("advSecret")) {
                d.advSecret = o.bytes === String ? $util.base64.encode(m.advSecret, 0, m.advSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.advSecret) : m.advSecret;
                if (o.oneofs)
                    d._advSecret = "advSecret";
            }
            return d;
        };

        PairingRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PairingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PairingRequest";
        };

        return PairingRequest;
    })();

    proto.PastParticipant = (function() {

        function PastParticipant(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PastParticipant.prototype.userJid = null;
        PastParticipant.prototype.leaveReason = null;
        PastParticipant.prototype.leaveTs = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PastParticipant.prototype, "_userJid", {
            get: $util.oneOfGetter($oneOfFields = ["userJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PastParticipant.prototype, "_leaveReason", {
            get: $util.oneOfGetter($oneOfFields = ["leaveReason"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PastParticipant.prototype, "_leaveTs", {
            get: $util.oneOfGetter($oneOfFields = ["leaveTs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PastParticipant.create = function create(properties) {
            return new PastParticipant(properties);
        };

        PastParticipant.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.userJid != null && Object.hasOwnProperty.call(m, "userJid"))
                w.uint32(10).string(m.userJid);
            if (m.leaveReason != null && Object.hasOwnProperty.call(m, "leaveReason"))
                w.uint32(16).int32(m.leaveReason);
            if (m.leaveTs != null && Object.hasOwnProperty.call(m, "leaveTs"))
                w.uint32(24).uint64(m.leaveTs);
            return w;
        };

        PastParticipant.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PastParticipant();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.userJid = r.string();
                        break;
                    }
                case 2: {
                        m.leaveReason = r.int32();
                        break;
                    }
                case 3: {
                        m.leaveTs = r.uint64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PastParticipant.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PastParticipant)
                return d;
            var m = new $root.proto.PastParticipant();
            if (d.userJid != null) {
                m.userJid = String(d.userJid);
            }
            switch (d.leaveReason) {
            default:
                if (typeof d.leaveReason === "number") {
                    m.leaveReason = d.leaveReason;
                    break;
                }
                break;
            case "LEFT":
            case 0:
                m.leaveReason = 0;
                break;
            case "REMOVED":
            case 1:
                m.leaveReason = 1;
                break;
            }
            if (d.leaveTs != null) {
                if ($util.Long)
                    (m.leaveTs = $util.Long.fromValue(d.leaveTs)).unsigned = true;
                else if (typeof d.leaveTs === "string")
                    m.leaveTs = parseInt(d.leaveTs, 10);
                else if (typeof d.leaveTs === "number")
                    m.leaveTs = d.leaveTs;
                else if (typeof d.leaveTs === "object")
                    m.leaveTs = new $util.LongBits(d.leaveTs.low >>> 0, d.leaveTs.high >>> 0).toNumber(true);
            }
            return m;
        };

        PastParticipant.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.userJid != null && m.hasOwnProperty("userJid")) {
                d.userJid = m.userJid;
                if (o.oneofs)
                    d._userJid = "userJid";
            }
            if (m.leaveReason != null && m.hasOwnProperty("leaveReason")) {
                d.leaveReason = o.enums === String ? $root.proto.PastParticipant.LeaveReason[m.leaveReason] === undefined ? m.leaveReason : $root.proto.PastParticipant.LeaveReason[m.leaveReason] : m.leaveReason;
                if (o.oneofs)
                    d._leaveReason = "leaveReason";
            }
            if (m.leaveTs != null && m.hasOwnProperty("leaveTs")) {
                if (typeof m.leaveTs === "number")
                    d.leaveTs = o.longs === String ? String(m.leaveTs) : m.leaveTs;
                else
                    d.leaveTs = o.longs === String ? longToString(m.leaveTs, true) : o.longs === Number ? longToNumber(m.leaveTs, true) : m.leaveTs;
                if (o.oneofs)
                    d._leaveTs = "leaveTs";
            }
            return d;
        };

        PastParticipant.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PastParticipant.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PastParticipant";
        };

        PastParticipant.LeaveReason = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "LEFT"] = 0;
            values[valuesById[1] = "REMOVED"] = 1;
            return values;
        })();

        return PastParticipant;
    })();

    proto.PastParticipants = (function() {

        function PastParticipants(p) {
            this.pastParticipants = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PastParticipants.prototype.groupJid = null;
        PastParticipants.prototype.pastParticipants = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PastParticipants.prototype, "_groupJid", {
            get: $util.oneOfGetter($oneOfFields = ["groupJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PastParticipants.create = function create(properties) {
            return new PastParticipants(properties);
        };

        PastParticipants.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.groupJid != null && Object.hasOwnProperty.call(m, "groupJid"))
                w.uint32(10).string(m.groupJid);
            if (m.pastParticipants != null && m.pastParticipants.length) {
                for (var i = 0; i < m.pastParticipants.length; ++i)
                    $root.proto.PastParticipant.encode(m.pastParticipants[i], w.uint32(18).fork()).ldelim();
            }
            return w;
        };

        PastParticipants.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PastParticipants();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.groupJid = r.string();
                        break;
                    }
                case 2: {
                        if (!(m.pastParticipants && m.pastParticipants.length))
                            m.pastParticipants = [];
                        m.pastParticipants.push($root.proto.PastParticipant.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PastParticipants.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PastParticipants)
                return d;
            var m = new $root.proto.PastParticipants();
            if (d.groupJid != null) {
                m.groupJid = String(d.groupJid);
            }
            if (d.pastParticipants) {
                if (!Array.isArray(d.pastParticipants))
                    throw TypeError(".proto.PastParticipants.pastParticipants: array expected");
                m.pastParticipants = [];
                for (var i = 0; i < d.pastParticipants.length; ++i) {
                    if (typeof d.pastParticipants[i] !== "object")
                        throw TypeError(".proto.PastParticipants.pastParticipants: object expected");
                    m.pastParticipants[i] = $root.proto.PastParticipant.fromObject(d.pastParticipants[i]);
                }
            }
            return m;
        };

        PastParticipants.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.pastParticipants = [];
            }
            if (m.groupJid != null && m.hasOwnProperty("groupJid")) {
                d.groupJid = m.groupJid;
                if (o.oneofs)
                    d._groupJid = "groupJid";
            }
            if (m.pastParticipants && m.pastParticipants.length) {
                d.pastParticipants = [];
                for (var j = 0; j < m.pastParticipants.length; ++j) {
                    d.pastParticipants[j] = $root.proto.PastParticipant.toObject(m.pastParticipants[j], o);
                }
            }
            return d;
        };

        PastParticipants.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PastParticipants.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PastParticipants";
        };

        return PastParticipants;
    })();

    proto.PatchDebugData = (function() {

        function PatchDebugData(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PatchDebugData.prototype.currentLthash = null;
        PatchDebugData.prototype.newLthash = null;
        PatchDebugData.prototype.patchVersion = null;
        PatchDebugData.prototype.collectionName = null;
        PatchDebugData.prototype.firstFourBytesFromAHashOfSnapshotMacKey = null;
        PatchDebugData.prototype.newLthashSubtract = null;
        PatchDebugData.prototype.numberAdd = null;
        PatchDebugData.prototype.numberRemove = null;
        PatchDebugData.prototype.numberOverride = null;
        PatchDebugData.prototype.senderPlatform = null;
        PatchDebugData.prototype.isSenderPrimary = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_currentLthash", {
            get: $util.oneOfGetter($oneOfFields = ["currentLthash"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_newLthash", {
            get: $util.oneOfGetter($oneOfFields = ["newLthash"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_patchVersion", {
            get: $util.oneOfGetter($oneOfFields = ["patchVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_collectionName", {
            get: $util.oneOfGetter($oneOfFields = ["collectionName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_firstFourBytesFromAHashOfSnapshotMacKey", {
            get: $util.oneOfGetter($oneOfFields = ["firstFourBytesFromAHashOfSnapshotMacKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_newLthashSubtract", {
            get: $util.oneOfGetter($oneOfFields = ["newLthashSubtract"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_numberAdd", {
            get: $util.oneOfGetter($oneOfFields = ["numberAdd"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_numberRemove", {
            get: $util.oneOfGetter($oneOfFields = ["numberRemove"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_numberOverride", {
            get: $util.oneOfGetter($oneOfFields = ["numberOverride"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_senderPlatform", {
            get: $util.oneOfGetter($oneOfFields = ["senderPlatform"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PatchDebugData.prototype, "_isSenderPrimary", {
            get: $util.oneOfGetter($oneOfFields = ["isSenderPrimary"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PatchDebugData.create = function create(properties) {
            return new PatchDebugData(properties);
        };

        PatchDebugData.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.currentLthash != null && Object.hasOwnProperty.call(m, "currentLthash"))
                w.uint32(10).bytes(m.currentLthash);
            if (m.newLthash != null && Object.hasOwnProperty.call(m, "newLthash"))
                w.uint32(18).bytes(m.newLthash);
            if (m.patchVersion != null && Object.hasOwnProperty.call(m, "patchVersion"))
                w.uint32(26).bytes(m.patchVersion);
            if (m.collectionName != null && Object.hasOwnProperty.call(m, "collectionName"))
                w.uint32(34).bytes(m.collectionName);
            if (m.firstFourBytesFromAHashOfSnapshotMacKey != null && Object.hasOwnProperty.call(m, "firstFourBytesFromAHashOfSnapshotMacKey"))
                w.uint32(42).bytes(m.firstFourBytesFromAHashOfSnapshotMacKey);
            if (m.newLthashSubtract != null && Object.hasOwnProperty.call(m, "newLthashSubtract"))
                w.uint32(50).bytes(m.newLthashSubtract);
            if (m.numberAdd != null && Object.hasOwnProperty.call(m, "numberAdd"))
                w.uint32(56).int32(m.numberAdd);
            if (m.numberRemove != null && Object.hasOwnProperty.call(m, "numberRemove"))
                w.uint32(64).int32(m.numberRemove);
            if (m.numberOverride != null && Object.hasOwnProperty.call(m, "numberOverride"))
                w.uint32(72).int32(m.numberOverride);
            if (m.senderPlatform != null && Object.hasOwnProperty.call(m, "senderPlatform"))
                w.uint32(80).int32(m.senderPlatform);
            if (m.isSenderPrimary != null && Object.hasOwnProperty.call(m, "isSenderPrimary"))
                w.uint32(88).bool(m.isSenderPrimary);
            return w;
        };

        PatchDebugData.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PatchDebugData();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.currentLthash = r.bytes();
                        break;
                    }
                case 2: {
                        m.newLthash = r.bytes();
                        break;
                    }
                case 3: {
                        m.patchVersion = r.bytes();
                        break;
                    }
                case 4: {
                        m.collectionName = r.bytes();
                        break;
                    }
                case 5: {
                        m.firstFourBytesFromAHashOfSnapshotMacKey = r.bytes();
                        break;
                    }
                case 6: {
                        m.newLthashSubtract = r.bytes();
                        break;
                    }
                case 7: {
                        m.numberAdd = r.int32();
                        break;
                    }
                case 8: {
                        m.numberRemove = r.int32();
                        break;
                    }
                case 9: {
                        m.numberOverride = r.int32();
                        break;
                    }
                case 10: {
                        m.senderPlatform = r.int32();
                        break;
                    }
                case 11: {
                        m.isSenderPrimary = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PatchDebugData.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PatchDebugData)
                return d;
            var m = new $root.proto.PatchDebugData();
            if (d.currentLthash != null) {
                if (typeof d.currentLthash === "string")
                    $util.base64.decode(d.currentLthash, m.currentLthash = $util.newBuffer($util.base64.length(d.currentLthash)), 0);
                else if (d.currentLthash.length >= 0)
                    m.currentLthash = d.currentLthash;
            }
            if (d.newLthash != null) {
                if (typeof d.newLthash === "string")
                    $util.base64.decode(d.newLthash, m.newLthash = $util.newBuffer($util.base64.length(d.newLthash)), 0);
                else if (d.newLthash.length >= 0)
                    m.newLthash = d.newLthash;
            }
            if (d.patchVersion != null) {
                if (typeof d.patchVersion === "string")
                    $util.base64.decode(d.patchVersion, m.patchVersion = $util.newBuffer($util.base64.length(d.patchVersion)), 0);
                else if (d.patchVersion.length >= 0)
                    m.patchVersion = d.patchVersion;
            }
            if (d.collectionName != null) {
                if (typeof d.collectionName === "string")
                    $util.base64.decode(d.collectionName, m.collectionName = $util.newBuffer($util.base64.length(d.collectionName)), 0);
                else if (d.collectionName.length >= 0)
                    m.collectionName = d.collectionName;
            }
            if (d.firstFourBytesFromAHashOfSnapshotMacKey != null) {
                if (typeof d.firstFourBytesFromAHashOfSnapshotMacKey === "string")
                    $util.base64.decode(d.firstFourBytesFromAHashOfSnapshotMacKey, m.firstFourBytesFromAHashOfSnapshotMacKey = $util.newBuffer($util.base64.length(d.firstFourBytesFromAHashOfSnapshotMacKey)), 0);
                else if (d.firstFourBytesFromAHashOfSnapshotMacKey.length >= 0)
                    m.firstFourBytesFromAHashOfSnapshotMacKey = d.firstFourBytesFromAHashOfSnapshotMacKey;
            }
            if (d.newLthashSubtract != null) {
                if (typeof d.newLthashSubtract === "string")
                    $util.base64.decode(d.newLthashSubtract, m.newLthashSubtract = $util.newBuffer($util.base64.length(d.newLthashSubtract)), 0);
                else if (d.newLthashSubtract.length >= 0)
                    m.newLthashSubtract = d.newLthashSubtract;
            }
            if (d.numberAdd != null) {
                m.numberAdd = d.numberAdd | 0;
            }
            if (d.numberRemove != null) {
                m.numberRemove = d.numberRemove | 0;
            }
            if (d.numberOverride != null) {
                m.numberOverride = d.numberOverride | 0;
            }
            switch (d.senderPlatform) {
            default:
                if (typeof d.senderPlatform === "number") {
                    m.senderPlatform = d.senderPlatform;
                    break;
                }
                break;
            case "ANDROID":
            case 0:
                m.senderPlatform = 0;
                break;
            case "SMBA":
            case 1:
                m.senderPlatform = 1;
                break;
            case "IPHONE":
            case 2:
                m.senderPlatform = 2;
                break;
            case "SMBI":
            case 3:
                m.senderPlatform = 3;
                break;
            case "WEB":
            case 4:
                m.senderPlatform = 4;
                break;
            case "UWP":
            case 5:
                m.senderPlatform = 5;
                break;
            case "DARWIN":
            case 6:
                m.senderPlatform = 6;
                break;
            case "IPAD":
            case 7:
                m.senderPlatform = 7;
                break;
            case "WEAROS":
            case 8:
                m.senderPlatform = 8;
                break;
            case "WASG":
            case 9:
                m.senderPlatform = 9;
                break;
            case "WEARM":
            case 10:
                m.senderPlatform = 10;
                break;
            case "CAPI":
            case 11:
                m.senderPlatform = 11;
                break;
            }
            if (d.isSenderPrimary != null) {
                m.isSenderPrimary = Boolean(d.isSenderPrimary);
            }
            return m;
        };

        PatchDebugData.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.currentLthash != null && m.hasOwnProperty("currentLthash")) {
                d.currentLthash = o.bytes === String ? $util.base64.encode(m.currentLthash, 0, m.currentLthash.length) : o.bytes === Array ? Array.prototype.slice.call(m.currentLthash) : m.currentLthash;
                if (o.oneofs)
                    d._currentLthash = "currentLthash";
            }
            if (m.newLthash != null && m.hasOwnProperty("newLthash")) {
                d.newLthash = o.bytes === String ? $util.base64.encode(m.newLthash, 0, m.newLthash.length) : o.bytes === Array ? Array.prototype.slice.call(m.newLthash) : m.newLthash;
                if (o.oneofs)
                    d._newLthash = "newLthash";
            }
            if (m.patchVersion != null && m.hasOwnProperty("patchVersion")) {
                d.patchVersion = o.bytes === String ? $util.base64.encode(m.patchVersion, 0, m.patchVersion.length) : o.bytes === Array ? Array.prototype.slice.call(m.patchVersion) : m.patchVersion;
                if (o.oneofs)
                    d._patchVersion = "patchVersion";
            }
            if (m.collectionName != null && m.hasOwnProperty("collectionName")) {
                d.collectionName = o.bytes === String ? $util.base64.encode(m.collectionName, 0, m.collectionName.length) : o.bytes === Array ? Array.prototype.slice.call(m.collectionName) : m.collectionName;
                if (o.oneofs)
                    d._collectionName = "collectionName";
            }
            if (m.firstFourBytesFromAHashOfSnapshotMacKey != null && m.hasOwnProperty("firstFourBytesFromAHashOfSnapshotMacKey")) {
                d.firstFourBytesFromAHashOfSnapshotMacKey = o.bytes === String ? $util.base64.encode(m.firstFourBytesFromAHashOfSnapshotMacKey, 0, m.firstFourBytesFromAHashOfSnapshotMacKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.firstFourBytesFromAHashOfSnapshotMacKey) : m.firstFourBytesFromAHashOfSnapshotMacKey;
                if (o.oneofs)
                    d._firstFourBytesFromAHashOfSnapshotMacKey = "firstFourBytesFromAHashOfSnapshotMacKey";
            }
            if (m.newLthashSubtract != null && m.hasOwnProperty("newLthashSubtract")) {
                d.newLthashSubtract = o.bytes === String ? $util.base64.encode(m.newLthashSubtract, 0, m.newLthashSubtract.length) : o.bytes === Array ? Array.prototype.slice.call(m.newLthashSubtract) : m.newLthashSubtract;
                if (o.oneofs)
                    d._newLthashSubtract = "newLthashSubtract";
            }
            if (m.numberAdd != null && m.hasOwnProperty("numberAdd")) {
                d.numberAdd = m.numberAdd;
                if (o.oneofs)
                    d._numberAdd = "numberAdd";
            }
            if (m.numberRemove != null && m.hasOwnProperty("numberRemove")) {
                d.numberRemove = m.numberRemove;
                if (o.oneofs)
                    d._numberRemove = "numberRemove";
            }
            if (m.numberOverride != null && m.hasOwnProperty("numberOverride")) {
                d.numberOverride = m.numberOverride;
                if (o.oneofs)
                    d._numberOverride = "numberOverride";
            }
            if (m.senderPlatform != null && m.hasOwnProperty("senderPlatform")) {
                d.senderPlatform = o.enums === String ? $root.proto.PatchDebugData.Platform[m.senderPlatform] === undefined ? m.senderPlatform : $root.proto.PatchDebugData.Platform[m.senderPlatform] : m.senderPlatform;
                if (o.oneofs)
                    d._senderPlatform = "senderPlatform";
            }
            if (m.isSenderPrimary != null && m.hasOwnProperty("isSenderPrimary")) {
                d.isSenderPrimary = m.isSenderPrimary;
                if (o.oneofs)
                    d._isSenderPrimary = "isSenderPrimary";
            }
            return d;
        };

        PatchDebugData.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PatchDebugData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PatchDebugData";
        };

        PatchDebugData.Platform = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "ANDROID"] = 0;
            values[valuesById[1] = "SMBA"] = 1;
            values[valuesById[2] = "IPHONE"] = 2;
            values[valuesById[3] = "SMBI"] = 3;
            values[valuesById[4] = "WEB"] = 4;
            values[valuesById[5] = "UWP"] = 5;
            values[valuesById[6] = "DARWIN"] = 6;
            values[valuesById[7] = "IPAD"] = 7;
            values[valuesById[8] = "WEAROS"] = 8;
            values[valuesById[9] = "WASG"] = 9;
            values[valuesById[10] = "WEARM"] = 10;
            values[valuesById[11] = "CAPI"] = 11;
            return values;
        })();

        return PatchDebugData;
    })();

    proto.PaymentBackground = (function() {

        function PaymentBackground(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PaymentBackground.prototype.id = null;
        PaymentBackground.prototype.fileLength = null;
        PaymentBackground.prototype.width = null;
        PaymentBackground.prototype.height = null;
        PaymentBackground.prototype.mimetype = null;
        PaymentBackground.prototype.placeholderArgb = null;
        PaymentBackground.prototype.textArgb = null;
        PaymentBackground.prototype.subtextArgb = null;
        PaymentBackground.prototype.mediaData = null;
        PaymentBackground.prototype.type = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_fileLength", {
            get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_width", {
            get: $util.oneOfGetter($oneOfFields = ["width"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_height", {
            get: $util.oneOfGetter($oneOfFields = ["height"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_mimetype", {
            get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_placeholderArgb", {
            get: $util.oneOfGetter($oneOfFields = ["placeholderArgb"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_textArgb", {
            get: $util.oneOfGetter($oneOfFields = ["textArgb"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_subtextArgb", {
            get: $util.oneOfGetter($oneOfFields = ["subtextArgb"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_mediaData", {
            get: $util.oneOfGetter($oneOfFields = ["mediaData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentBackground.prototype, "_type", {
            get: $util.oneOfGetter($oneOfFields = ["type"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PaymentBackground.create = function create(properties) {
            return new PaymentBackground(properties);
        };

        PaymentBackground.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(10).string(m.id);
            if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                w.uint32(16).uint64(m.fileLength);
            if (m.width != null && Object.hasOwnProperty.call(m, "width"))
                w.uint32(24).uint32(m.width);
            if (m.height != null && Object.hasOwnProperty.call(m, "height"))
                w.uint32(32).uint32(m.height);
            if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                w.uint32(42).string(m.mimetype);
            if (m.placeholderArgb != null && Object.hasOwnProperty.call(m, "placeholderArgb"))
                w.uint32(53).fixed32(m.placeholderArgb);
            if (m.textArgb != null && Object.hasOwnProperty.call(m, "textArgb"))
                w.uint32(61).fixed32(m.textArgb);
            if (m.subtextArgb != null && Object.hasOwnProperty.call(m, "subtextArgb"))
                w.uint32(69).fixed32(m.subtextArgb);
            if (m.mediaData != null && Object.hasOwnProperty.call(m, "mediaData"))
                $root.proto.PaymentBackground.MediaData.encode(m.mediaData, w.uint32(74).fork()).ldelim();
            if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                w.uint32(80).int32(m.type);
            return w;
        };

        PaymentBackground.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PaymentBackground();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.string();
                        break;
                    }
                case 2: {
                        m.fileLength = r.uint64();
                        break;
                    }
                case 3: {
                        m.width = r.uint32();
                        break;
                    }
                case 4: {
                        m.height = r.uint32();
                        break;
                    }
                case 5: {
                        m.mimetype = r.string();
                        break;
                    }
                case 6: {
                        m.placeholderArgb = r.fixed32();
                        break;
                    }
                case 7: {
                        m.textArgb = r.fixed32();
                        break;
                    }
                case 8: {
                        m.subtextArgb = r.fixed32();
                        break;
                    }
                case 9: {
                        m.mediaData = $root.proto.PaymentBackground.MediaData.decode(r, r.uint32());
                        break;
                    }
                case 10: {
                        m.type = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PaymentBackground.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PaymentBackground)
                return d;
            var m = new $root.proto.PaymentBackground();
            if (d.id != null) {
                m.id = String(d.id);
            }
            if (d.fileLength != null) {
                if ($util.Long)
                    (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                else if (typeof d.fileLength === "string")
                    m.fileLength = parseInt(d.fileLength, 10);
                else if (typeof d.fileLength === "number")
                    m.fileLength = d.fileLength;
                else if (typeof d.fileLength === "object")
                    m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
            }
            if (d.width != null) {
                m.width = d.width >>> 0;
            }
            if (d.height != null) {
                m.height = d.height >>> 0;
            }
            if (d.mimetype != null) {
                m.mimetype = String(d.mimetype);
            }
            if (d.placeholderArgb != null) {
                m.placeholderArgb = d.placeholderArgb >>> 0;
            }
            if (d.textArgb != null) {
                m.textArgb = d.textArgb >>> 0;
            }
            if (d.subtextArgb != null) {
                m.subtextArgb = d.subtextArgb >>> 0;
            }
            if (d.mediaData != null) {
                if (typeof d.mediaData !== "object")
                    throw TypeError(".proto.PaymentBackground.mediaData: object expected");
                m.mediaData = $root.proto.PaymentBackground.MediaData.fromObject(d.mediaData);
            }
            switch (d.type) {
            default:
                if (typeof d.type === "number") {
                    m.type = d.type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.type = 0;
                break;
            case "DEFAULT":
            case 1:
                m.type = 1;
                break;
            }
            return m;
        };

        PaymentBackground.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                if (typeof m.fileLength === "number")
                    d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                else
                    d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                if (o.oneofs)
                    d._fileLength = "fileLength";
            }
            if (m.width != null && m.hasOwnProperty("width")) {
                d.width = m.width;
                if (o.oneofs)
                    d._width = "width";
            }
            if (m.height != null && m.hasOwnProperty("height")) {
                d.height = m.height;
                if (o.oneofs)
                    d._height = "height";
            }
            if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                d.mimetype = m.mimetype;
                if (o.oneofs)
                    d._mimetype = "mimetype";
            }
            if (m.placeholderArgb != null && m.hasOwnProperty("placeholderArgb")) {
                d.placeholderArgb = m.placeholderArgb;
                if (o.oneofs)
                    d._placeholderArgb = "placeholderArgb";
            }
            if (m.textArgb != null && m.hasOwnProperty("textArgb")) {
                d.textArgb = m.textArgb;
                if (o.oneofs)
                    d._textArgb = "textArgb";
            }
            if (m.subtextArgb != null && m.hasOwnProperty("subtextArgb")) {
                d.subtextArgb = m.subtextArgb;
                if (o.oneofs)
                    d._subtextArgb = "subtextArgb";
            }
            if (m.mediaData != null && m.hasOwnProperty("mediaData")) {
                d.mediaData = $root.proto.PaymentBackground.MediaData.toObject(m.mediaData, o);
                if (o.oneofs)
                    d._mediaData = "mediaData";
            }
            if (m.type != null && m.hasOwnProperty("type")) {
                d.type = o.enums === String ? $root.proto.PaymentBackground.Type[m.type] === undefined ? m.type : $root.proto.PaymentBackground.Type[m.type] : m.type;
                if (o.oneofs)
                    d._type = "type";
            }
            return d;
        };

        PaymentBackground.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PaymentBackground.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PaymentBackground";
        };

        PaymentBackground.MediaData = (function() {

            function MediaData(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MediaData.prototype.mediaKey = null;
            MediaData.prototype.mediaKeyTimestamp = null;
            MediaData.prototype.fileSha256 = null;
            MediaData.prototype.fileEncSha256 = null;
            MediaData.prototype.directPath = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MediaData.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MediaData.prototype, "_mediaKeyTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MediaData.prototype, "_fileSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MediaData.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MediaData.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MediaData.create = function create(properties) {
                return new MediaData(properties);
            };

            MediaData.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(10).bytes(m.mediaKey);
                if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
                    w.uint32(16).int64(m.mediaKeyTimestamp);
                if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                    w.uint32(26).bytes(m.fileSha256);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(34).bytes(m.fileEncSha256);
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(42).string(m.directPath);
                return w;
            };

            MediaData.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PaymentBackground.MediaData();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 2: {
                            m.mediaKeyTimestamp = r.int64();
                            break;
                        }
                    case 3: {
                            m.fileSha256 = r.bytes();
                            break;
                        }
                    case 4: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 5: {
                            m.directPath = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MediaData.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.PaymentBackground.MediaData)
                    return d;
                var m = new $root.proto.PaymentBackground.MediaData();
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.mediaKeyTimestamp != null) {
                    if ($util.Long)
                        (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
                    else if (typeof d.mediaKeyTimestamp === "string")
                        m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
                    else if (typeof d.mediaKeyTimestamp === "number")
                        m.mediaKeyTimestamp = d.mediaKeyTimestamp;
                    else if (typeof d.mediaKeyTimestamp === "object")
                        m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
                }
                if (d.fileSha256 != null) {
                    if (typeof d.fileSha256 === "string")
                        $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                    else if (d.fileSha256.length >= 0)
                        m.fileSha256 = d.fileSha256;
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                return m;
            };

            MediaData.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
                    if (typeof m.mediaKeyTimestamp === "number")
                        d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    else
                        d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
                    if (o.oneofs)
                        d._mediaKeyTimestamp = "mediaKeyTimestamp";
                }
                if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                    d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                    if (o.oneofs)
                        d._fileSha256 = "fileSha256";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                return d;
            };

            MediaData.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MediaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.PaymentBackground.MediaData";
            };

            return MediaData;
        })();

        PaymentBackground.Type = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "DEFAULT"] = 1;
            return values;
        })();

        return PaymentBackground;
    })();

    proto.PaymentInfo = (function() {

        function PaymentInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PaymentInfo.prototype.currencyDeprecated = null;
        PaymentInfo.prototype.amount1000 = null;
        PaymentInfo.prototype.receiverJid = null;
        PaymentInfo.prototype.status = null;
        PaymentInfo.prototype.transactionTimestamp = null;
        PaymentInfo.prototype.requestMessageKey = null;
        PaymentInfo.prototype.expiryTimestamp = null;
        PaymentInfo.prototype.futureproofed = null;
        PaymentInfo.prototype.currency = null;
        PaymentInfo.prototype.txnStatus = null;
        PaymentInfo.prototype.useNoviFiatFormat = null;
        PaymentInfo.prototype.primaryAmount = null;
        PaymentInfo.prototype.exchangeAmount = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_currencyDeprecated", {
            get: $util.oneOfGetter($oneOfFields = ["currencyDeprecated"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_amount1000", {
            get: $util.oneOfGetter($oneOfFields = ["amount1000"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_receiverJid", {
            get: $util.oneOfGetter($oneOfFields = ["receiverJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_status", {
            get: $util.oneOfGetter($oneOfFields = ["status"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_transactionTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["transactionTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_requestMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["requestMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_expiryTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["expiryTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_futureproofed", {
            get: $util.oneOfGetter($oneOfFields = ["futureproofed"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_currency", {
            get: $util.oneOfGetter($oneOfFields = ["currency"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_txnStatus", {
            get: $util.oneOfGetter($oneOfFields = ["txnStatus"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_useNoviFiatFormat", {
            get: $util.oneOfGetter($oneOfFields = ["useNoviFiatFormat"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_primaryAmount", {
            get: $util.oneOfGetter($oneOfFields = ["primaryAmount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PaymentInfo.prototype, "_exchangeAmount", {
            get: $util.oneOfGetter($oneOfFields = ["exchangeAmount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PaymentInfo.create = function create(properties) {
            return new PaymentInfo(properties);
        };

        PaymentInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.currencyDeprecated != null && Object.hasOwnProperty.call(m, "currencyDeprecated"))
                w.uint32(8).int32(m.currencyDeprecated);
            if (m.amount1000 != null && Object.hasOwnProperty.call(m, "amount1000"))
                w.uint32(16).uint64(m.amount1000);
            if (m.receiverJid != null && Object.hasOwnProperty.call(m, "receiverJid"))
                w.uint32(26).string(m.receiverJid);
            if (m.status != null && Object.hasOwnProperty.call(m, "status"))
                w.uint32(32).int32(m.status);
            if (m.transactionTimestamp != null && Object.hasOwnProperty.call(m, "transactionTimestamp"))
                w.uint32(40).uint64(m.transactionTimestamp);
            if (m.requestMessageKey != null && Object.hasOwnProperty.call(m, "requestMessageKey"))
                $root.proto.MessageKey.encode(m.requestMessageKey, w.uint32(50).fork()).ldelim();
            if (m.expiryTimestamp != null && Object.hasOwnProperty.call(m, "expiryTimestamp"))
                w.uint32(56).uint64(m.expiryTimestamp);
            if (m.futureproofed != null && Object.hasOwnProperty.call(m, "futureproofed"))
                w.uint32(64).bool(m.futureproofed);
            if (m.currency != null && Object.hasOwnProperty.call(m, "currency"))
                w.uint32(74).string(m.currency);
            if (m.txnStatus != null && Object.hasOwnProperty.call(m, "txnStatus"))
                w.uint32(80).int32(m.txnStatus);
            if (m.useNoviFiatFormat != null && Object.hasOwnProperty.call(m, "useNoviFiatFormat"))
                w.uint32(88).bool(m.useNoviFiatFormat);
            if (m.primaryAmount != null && Object.hasOwnProperty.call(m, "primaryAmount"))
                $root.proto.Money.encode(m.primaryAmount, w.uint32(98).fork()).ldelim();
            if (m.exchangeAmount != null && Object.hasOwnProperty.call(m, "exchangeAmount"))
                $root.proto.Money.encode(m.exchangeAmount, w.uint32(106).fork()).ldelim();
            return w;
        };

        PaymentInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PaymentInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.currencyDeprecated = r.int32();
                        break;
                    }
                case 2: {
                        m.amount1000 = r.uint64();
                        break;
                    }
                case 3: {
                        m.receiverJid = r.string();
                        break;
                    }
                case 4: {
                        m.status = r.int32();
                        break;
                    }
                case 5: {
                        m.transactionTimestamp = r.uint64();
                        break;
                    }
                case 6: {
                        m.requestMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.expiryTimestamp = r.uint64();
                        break;
                    }
                case 8: {
                        m.futureproofed = r.bool();
                        break;
                    }
                case 9: {
                        m.currency = r.string();
                        break;
                    }
                case 10: {
                        m.txnStatus = r.int32();
                        break;
                    }
                case 11: {
                        m.useNoviFiatFormat = r.bool();
                        break;
                    }
                case 12: {
                        m.primaryAmount = $root.proto.Money.decode(r, r.uint32());
                        break;
                    }
                case 13: {
                        m.exchangeAmount = $root.proto.Money.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PaymentInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PaymentInfo)
                return d;
            var m = new $root.proto.PaymentInfo();
            switch (d.currencyDeprecated) {
            default:
                if (typeof d.currencyDeprecated === "number") {
                    m.currencyDeprecated = d.currencyDeprecated;
                    break;
                }
                break;
            case "UNKNOWN_CURRENCY":
            case 0:
                m.currencyDeprecated = 0;
                break;
            case "INR":
            case 1:
                m.currencyDeprecated = 1;
                break;
            }
            if (d.amount1000 != null) {
                if ($util.Long)
                    (m.amount1000 = $util.Long.fromValue(d.amount1000)).unsigned = true;
                else if (typeof d.amount1000 === "string")
                    m.amount1000 = parseInt(d.amount1000, 10);
                else if (typeof d.amount1000 === "number")
                    m.amount1000 = d.amount1000;
                else if (typeof d.amount1000 === "object")
                    m.amount1000 = new $util.LongBits(d.amount1000.low >>> 0, d.amount1000.high >>> 0).toNumber(true);
            }
            if (d.receiverJid != null) {
                m.receiverJid = String(d.receiverJid);
            }
            switch (d.status) {
            default:
                if (typeof d.status === "number") {
                    m.status = d.status;
                    break;
                }
                break;
            case "UNKNOWN_STATUS":
            case 0:
                m.status = 0;
                break;
            case "PROCESSING":
            case 1:
                m.status = 1;
                break;
            case "SENT":
            case 2:
                m.status = 2;
                break;
            case "NEED_TO_ACCEPT":
            case 3:
                m.status = 3;
                break;
            case "COMPLETE":
            case 4:
                m.status = 4;
                break;
            case "COULD_NOT_COMPLETE":
            case 5:
                m.status = 5;
                break;
            case "REFUNDED":
            case 6:
                m.status = 6;
                break;
            case "EXPIRED":
            case 7:
                m.status = 7;
                break;
            case "REJECTED":
            case 8:
                m.status = 8;
                break;
            case "CANCELLED":
            case 9:
                m.status = 9;
                break;
            case "WAITING_FOR_PAYER":
            case 10:
                m.status = 10;
                break;
            case "WAITING":
            case 11:
                m.status = 11;
                break;
            }
            if (d.transactionTimestamp != null) {
                if ($util.Long)
                    (m.transactionTimestamp = $util.Long.fromValue(d.transactionTimestamp)).unsigned = true;
                else if (typeof d.transactionTimestamp === "string")
                    m.transactionTimestamp = parseInt(d.transactionTimestamp, 10);
                else if (typeof d.transactionTimestamp === "number")
                    m.transactionTimestamp = d.transactionTimestamp;
                else if (typeof d.transactionTimestamp === "object")
                    m.transactionTimestamp = new $util.LongBits(d.transactionTimestamp.low >>> 0, d.transactionTimestamp.high >>> 0).toNumber(true);
            }
            if (d.requestMessageKey != null) {
                if (typeof d.requestMessageKey !== "object")
                    throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected");
                m.requestMessageKey = $root.proto.MessageKey.fromObject(d.requestMessageKey);
            }
            if (d.expiryTimestamp != null) {
                if ($util.Long)
                    (m.expiryTimestamp = $util.Long.fromValue(d.expiryTimestamp)).unsigned = true;
                else if (typeof d.expiryTimestamp === "string")
                    m.expiryTimestamp = parseInt(d.expiryTimestamp, 10);
                else if (typeof d.expiryTimestamp === "number")
                    m.expiryTimestamp = d.expiryTimestamp;
                else if (typeof d.expiryTimestamp === "object")
                    m.expiryTimestamp = new $util.LongBits(d.expiryTimestamp.low >>> 0, d.expiryTimestamp.high >>> 0).toNumber(true);
            }
            if (d.futureproofed != null) {
                m.futureproofed = Boolean(d.futureproofed);
            }
            if (d.currency != null) {
                m.currency = String(d.currency);
            }
            switch (d.txnStatus) {
            default:
                if (typeof d.txnStatus === "number") {
                    m.txnStatus = d.txnStatus;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.txnStatus = 0;
                break;
            case "PENDING_SETUP":
            case 1:
                m.txnStatus = 1;
                break;
            case "PENDING_RECEIVER_SETUP":
            case 2:
                m.txnStatus = 2;
                break;
            case "INIT":
            case 3:
                m.txnStatus = 3;
                break;
            case "SUCCESS":
            case 4:
                m.txnStatus = 4;
                break;
            case "COMPLETED":
            case 5:
                m.txnStatus = 5;
                break;
            case "FAILED":
            case 6:
                m.txnStatus = 6;
                break;
            case "FAILED_RISK":
            case 7:
                m.txnStatus = 7;
                break;
            case "FAILED_PROCESSING":
            case 8:
                m.txnStatus = 8;
                break;
            case "FAILED_RECEIVER_PROCESSING":
            case 9:
                m.txnStatus = 9;
                break;
            case "FAILED_DA":
            case 10:
                m.txnStatus = 10;
                break;
            case "FAILED_DA_FINAL":
            case 11:
                m.txnStatus = 11;
                break;
            case "REFUNDED_TXN":
            case 12:
                m.txnStatus = 12;
                break;
            case "REFUND_FAILED":
            case 13:
                m.txnStatus = 13;
                break;
            case "REFUND_FAILED_PROCESSING":
            case 14:
                m.txnStatus = 14;
                break;
            case "REFUND_FAILED_DA":
            case 15:
                m.txnStatus = 15;
                break;
            case "EXPIRED_TXN":
            case 16:
                m.txnStatus = 16;
                break;
            case "AUTH_CANCELED":
            case 17:
                m.txnStatus = 17;
                break;
            case "AUTH_CANCEL_FAILED_PROCESSING":
            case 18:
                m.txnStatus = 18;
                break;
            case "AUTH_CANCEL_FAILED":
            case 19:
                m.txnStatus = 19;
                break;
            case "COLLECT_INIT":
            case 20:
                m.txnStatus = 20;
                break;
            case "COLLECT_SUCCESS":
            case 21:
                m.txnStatus = 21;
                break;
            case "COLLECT_FAILED":
            case 22:
                m.txnStatus = 22;
                break;
            case "COLLECT_FAILED_RISK":
            case 23:
                m.txnStatus = 23;
                break;
            case "COLLECT_REJECTED":
            case 24:
                m.txnStatus = 24;
                break;
            case "COLLECT_EXPIRED":
            case 25:
                m.txnStatus = 25;
                break;
            case "COLLECT_CANCELED":
            case 26:
                m.txnStatus = 26;
                break;
            case "COLLECT_CANCELLING":
            case 27:
                m.txnStatus = 27;
                break;
            case "IN_REVIEW":
            case 28:
                m.txnStatus = 28;
                break;
            case "REVERSAL_SUCCESS":
            case 29:
                m.txnStatus = 29;
                break;
            case "REVERSAL_PENDING":
            case 30:
                m.txnStatus = 30;
                break;
            case "REFUND_PENDING":
            case 31:
                m.txnStatus = 31;
                break;
            }
            if (d.useNoviFiatFormat != null) {
                m.useNoviFiatFormat = Boolean(d.useNoviFiatFormat);
            }
            if (d.primaryAmount != null) {
                if (typeof d.primaryAmount !== "object")
                    throw TypeError(".proto.PaymentInfo.primaryAmount: object expected");
                m.primaryAmount = $root.proto.Money.fromObject(d.primaryAmount);
            }
            if (d.exchangeAmount != null) {
                if (typeof d.exchangeAmount !== "object")
                    throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected");
                m.exchangeAmount = $root.proto.Money.fromObject(d.exchangeAmount);
            }
            return m;
        };

        PaymentInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.currencyDeprecated != null && m.hasOwnProperty("currencyDeprecated")) {
                d.currencyDeprecated = o.enums === String ? $root.proto.PaymentInfo.Currency[m.currencyDeprecated] === undefined ? m.currencyDeprecated : $root.proto.PaymentInfo.Currency[m.currencyDeprecated] : m.currencyDeprecated;
                if (o.oneofs)
                    d._currencyDeprecated = "currencyDeprecated";
            }
            if (m.amount1000 != null && m.hasOwnProperty("amount1000")) {
                if (typeof m.amount1000 === "number")
                    d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000;
                else
                    d.amount1000 = o.longs === String ? longToString(m.amount1000, true) : o.longs === Number ? longToNumber(m.amount1000, true) : m.amount1000;
                if (o.oneofs)
                    d._amount1000 = "amount1000";
            }
            if (m.receiverJid != null && m.hasOwnProperty("receiverJid")) {
                d.receiverJid = m.receiverJid;
                if (o.oneofs)
                    d._receiverJid = "receiverJid";
            }
            if (m.status != null && m.hasOwnProperty("status")) {
                d.status = o.enums === String ? $root.proto.PaymentInfo.Status[m.status] === undefined ? m.status : $root.proto.PaymentInfo.Status[m.status] : m.status;
                if (o.oneofs)
                    d._status = "status";
            }
            if (m.transactionTimestamp != null && m.hasOwnProperty("transactionTimestamp")) {
                if (typeof m.transactionTimestamp === "number")
                    d.transactionTimestamp = o.longs === String ? String(m.transactionTimestamp) : m.transactionTimestamp;
                else
                    d.transactionTimestamp = o.longs === String ? longToString(m.transactionTimestamp, true) : o.longs === Number ? longToNumber(m.transactionTimestamp, true) : m.transactionTimestamp;
                if (o.oneofs)
                    d._transactionTimestamp = "transactionTimestamp";
            }
            if (m.requestMessageKey != null && m.hasOwnProperty("requestMessageKey")) {
                d.requestMessageKey = $root.proto.MessageKey.toObject(m.requestMessageKey, o);
                if (o.oneofs)
                    d._requestMessageKey = "requestMessageKey";
            }
            if (m.expiryTimestamp != null && m.hasOwnProperty("expiryTimestamp")) {
                if (typeof m.expiryTimestamp === "number")
                    d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp;
                else
                    d.expiryTimestamp = o.longs === String ? longToString(m.expiryTimestamp, true) : o.longs === Number ? longToNumber(m.expiryTimestamp, true) : m.expiryTimestamp;
                if (o.oneofs)
                    d._expiryTimestamp = "expiryTimestamp";
            }
            if (m.futureproofed != null && m.hasOwnProperty("futureproofed")) {
                d.futureproofed = m.futureproofed;
                if (o.oneofs)
                    d._futureproofed = "futureproofed";
            }
            if (m.currency != null && m.hasOwnProperty("currency")) {
                d.currency = m.currency;
                if (o.oneofs)
                    d._currency = "currency";
            }
            if (m.txnStatus != null && m.hasOwnProperty("txnStatus")) {
                d.txnStatus = o.enums === String ? $root.proto.PaymentInfo.TxnStatus[m.txnStatus] === undefined ? m.txnStatus : $root.proto.PaymentInfo.TxnStatus[m.txnStatus] : m.txnStatus;
                if (o.oneofs)
                    d._txnStatus = "txnStatus";
            }
            if (m.useNoviFiatFormat != null && m.hasOwnProperty("useNoviFiatFormat")) {
                d.useNoviFiatFormat = m.useNoviFiatFormat;
                if (o.oneofs)
                    d._useNoviFiatFormat = "useNoviFiatFormat";
            }
            if (m.primaryAmount != null && m.hasOwnProperty("primaryAmount")) {
                d.primaryAmount = $root.proto.Money.toObject(m.primaryAmount, o);
                if (o.oneofs)
                    d._primaryAmount = "primaryAmount";
            }
            if (m.exchangeAmount != null && m.hasOwnProperty("exchangeAmount")) {
                d.exchangeAmount = $root.proto.Money.toObject(m.exchangeAmount, o);
                if (o.oneofs)
                    d._exchangeAmount = "exchangeAmount";
            }
            return d;
        };

        PaymentInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PaymentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PaymentInfo";
        };

        PaymentInfo.Currency = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_CURRENCY"] = 0;
            values[valuesById[1] = "INR"] = 1;
            return values;
        })();

        PaymentInfo.Status = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_STATUS"] = 0;
            values[valuesById[1] = "PROCESSING"] = 1;
            values[valuesById[2] = "SENT"] = 2;
            values[valuesById[3] = "NEED_TO_ACCEPT"] = 3;
            values[valuesById[4] = "COMPLETE"] = 4;
            values[valuesById[5] = "COULD_NOT_COMPLETE"] = 5;
            values[valuesById[6] = "REFUNDED"] = 6;
            values[valuesById[7] = "EXPIRED"] = 7;
            values[valuesById[8] = "REJECTED"] = 8;
            values[valuesById[9] = "CANCELLED"] = 9;
            values[valuesById[10] = "WAITING_FOR_PAYER"] = 10;
            values[valuesById[11] = "WAITING"] = 11;
            return values;
        })();

        PaymentInfo.TxnStatus = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "PENDING_SETUP"] = 1;
            values[valuesById[2] = "PENDING_RECEIVER_SETUP"] = 2;
            values[valuesById[3] = "INIT"] = 3;
            values[valuesById[4] = "SUCCESS"] = 4;
            values[valuesById[5] = "COMPLETED"] = 5;
            values[valuesById[6] = "FAILED"] = 6;
            values[valuesById[7] = "FAILED_RISK"] = 7;
            values[valuesById[8] = "FAILED_PROCESSING"] = 8;
            values[valuesById[9] = "FAILED_RECEIVER_PROCESSING"] = 9;
            values[valuesById[10] = "FAILED_DA"] = 10;
            values[valuesById[11] = "FAILED_DA_FINAL"] = 11;
            values[valuesById[12] = "REFUNDED_TXN"] = 12;
            values[valuesById[13] = "REFUND_FAILED"] = 13;
            values[valuesById[14] = "REFUND_FAILED_PROCESSING"] = 14;
            values[valuesById[15] = "REFUND_FAILED_DA"] = 15;
            values[valuesById[16] = "EXPIRED_TXN"] = 16;
            values[valuesById[17] = "AUTH_CANCELED"] = 17;
            values[valuesById[18] = "AUTH_CANCEL_FAILED_PROCESSING"] = 18;
            values[valuesById[19] = "AUTH_CANCEL_FAILED"] = 19;
            values[valuesById[20] = "COLLECT_INIT"] = 20;
            values[valuesById[21] = "COLLECT_SUCCESS"] = 21;
            values[valuesById[22] = "COLLECT_FAILED"] = 22;
            values[valuesById[23] = "COLLECT_FAILED_RISK"] = 23;
            values[valuesById[24] = "COLLECT_REJECTED"] = 24;
            values[valuesById[25] = "COLLECT_EXPIRED"] = 25;
            values[valuesById[26] = "COLLECT_CANCELED"] = 26;
            values[valuesById[27] = "COLLECT_CANCELLING"] = 27;
            values[valuesById[28] = "IN_REVIEW"] = 28;
            values[valuesById[29] = "REVERSAL_SUCCESS"] = 29;
            values[valuesById[30] = "REVERSAL_PENDING"] = 30;
            values[valuesById[31] = "REFUND_PENDING"] = 31;
            return values;
        })();

        return PaymentInfo;
    })();

    proto.PhoneNumberToLIDMapping = (function() {

        function PhoneNumberToLIDMapping(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PhoneNumberToLIDMapping.prototype.pnJid = null;
        PhoneNumberToLIDMapping.prototype.lidJid = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PhoneNumberToLIDMapping.prototype, "_pnJid", {
            get: $util.oneOfGetter($oneOfFields = ["pnJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PhoneNumberToLIDMapping.prototype, "_lidJid", {
            get: $util.oneOfGetter($oneOfFields = ["lidJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PhoneNumberToLIDMapping.create = function create(properties) {
            return new PhoneNumberToLIDMapping(properties);
        };

        PhoneNumberToLIDMapping.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.pnJid != null && Object.hasOwnProperty.call(m, "pnJid"))
                w.uint32(10).string(m.pnJid);
            if (m.lidJid != null && Object.hasOwnProperty.call(m, "lidJid"))
                w.uint32(18).string(m.lidJid);
            return w;
        };

        PhoneNumberToLIDMapping.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PhoneNumberToLIDMapping();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.pnJid = r.string();
                        break;
                    }
                case 2: {
                        m.lidJid = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PhoneNumberToLIDMapping.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PhoneNumberToLIDMapping)
                return d;
            var m = new $root.proto.PhoneNumberToLIDMapping();
            if (d.pnJid != null) {
                m.pnJid = String(d.pnJid);
            }
            if (d.lidJid != null) {
                m.lidJid = String(d.lidJid);
            }
            return m;
        };

        PhoneNumberToLIDMapping.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.pnJid != null && m.hasOwnProperty("pnJid")) {
                d.pnJid = m.pnJid;
                if (o.oneofs)
                    d._pnJid = "pnJid";
            }
            if (m.lidJid != null && m.hasOwnProperty("lidJid")) {
                d.lidJid = m.lidJid;
                if (o.oneofs)
                    d._lidJid = "lidJid";
            }
            return d;
        };

        PhoneNumberToLIDMapping.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PhoneNumberToLIDMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PhoneNumberToLIDMapping";
        };

        return PhoneNumberToLIDMapping;
    })();

    proto.PhotoChange = (function() {

        function PhotoChange(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PhotoChange.prototype.oldPhoto = null;
        PhotoChange.prototype.newPhoto = null;
        PhotoChange.prototype.newPhotoId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PhotoChange.prototype, "_oldPhoto", {
            get: $util.oneOfGetter($oneOfFields = ["oldPhoto"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PhotoChange.prototype, "_newPhoto", {
            get: $util.oneOfGetter($oneOfFields = ["newPhoto"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PhotoChange.prototype, "_newPhotoId", {
            get: $util.oneOfGetter($oneOfFields = ["newPhotoId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PhotoChange.create = function create(properties) {
            return new PhotoChange(properties);
        };

        PhotoChange.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.oldPhoto != null && Object.hasOwnProperty.call(m, "oldPhoto"))
                w.uint32(10).bytes(m.oldPhoto);
            if (m.newPhoto != null && Object.hasOwnProperty.call(m, "newPhoto"))
                w.uint32(18).bytes(m.newPhoto);
            if (m.newPhotoId != null && Object.hasOwnProperty.call(m, "newPhotoId"))
                w.uint32(24).uint32(m.newPhotoId);
            return w;
        };

        PhotoChange.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PhotoChange();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.oldPhoto = r.bytes();
                        break;
                    }
                case 2: {
                        m.newPhoto = r.bytes();
                        break;
                    }
                case 3: {
                        m.newPhotoId = r.uint32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PhotoChange.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PhotoChange)
                return d;
            var m = new $root.proto.PhotoChange();
            if (d.oldPhoto != null) {
                if (typeof d.oldPhoto === "string")
                    $util.base64.decode(d.oldPhoto, m.oldPhoto = $util.newBuffer($util.base64.length(d.oldPhoto)), 0);
                else if (d.oldPhoto.length >= 0)
                    m.oldPhoto = d.oldPhoto;
            }
            if (d.newPhoto != null) {
                if (typeof d.newPhoto === "string")
                    $util.base64.decode(d.newPhoto, m.newPhoto = $util.newBuffer($util.base64.length(d.newPhoto)), 0);
                else if (d.newPhoto.length >= 0)
                    m.newPhoto = d.newPhoto;
            }
            if (d.newPhotoId != null) {
                m.newPhotoId = d.newPhotoId >>> 0;
            }
            return m;
        };

        PhotoChange.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.oldPhoto != null && m.hasOwnProperty("oldPhoto")) {
                d.oldPhoto = o.bytes === String ? $util.base64.encode(m.oldPhoto, 0, m.oldPhoto.length) : o.bytes === Array ? Array.prototype.slice.call(m.oldPhoto) : m.oldPhoto;
                if (o.oneofs)
                    d._oldPhoto = "oldPhoto";
            }
            if (m.newPhoto != null && m.hasOwnProperty("newPhoto")) {
                d.newPhoto = o.bytes === String ? $util.base64.encode(m.newPhoto, 0, m.newPhoto.length) : o.bytes === Array ? Array.prototype.slice.call(m.newPhoto) : m.newPhoto;
                if (o.oneofs)
                    d._newPhoto = "newPhoto";
            }
            if (m.newPhotoId != null && m.hasOwnProperty("newPhotoId")) {
                d.newPhotoId = m.newPhotoId;
                if (o.oneofs)
                    d._newPhotoId = "newPhotoId";
            }
            return d;
        };

        PhotoChange.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PhotoChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PhotoChange";
        };

        return PhotoChange;
    })();

    proto.PinInChat = (function() {

        function PinInChat(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PinInChat.prototype.type = null;
        PinInChat.prototype.key = null;
        PinInChat.prototype.senderTimestampMs = null;
        PinInChat.prototype.serverTimestampMs = null;
        PinInChat.prototype.messageAddOnContextInfo = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PinInChat.prototype, "_type", {
            get: $util.oneOfGetter($oneOfFields = ["type"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PinInChat.prototype, "_key", {
            get: $util.oneOfGetter($oneOfFields = ["key"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PinInChat.prototype, "_senderTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PinInChat.prototype, "_serverTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PinInChat.prototype, "_messageAddOnContextInfo", {
            get: $util.oneOfGetter($oneOfFields = ["messageAddOnContextInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PinInChat.create = function create(properties) {
            return new PinInChat(properties);
        };

        PinInChat.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                w.uint32(8).int32(m.type);
            if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                $root.proto.MessageKey.encode(m.key, w.uint32(18).fork()).ldelim();
            if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
                w.uint32(24).int64(m.senderTimestampMs);
            if (m.serverTimestampMs != null && Object.hasOwnProperty.call(m, "serverTimestampMs"))
                w.uint32(32).int64(m.serverTimestampMs);
            if (m.messageAddOnContextInfo != null && Object.hasOwnProperty.call(m, "messageAddOnContextInfo"))
                $root.proto.MessageAddOnContextInfo.encode(m.messageAddOnContextInfo, w.uint32(42).fork()).ldelim();
            return w;
        };

        PinInChat.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PinInChat();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.type = r.int32();
                        break;
                    }
                case 2: {
                        m.key = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.senderTimestampMs = r.int64();
                        break;
                    }
                case 4: {
                        m.serverTimestampMs = r.int64();
                        break;
                    }
                case 5: {
                        m.messageAddOnContextInfo = $root.proto.MessageAddOnContextInfo.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PinInChat.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PinInChat)
                return d;
            var m = new $root.proto.PinInChat();
            switch (d.type) {
            default:
                if (typeof d.type === "number") {
                    m.type = d.type;
                    break;
                }
                break;
            case "UNKNOWN_TYPE":
            case 0:
                m.type = 0;
                break;
            case "PIN_FOR_ALL":
            case 1:
                m.type = 1;
                break;
            case "UNPIN_FOR_ALL":
            case 2:
                m.type = 2;
                break;
            }
            if (d.key != null) {
                if (typeof d.key !== "object")
                    throw TypeError(".proto.PinInChat.key: object expected");
                m.key = $root.proto.MessageKey.fromObject(d.key);
            }
            if (d.senderTimestampMs != null) {
                if ($util.Long)
                    (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
                else if (typeof d.senderTimestampMs === "string")
                    m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
                else if (typeof d.senderTimestampMs === "number")
                    m.senderTimestampMs = d.senderTimestampMs;
                else if (typeof d.senderTimestampMs === "object")
                    m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
            }
            if (d.serverTimestampMs != null) {
                if ($util.Long)
                    (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false;
                else if (typeof d.serverTimestampMs === "string")
                    m.serverTimestampMs = parseInt(d.serverTimestampMs, 10);
                else if (typeof d.serverTimestampMs === "number")
                    m.serverTimestampMs = d.serverTimestampMs;
                else if (typeof d.serverTimestampMs === "object")
                    m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber();
            }
            if (d.messageAddOnContextInfo != null) {
                if (typeof d.messageAddOnContextInfo !== "object")
                    throw TypeError(".proto.PinInChat.messageAddOnContextInfo: object expected");
                m.messageAddOnContextInfo = $root.proto.MessageAddOnContextInfo.fromObject(d.messageAddOnContextInfo);
            }
            return m;
        };

        PinInChat.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.type != null && m.hasOwnProperty("type")) {
                d.type = o.enums === String ? $root.proto.PinInChat.Type[m.type] === undefined ? m.type : $root.proto.PinInChat.Type[m.type] : m.type;
                if (o.oneofs)
                    d._type = "type";
            }
            if (m.key != null && m.hasOwnProperty("key")) {
                d.key = $root.proto.MessageKey.toObject(m.key, o);
                if (o.oneofs)
                    d._key = "key";
            }
            if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
                if (typeof m.senderTimestampMs === "number")
                    d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
                else
                    d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
                if (o.oneofs)
                    d._senderTimestampMs = "senderTimestampMs";
            }
            if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) {
                if (typeof m.serverTimestampMs === "number")
                    d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs;
                else
                    d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs;
                if (o.oneofs)
                    d._serverTimestampMs = "serverTimestampMs";
            }
            if (m.messageAddOnContextInfo != null && m.hasOwnProperty("messageAddOnContextInfo")) {
                d.messageAddOnContextInfo = $root.proto.MessageAddOnContextInfo.toObject(m.messageAddOnContextInfo, o);
                if (o.oneofs)
                    d._messageAddOnContextInfo = "messageAddOnContextInfo";
            }
            return d;
        };

        PinInChat.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PinInChat.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PinInChat";
        };

        PinInChat.Type = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_TYPE"] = 0;
            values[valuesById[1] = "PIN_FOR_ALL"] = 1;
            values[valuesById[2] = "UNPIN_FOR_ALL"] = 2;
            return values;
        })();

        return PinInChat;
    })();

    proto.Point = (function() {

        function Point(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Point.prototype.xDeprecated = null;
        Point.prototype.yDeprecated = null;
        Point.prototype.x = null;
        Point.prototype.y = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Point.prototype, "_xDeprecated", {
            get: $util.oneOfGetter($oneOfFields = ["xDeprecated"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Point.prototype, "_yDeprecated", {
            get: $util.oneOfGetter($oneOfFields = ["yDeprecated"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Point.prototype, "_x", {
            get: $util.oneOfGetter($oneOfFields = ["x"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Point.prototype, "_y", {
            get: $util.oneOfGetter($oneOfFields = ["y"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Point.create = function create(properties) {
            return new Point(properties);
        };

        Point.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.xDeprecated != null && Object.hasOwnProperty.call(m, "xDeprecated"))
                w.uint32(8).int32(m.xDeprecated);
            if (m.yDeprecated != null && Object.hasOwnProperty.call(m, "yDeprecated"))
                w.uint32(16).int32(m.yDeprecated);
            if (m.x != null && Object.hasOwnProperty.call(m, "x"))
                w.uint32(25).double(m.x);
            if (m.y != null && Object.hasOwnProperty.call(m, "y"))
                w.uint32(33).double(m.y);
            return w;
        };

        Point.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Point();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.xDeprecated = r.int32();
                        break;
                    }
                case 2: {
                        m.yDeprecated = r.int32();
                        break;
                    }
                case 3: {
                        m.x = r.double();
                        break;
                    }
                case 4: {
                        m.y = r.double();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Point.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Point)
                return d;
            var m = new $root.proto.Point();
            if (d.xDeprecated != null) {
                m.xDeprecated = d.xDeprecated | 0;
            }
            if (d.yDeprecated != null) {
                m.yDeprecated = d.yDeprecated | 0;
            }
            if (d.x != null) {
                m.x = Number(d.x);
            }
            if (d.y != null) {
                m.y = Number(d.y);
            }
            return m;
        };

        Point.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.xDeprecated != null && m.hasOwnProperty("xDeprecated")) {
                d.xDeprecated = m.xDeprecated;
                if (o.oneofs)
                    d._xDeprecated = "xDeprecated";
            }
            if (m.yDeprecated != null && m.hasOwnProperty("yDeprecated")) {
                d.yDeprecated = m.yDeprecated;
                if (o.oneofs)
                    d._yDeprecated = "yDeprecated";
            }
            if (m.x != null && m.hasOwnProperty("x")) {
                d.x = o.json && !isFinite(m.x) ? String(m.x) : m.x;
                if (o.oneofs)
                    d._x = "x";
            }
            if (m.y != null && m.hasOwnProperty("y")) {
                d.y = o.json && !isFinite(m.y) ? String(m.y) : m.y;
                if (o.oneofs)
                    d._y = "y";
            }
            return d;
        };

        Point.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Point.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Point";
        };

        return Point;
    })();

    proto.PollAdditionalMetadata = (function() {

        function PollAdditionalMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PollAdditionalMetadata.prototype.pollInvalidated = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PollAdditionalMetadata.prototype, "_pollInvalidated", {
            get: $util.oneOfGetter($oneOfFields = ["pollInvalidated"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PollAdditionalMetadata.create = function create(properties) {
            return new PollAdditionalMetadata(properties);
        };

        PollAdditionalMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.pollInvalidated != null && Object.hasOwnProperty.call(m, "pollInvalidated"))
                w.uint32(8).bool(m.pollInvalidated);
            return w;
        };

        PollAdditionalMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PollAdditionalMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.pollInvalidated = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PollAdditionalMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PollAdditionalMetadata)
                return d;
            var m = new $root.proto.PollAdditionalMetadata();
            if (d.pollInvalidated != null) {
                m.pollInvalidated = Boolean(d.pollInvalidated);
            }
            return m;
        };

        PollAdditionalMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.pollInvalidated != null && m.hasOwnProperty("pollInvalidated")) {
                d.pollInvalidated = m.pollInvalidated;
                if (o.oneofs)
                    d._pollInvalidated = "pollInvalidated";
            }
            return d;
        };

        PollAdditionalMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PollAdditionalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PollAdditionalMetadata";
        };

        return PollAdditionalMetadata;
    })();

    proto.PollEncValue = (function() {

        function PollEncValue(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PollEncValue.prototype.encPayload = null;
        PollEncValue.prototype.encIv = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PollEncValue.prototype, "_encPayload", {
            get: $util.oneOfGetter($oneOfFields = ["encPayload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PollEncValue.prototype, "_encIv", {
            get: $util.oneOfGetter($oneOfFields = ["encIv"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PollEncValue.create = function create(properties) {
            return new PollEncValue(properties);
        };

        PollEncValue.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.encPayload != null && Object.hasOwnProperty.call(m, "encPayload"))
                w.uint32(10).bytes(m.encPayload);
            if (m.encIv != null && Object.hasOwnProperty.call(m, "encIv"))
                w.uint32(18).bytes(m.encIv);
            return w;
        };

        PollEncValue.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PollEncValue();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.encPayload = r.bytes();
                        break;
                    }
                case 2: {
                        m.encIv = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PollEncValue.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PollEncValue)
                return d;
            var m = new $root.proto.PollEncValue();
            if (d.encPayload != null) {
                if (typeof d.encPayload === "string")
                    $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0);
                else if (d.encPayload.length >= 0)
                    m.encPayload = d.encPayload;
            }
            if (d.encIv != null) {
                if (typeof d.encIv === "string")
                    $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0);
                else if (d.encIv.length >= 0)
                    m.encIv = d.encIv;
            }
            return m;
        };

        PollEncValue.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.encPayload != null && m.hasOwnProperty("encPayload")) {
                d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload;
                if (o.oneofs)
                    d._encPayload = "encPayload";
            }
            if (m.encIv != null && m.hasOwnProperty("encIv")) {
                d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv;
                if (o.oneofs)
                    d._encIv = "encIv";
            }
            return d;
        };

        PollEncValue.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PollEncValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PollEncValue";
        };

        return PollEncValue;
    })();

    proto.PollUpdate = (function() {

        function PollUpdate(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PollUpdate.prototype.pollUpdateMessageKey = null;
        PollUpdate.prototype.vote = null;
        PollUpdate.prototype.senderTimestampMs = null;
        PollUpdate.prototype.serverTimestampMs = null;
        PollUpdate.prototype.unread = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PollUpdate.prototype, "_pollUpdateMessageKey", {
            get: $util.oneOfGetter($oneOfFields = ["pollUpdateMessageKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PollUpdate.prototype, "_vote", {
            get: $util.oneOfGetter($oneOfFields = ["vote"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PollUpdate.prototype, "_senderTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PollUpdate.prototype, "_serverTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PollUpdate.prototype, "_unread", {
            get: $util.oneOfGetter($oneOfFields = ["unread"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PollUpdate.create = function create(properties) {
            return new PollUpdate(properties);
        };

        PollUpdate.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.pollUpdateMessageKey != null && Object.hasOwnProperty.call(m, "pollUpdateMessageKey"))
                $root.proto.MessageKey.encode(m.pollUpdateMessageKey, w.uint32(10).fork()).ldelim();
            if (m.vote != null && Object.hasOwnProperty.call(m, "vote"))
                $root.proto.Message.PollVoteMessage.encode(m.vote, w.uint32(18).fork()).ldelim();
            if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
                w.uint32(24).int64(m.senderTimestampMs);
            if (m.serverTimestampMs != null && Object.hasOwnProperty.call(m, "serverTimestampMs"))
                w.uint32(32).int64(m.serverTimestampMs);
            if (m.unread != null && Object.hasOwnProperty.call(m, "unread"))
                w.uint32(40).bool(m.unread);
            return w;
        };

        PollUpdate.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PollUpdate();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.pollUpdateMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.vote = $root.proto.Message.PollVoteMessage.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.senderTimestampMs = r.int64();
                        break;
                    }
                case 4: {
                        m.serverTimestampMs = r.int64();
                        break;
                    }
                case 5: {
                        m.unread = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PollUpdate.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PollUpdate)
                return d;
            var m = new $root.proto.PollUpdate();
            if (d.pollUpdateMessageKey != null) {
                if (typeof d.pollUpdateMessageKey !== "object")
                    throw TypeError(".proto.PollUpdate.pollUpdateMessageKey: object expected");
                m.pollUpdateMessageKey = $root.proto.MessageKey.fromObject(d.pollUpdateMessageKey);
            }
            if (d.vote != null) {
                if (typeof d.vote !== "object")
                    throw TypeError(".proto.PollUpdate.vote: object expected");
                m.vote = $root.proto.Message.PollVoteMessage.fromObject(d.vote);
            }
            if (d.senderTimestampMs != null) {
                if ($util.Long)
                    (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
                else if (typeof d.senderTimestampMs === "string")
                    m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
                else if (typeof d.senderTimestampMs === "number")
                    m.senderTimestampMs = d.senderTimestampMs;
                else if (typeof d.senderTimestampMs === "object")
                    m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
            }
            if (d.serverTimestampMs != null) {
                if ($util.Long)
                    (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false;
                else if (typeof d.serverTimestampMs === "string")
                    m.serverTimestampMs = parseInt(d.serverTimestampMs, 10);
                else if (typeof d.serverTimestampMs === "number")
                    m.serverTimestampMs = d.serverTimestampMs;
                else if (typeof d.serverTimestampMs === "object")
                    m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber();
            }
            if (d.unread != null) {
                m.unread = Boolean(d.unread);
            }
            return m;
        };

        PollUpdate.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.pollUpdateMessageKey != null && m.hasOwnProperty("pollUpdateMessageKey")) {
                d.pollUpdateMessageKey = $root.proto.MessageKey.toObject(m.pollUpdateMessageKey, o);
                if (o.oneofs)
                    d._pollUpdateMessageKey = "pollUpdateMessageKey";
            }
            if (m.vote != null && m.hasOwnProperty("vote")) {
                d.vote = $root.proto.Message.PollVoteMessage.toObject(m.vote, o);
                if (o.oneofs)
                    d._vote = "vote";
            }
            if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
                if (typeof m.senderTimestampMs === "number")
                    d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
                else
                    d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
                if (o.oneofs)
                    d._senderTimestampMs = "senderTimestampMs";
            }
            if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) {
                if (typeof m.serverTimestampMs === "number")
                    d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs;
                else
                    d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs;
                if (o.oneofs)
                    d._serverTimestampMs = "serverTimestampMs";
            }
            if (m.unread != null && m.hasOwnProperty("unread")) {
                d.unread = m.unread;
                if (o.oneofs)
                    d._unread = "unread";
            }
            return d;
        };

        PollUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PollUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PollUpdate";
        };

        return PollUpdate;
    })();

    proto.PreKeyRecordStructure = (function() {

        function PreKeyRecordStructure(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PreKeyRecordStructure.prototype.id = null;
        PreKeyRecordStructure.prototype.publicKey = null;
        PreKeyRecordStructure.prototype.privateKey = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeyRecordStructure.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeyRecordStructure.prototype, "_publicKey", {
            get: $util.oneOfGetter($oneOfFields = ["publicKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeyRecordStructure.prototype, "_privateKey", {
            get: $util.oneOfGetter($oneOfFields = ["privateKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PreKeyRecordStructure.create = function create(properties) {
            return new PreKeyRecordStructure(properties);
        };

        PreKeyRecordStructure.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(8).uint32(m.id);
            if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey"))
                w.uint32(18).bytes(m.publicKey);
            if (m.privateKey != null && Object.hasOwnProperty.call(m, "privateKey"))
                w.uint32(26).bytes(m.privateKey);
            return w;
        };

        PreKeyRecordStructure.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PreKeyRecordStructure();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.uint32();
                        break;
                    }
                case 2: {
                        m.publicKey = r.bytes();
                        break;
                    }
                case 3: {
                        m.privateKey = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PreKeyRecordStructure.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PreKeyRecordStructure)
                return d;
            var m = new $root.proto.PreKeyRecordStructure();
            if (d.id != null) {
                m.id = d.id >>> 0;
            }
            if (d.publicKey != null) {
                if (typeof d.publicKey === "string")
                    $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0);
                else if (d.publicKey.length >= 0)
                    m.publicKey = d.publicKey;
            }
            if (d.privateKey != null) {
                if (typeof d.privateKey === "string")
                    $util.base64.decode(d.privateKey, m.privateKey = $util.newBuffer($util.base64.length(d.privateKey)), 0);
                else if (d.privateKey.length >= 0)
                    m.privateKey = d.privateKey;
            }
            return m;
        };

        PreKeyRecordStructure.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            if (m.publicKey != null && m.hasOwnProperty("publicKey")) {
                d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey;
                if (o.oneofs)
                    d._publicKey = "publicKey";
            }
            if (m.privateKey != null && m.hasOwnProperty("privateKey")) {
                d.privateKey = o.bytes === String ? $util.base64.encode(m.privateKey, 0, m.privateKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.privateKey) : m.privateKey;
                if (o.oneofs)
                    d._privateKey = "privateKey";
            }
            return d;
        };

        PreKeyRecordStructure.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PreKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PreKeyRecordStructure";
        };

        return PreKeyRecordStructure;
    })();

    proto.PreKeySignalMessage = (function() {

        function PreKeySignalMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PreKeySignalMessage.prototype.registrationId = null;
        PreKeySignalMessage.prototype.preKeyId = null;
        PreKeySignalMessage.prototype.signedPreKeyId = null;
        PreKeySignalMessage.prototype.baseKey = null;
        PreKeySignalMessage.prototype.identityKey = null;
        PreKeySignalMessage.prototype.message = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeySignalMessage.prototype, "_registrationId", {
            get: $util.oneOfGetter($oneOfFields = ["registrationId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeySignalMessage.prototype, "_preKeyId", {
            get: $util.oneOfGetter($oneOfFields = ["preKeyId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeySignalMessage.prototype, "_signedPreKeyId", {
            get: $util.oneOfGetter($oneOfFields = ["signedPreKeyId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeySignalMessage.prototype, "_baseKey", {
            get: $util.oneOfGetter($oneOfFields = ["baseKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeySignalMessage.prototype, "_identityKey", {
            get: $util.oneOfGetter($oneOfFields = ["identityKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PreKeySignalMessage.prototype, "_message", {
            get: $util.oneOfGetter($oneOfFields = ["message"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PreKeySignalMessage.create = function create(properties) {
            return new PreKeySignalMessage(properties);
        };

        PreKeySignalMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.preKeyId != null && Object.hasOwnProperty.call(m, "preKeyId"))
                w.uint32(8).uint32(m.preKeyId);
            if (m.baseKey != null && Object.hasOwnProperty.call(m, "baseKey"))
                w.uint32(18).bytes(m.baseKey);
            if (m.identityKey != null && Object.hasOwnProperty.call(m, "identityKey"))
                w.uint32(26).bytes(m.identityKey);
            if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                w.uint32(34).bytes(m.message);
            if (m.registrationId != null && Object.hasOwnProperty.call(m, "registrationId"))
                w.uint32(40).uint32(m.registrationId);
            if (m.signedPreKeyId != null && Object.hasOwnProperty.call(m, "signedPreKeyId"))
                w.uint32(48).uint32(m.signedPreKeyId);
            return w;
        };

        PreKeySignalMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PreKeySignalMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 5: {
                        m.registrationId = r.uint32();
                        break;
                    }
                case 1: {
                        m.preKeyId = r.uint32();
                        break;
                    }
                case 6: {
                        m.signedPreKeyId = r.uint32();
                        break;
                    }
                case 2: {
                        m.baseKey = r.bytes();
                        break;
                    }
                case 3: {
                        m.identityKey = r.bytes();
                        break;
                    }
                case 4: {
                        m.message = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PreKeySignalMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PreKeySignalMessage)
                return d;
            var m = new $root.proto.PreKeySignalMessage();
            if (d.registrationId != null) {
                m.registrationId = d.registrationId >>> 0;
            }
            if (d.preKeyId != null) {
                m.preKeyId = d.preKeyId >>> 0;
            }
            if (d.signedPreKeyId != null) {
                m.signedPreKeyId = d.signedPreKeyId >>> 0;
            }
            if (d.baseKey != null) {
                if (typeof d.baseKey === "string")
                    $util.base64.decode(d.baseKey, m.baseKey = $util.newBuffer($util.base64.length(d.baseKey)), 0);
                else if (d.baseKey.length >= 0)
                    m.baseKey = d.baseKey;
            }
            if (d.identityKey != null) {
                if (typeof d.identityKey === "string")
                    $util.base64.decode(d.identityKey, m.identityKey = $util.newBuffer($util.base64.length(d.identityKey)), 0);
                else if (d.identityKey.length >= 0)
                    m.identityKey = d.identityKey;
            }
            if (d.message != null) {
                if (typeof d.message === "string")
                    $util.base64.decode(d.message, m.message = $util.newBuffer($util.base64.length(d.message)), 0);
                else if (d.message.length >= 0)
                    m.message = d.message;
            }
            return m;
        };

        PreKeySignalMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.preKeyId != null && m.hasOwnProperty("preKeyId")) {
                d.preKeyId = m.preKeyId;
                if (o.oneofs)
                    d._preKeyId = "preKeyId";
            }
            if (m.baseKey != null && m.hasOwnProperty("baseKey")) {
                d.baseKey = o.bytes === String ? $util.base64.encode(m.baseKey, 0, m.baseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKey) : m.baseKey;
                if (o.oneofs)
                    d._baseKey = "baseKey";
            }
            if (m.identityKey != null && m.hasOwnProperty("identityKey")) {
                d.identityKey = o.bytes === String ? $util.base64.encode(m.identityKey, 0, m.identityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.identityKey) : m.identityKey;
                if (o.oneofs)
                    d._identityKey = "identityKey";
            }
            if (m.message != null && m.hasOwnProperty("message")) {
                d.message = o.bytes === String ? $util.base64.encode(m.message, 0, m.message.length) : o.bytes === Array ? Array.prototype.slice.call(m.message) : m.message;
                if (o.oneofs)
                    d._message = "message";
            }
            if (m.registrationId != null && m.hasOwnProperty("registrationId")) {
                d.registrationId = m.registrationId;
                if (o.oneofs)
                    d._registrationId = "registrationId";
            }
            if (m.signedPreKeyId != null && m.hasOwnProperty("signedPreKeyId")) {
                d.signedPreKeyId = m.signedPreKeyId;
                if (o.oneofs)
                    d._signedPreKeyId = "signedPreKeyId";
            }
            return d;
        };

        PreKeySignalMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PreKeySignalMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PreKeySignalMessage";
        };

        return PreKeySignalMessage;
    })();

    proto.PremiumMessageInfo = (function() {

        function PremiumMessageInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PremiumMessageInfo.prototype.serverCampaignId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PremiumMessageInfo.prototype, "_serverCampaignId", {
            get: $util.oneOfGetter($oneOfFields = ["serverCampaignId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PremiumMessageInfo.create = function create(properties) {
            return new PremiumMessageInfo(properties);
        };

        PremiumMessageInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.serverCampaignId != null && Object.hasOwnProperty.call(m, "serverCampaignId"))
                w.uint32(10).string(m.serverCampaignId);
            return w;
        };

        PremiumMessageInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PremiumMessageInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.serverCampaignId = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PremiumMessageInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PremiumMessageInfo)
                return d;
            var m = new $root.proto.PremiumMessageInfo();
            if (d.serverCampaignId != null) {
                m.serverCampaignId = String(d.serverCampaignId);
            }
            return m;
        };

        PremiumMessageInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.serverCampaignId != null && m.hasOwnProperty("serverCampaignId")) {
                d.serverCampaignId = m.serverCampaignId;
                if (o.oneofs)
                    d._serverCampaignId = "serverCampaignId";
            }
            return d;
        };

        PremiumMessageInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PremiumMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PremiumMessageInfo";
        };

        return PremiumMessageInfo;
    })();

    proto.PrimaryEphemeralIdentity = (function() {

        function PrimaryEphemeralIdentity(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        PrimaryEphemeralIdentity.prototype.publicKey = null;
        PrimaryEphemeralIdentity.prototype.nonce = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PrimaryEphemeralIdentity.prototype, "_publicKey", {
            get: $util.oneOfGetter($oneOfFields = ["publicKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(PrimaryEphemeralIdentity.prototype, "_nonce", {
            get: $util.oneOfGetter($oneOfFields = ["nonce"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        PrimaryEphemeralIdentity.create = function create(properties) {
            return new PrimaryEphemeralIdentity(properties);
        };

        PrimaryEphemeralIdentity.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey"))
                w.uint32(10).bytes(m.publicKey);
            if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce"))
                w.uint32(18).bytes(m.nonce);
            return w;
        };

        PrimaryEphemeralIdentity.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PrimaryEphemeralIdentity();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.publicKey = r.bytes();
                        break;
                    }
                case 2: {
                        m.nonce = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        PrimaryEphemeralIdentity.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.PrimaryEphemeralIdentity)
                return d;
            var m = new $root.proto.PrimaryEphemeralIdentity();
            if (d.publicKey != null) {
                if (typeof d.publicKey === "string")
                    $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0);
                else if (d.publicKey.length >= 0)
                    m.publicKey = d.publicKey;
            }
            if (d.nonce != null) {
                if (typeof d.nonce === "string")
                    $util.base64.decode(d.nonce, m.nonce = $util.newBuffer($util.base64.length(d.nonce)), 0);
                else if (d.nonce.length >= 0)
                    m.nonce = d.nonce;
            }
            return m;
        };

        PrimaryEphemeralIdentity.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.publicKey != null && m.hasOwnProperty("publicKey")) {
                d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey;
                if (o.oneofs)
                    d._publicKey = "publicKey";
            }
            if (m.nonce != null && m.hasOwnProperty("nonce")) {
                d.nonce = o.bytes === String ? $util.base64.encode(m.nonce, 0, m.nonce.length) : o.bytes === Array ? Array.prototype.slice.call(m.nonce) : m.nonce;
                if (o.oneofs)
                    d._nonce = "nonce";
            }
            return d;
        };

        PrimaryEphemeralIdentity.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        PrimaryEphemeralIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.PrimaryEphemeralIdentity";
        };

        return PrimaryEphemeralIdentity;
    })();

    proto.PrivacySystemMessage = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[1] = "E2EE_MSG"] = 1;
        values[valuesById[2] = "NE2EE_SELF"] = 2;
        values[valuesById[3] = "NE2EE_OTHER"] = 3;
        return values;
    })();

    proto.ProcessedVideo = (function() {

        function ProcessedVideo(p) {
            this.capabilities = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ProcessedVideo.prototype.directPath = null;
        ProcessedVideo.prototype.fileSha256 = null;
        ProcessedVideo.prototype.height = null;
        ProcessedVideo.prototype.width = null;
        ProcessedVideo.prototype.fileLength = null;
        ProcessedVideo.prototype.bitrate = null;
        ProcessedVideo.prototype.quality = null;
        ProcessedVideo.prototype.capabilities = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProcessedVideo.prototype, "_directPath", {
            get: $util.oneOfGetter($oneOfFields = ["directPath"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProcessedVideo.prototype, "_fileSha256", {
            get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProcessedVideo.prototype, "_height", {
            get: $util.oneOfGetter($oneOfFields = ["height"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProcessedVideo.prototype, "_width", {
            get: $util.oneOfGetter($oneOfFields = ["width"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProcessedVideo.prototype, "_fileLength", {
            get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProcessedVideo.prototype, "_bitrate", {
            get: $util.oneOfGetter($oneOfFields = ["bitrate"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProcessedVideo.prototype, "_quality", {
            get: $util.oneOfGetter($oneOfFields = ["quality"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ProcessedVideo.create = function create(properties) {
            return new ProcessedVideo(properties);
        };

        ProcessedVideo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                w.uint32(10).string(m.directPath);
            if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                w.uint32(18).bytes(m.fileSha256);
            if (m.height != null && Object.hasOwnProperty.call(m, "height"))
                w.uint32(24).uint32(m.height);
            if (m.width != null && Object.hasOwnProperty.call(m, "width"))
                w.uint32(32).uint32(m.width);
            if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                w.uint32(40).uint64(m.fileLength);
            if (m.bitrate != null && Object.hasOwnProperty.call(m, "bitrate"))
                w.uint32(48).uint32(m.bitrate);
            if (m.quality != null && Object.hasOwnProperty.call(m, "quality"))
                w.uint32(56).int32(m.quality);
            if (m.capabilities != null && m.capabilities.length) {
                for (var i = 0; i < m.capabilities.length; ++i)
                    w.uint32(66).string(m.capabilities[i]);
            }
            return w;
        };

        ProcessedVideo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ProcessedVideo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.directPath = r.string();
                        break;
                    }
                case 2: {
                        m.fileSha256 = r.bytes();
                        break;
                    }
                case 3: {
                        m.height = r.uint32();
                        break;
                    }
                case 4: {
                        m.width = r.uint32();
                        break;
                    }
                case 5: {
                        m.fileLength = r.uint64();
                        break;
                    }
                case 6: {
                        m.bitrate = r.uint32();
                        break;
                    }
                case 7: {
                        m.quality = r.int32();
                        break;
                    }
                case 8: {
                        if (!(m.capabilities && m.capabilities.length))
                            m.capabilities = [];
                        m.capabilities.push(r.string());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ProcessedVideo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ProcessedVideo)
                return d;
            var m = new $root.proto.ProcessedVideo();
            if (d.directPath != null) {
                m.directPath = String(d.directPath);
            }
            if (d.fileSha256 != null) {
                if (typeof d.fileSha256 === "string")
                    $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                else if (d.fileSha256.length >= 0)
                    m.fileSha256 = d.fileSha256;
            }
            if (d.height != null) {
                m.height = d.height >>> 0;
            }
            if (d.width != null) {
                m.width = d.width >>> 0;
            }
            if (d.fileLength != null) {
                if ($util.Long)
                    (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                else if (typeof d.fileLength === "string")
                    m.fileLength = parseInt(d.fileLength, 10);
                else if (typeof d.fileLength === "number")
                    m.fileLength = d.fileLength;
                else if (typeof d.fileLength === "object")
                    m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
            }
            if (d.bitrate != null) {
                m.bitrate = d.bitrate >>> 0;
            }
            switch (d.quality) {
            default:
                if (typeof d.quality === "number") {
                    m.quality = d.quality;
                    break;
                }
                break;
            case "UNDEFINED":
            case 0:
                m.quality = 0;
                break;
            case "LOW":
            case 1:
                m.quality = 1;
                break;
            case "MID":
            case 2:
                m.quality = 2;
                break;
            case "HIGH":
            case 3:
                m.quality = 3;
                break;
            }
            if (d.capabilities) {
                if (!Array.isArray(d.capabilities))
                    throw TypeError(".proto.ProcessedVideo.capabilities: array expected");
                m.capabilities = [];
                for (var i = 0; i < d.capabilities.length; ++i) {
                    m.capabilities[i] = String(d.capabilities[i]);
                }
            }
            return m;
        };

        ProcessedVideo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.capabilities = [];
            }
            if (m.directPath != null && m.hasOwnProperty("directPath")) {
                d.directPath = m.directPath;
                if (o.oneofs)
                    d._directPath = "directPath";
            }
            if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                if (o.oneofs)
                    d._fileSha256 = "fileSha256";
            }
            if (m.height != null && m.hasOwnProperty("height")) {
                d.height = m.height;
                if (o.oneofs)
                    d._height = "height";
            }
            if (m.width != null && m.hasOwnProperty("width")) {
                d.width = m.width;
                if (o.oneofs)
                    d._width = "width";
            }
            if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                if (typeof m.fileLength === "number")
                    d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                else
                    d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                if (o.oneofs)
                    d._fileLength = "fileLength";
            }
            if (m.bitrate != null && m.hasOwnProperty("bitrate")) {
                d.bitrate = m.bitrate;
                if (o.oneofs)
                    d._bitrate = "bitrate";
            }
            if (m.quality != null && m.hasOwnProperty("quality")) {
                d.quality = o.enums === String ? $root.proto.ProcessedVideo.VideoQuality[m.quality] === undefined ? m.quality : $root.proto.ProcessedVideo.VideoQuality[m.quality] : m.quality;
                if (o.oneofs)
                    d._quality = "quality";
            }
            if (m.capabilities && m.capabilities.length) {
                d.capabilities = [];
                for (var j = 0; j < m.capabilities.length; ++j) {
                    d.capabilities[j] = m.capabilities[j];
                }
            }
            return d;
        };

        ProcessedVideo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ProcessedVideo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ProcessedVideo";
        };

        ProcessedVideo.VideoQuality = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNDEFINED"] = 0;
            values[valuesById[1] = "LOW"] = 1;
            values[valuesById[2] = "MID"] = 2;
            values[valuesById[3] = "HIGH"] = 3;
            return values;
        })();

        return ProcessedVideo;
    })();

    proto.ProloguePayload = (function() {

        function ProloguePayload(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ProloguePayload.prototype.companionEphemeralIdentity = null;
        ProloguePayload.prototype.commitment = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProloguePayload.prototype, "_companionEphemeralIdentity", {
            get: $util.oneOfGetter($oneOfFields = ["companionEphemeralIdentity"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ProloguePayload.prototype, "_commitment", {
            get: $util.oneOfGetter($oneOfFields = ["commitment"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ProloguePayload.create = function create(properties) {
            return new ProloguePayload(properties);
        };

        ProloguePayload.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.companionEphemeralIdentity != null && Object.hasOwnProperty.call(m, "companionEphemeralIdentity"))
                w.uint32(10).bytes(m.companionEphemeralIdentity);
            if (m.commitment != null && Object.hasOwnProperty.call(m, "commitment"))
                $root.proto.CompanionCommitment.encode(m.commitment, w.uint32(18).fork()).ldelim();
            return w;
        };

        ProloguePayload.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ProloguePayload();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.companionEphemeralIdentity = r.bytes();
                        break;
                    }
                case 2: {
                        m.commitment = $root.proto.CompanionCommitment.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ProloguePayload.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ProloguePayload)
                return d;
            var m = new $root.proto.ProloguePayload();
            if (d.companionEphemeralIdentity != null) {
                if (typeof d.companionEphemeralIdentity === "string")
                    $util.base64.decode(d.companionEphemeralIdentity, m.companionEphemeralIdentity = $util.newBuffer($util.base64.length(d.companionEphemeralIdentity)), 0);
                else if (d.companionEphemeralIdentity.length >= 0)
                    m.companionEphemeralIdentity = d.companionEphemeralIdentity;
            }
            if (d.commitment != null) {
                if (typeof d.commitment !== "object")
                    throw TypeError(".proto.ProloguePayload.commitment: object expected");
                m.commitment = $root.proto.CompanionCommitment.fromObject(d.commitment);
            }
            return m;
        };

        ProloguePayload.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.companionEphemeralIdentity != null && m.hasOwnProperty("companionEphemeralIdentity")) {
                d.companionEphemeralIdentity = o.bytes === String ? $util.base64.encode(m.companionEphemeralIdentity, 0, m.companionEphemeralIdentity.length) : o.bytes === Array ? Array.prototype.slice.call(m.companionEphemeralIdentity) : m.companionEphemeralIdentity;
                if (o.oneofs)
                    d._companionEphemeralIdentity = "companionEphemeralIdentity";
            }
            if (m.commitment != null && m.hasOwnProperty("commitment")) {
                d.commitment = $root.proto.CompanionCommitment.toObject(m.commitment, o);
                if (o.oneofs)
                    d._commitment = "commitment";
            }
            return d;
        };

        ProloguePayload.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ProloguePayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ProloguePayload";
        };

        return ProloguePayload;
    })();

    proto.Pushname = (function() {

        function Pushname(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Pushname.prototype.id = null;
        Pushname.prototype.pushname = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Pushname.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Pushname.prototype, "_pushname", {
            get: $util.oneOfGetter($oneOfFields = ["pushname"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Pushname.create = function create(properties) {
            return new Pushname(properties);
        };

        Pushname.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(10).string(m.id);
            if (m.pushname != null && Object.hasOwnProperty.call(m, "pushname"))
                w.uint32(18).string(m.pushname);
            return w;
        };

        Pushname.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Pushname();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.string();
                        break;
                    }
                case 2: {
                        m.pushname = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Pushname.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Pushname)
                return d;
            var m = new $root.proto.Pushname();
            if (d.id != null) {
                m.id = String(d.id);
            }
            if (d.pushname != null) {
                m.pushname = String(d.pushname);
            }
            return m;
        };

        Pushname.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            if (m.pushname != null && m.hasOwnProperty("pushname")) {
                d.pushname = m.pushname;
                if (o.oneofs)
                    d._pushname = "pushname";
            }
            return d;
        };

        Pushname.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Pushname.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Pushname";
        };

        return Pushname;
    })();

    proto.QuarantinedMessage = (function() {

        function QuarantinedMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        QuarantinedMessage.prototype.originalData = null;
        QuarantinedMessage.prototype.extractedText = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(QuarantinedMessage.prototype, "_originalData", {
            get: $util.oneOfGetter($oneOfFields = ["originalData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(QuarantinedMessage.prototype, "_extractedText", {
            get: $util.oneOfGetter($oneOfFields = ["extractedText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        QuarantinedMessage.create = function create(properties) {
            return new QuarantinedMessage(properties);
        };

        QuarantinedMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.originalData != null && Object.hasOwnProperty.call(m, "originalData"))
                w.uint32(10).bytes(m.originalData);
            if (m.extractedText != null && Object.hasOwnProperty.call(m, "extractedText"))
                w.uint32(18).string(m.extractedText);
            return w;
        };

        QuarantinedMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.QuarantinedMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.originalData = r.bytes();
                        break;
                    }
                case 2: {
                        m.extractedText = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        QuarantinedMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.QuarantinedMessage)
                return d;
            var m = new $root.proto.QuarantinedMessage();
            if (d.originalData != null) {
                if (typeof d.originalData === "string")
                    $util.base64.decode(d.originalData, m.originalData = $util.newBuffer($util.base64.length(d.originalData)), 0);
                else if (d.originalData.length >= 0)
                    m.originalData = d.originalData;
            }
            if (d.extractedText != null) {
                m.extractedText = String(d.extractedText);
            }
            return m;
        };

        QuarantinedMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.originalData != null && m.hasOwnProperty("originalData")) {
                d.originalData = o.bytes === String ? $util.base64.encode(m.originalData, 0, m.originalData.length) : o.bytes === Array ? Array.prototype.slice.call(m.originalData) : m.originalData;
                if (o.oneofs)
                    d._originalData = "originalData";
            }
            if (m.extractedText != null && m.hasOwnProperty("extractedText")) {
                d.extractedText = m.extractedText;
                if (o.oneofs)
                    d._extractedText = "extractedText";
            }
            return d;
        };

        QuarantinedMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        QuarantinedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.QuarantinedMessage";
        };

        return QuarantinedMessage;
    })();

    proto.Reaction = (function() {

        function Reaction(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Reaction.prototype.key = null;
        Reaction.prototype.text = null;
        Reaction.prototype.groupingKey = null;
        Reaction.prototype.senderTimestampMs = null;
        Reaction.prototype.unread = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reaction.prototype, "_key", {
            get: $util.oneOfGetter($oneOfFields = ["key"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reaction.prototype, "_text", {
            get: $util.oneOfGetter($oneOfFields = ["text"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reaction.prototype, "_groupingKey", {
            get: $util.oneOfGetter($oneOfFields = ["groupingKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reaction.prototype, "_senderTimestampMs", {
            get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reaction.prototype, "_unread", {
            get: $util.oneOfGetter($oneOfFields = ["unread"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Reaction.create = function create(properties) {
            return new Reaction(properties);
        };

        Reaction.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
            if (m.text != null && Object.hasOwnProperty.call(m, "text"))
                w.uint32(18).string(m.text);
            if (m.groupingKey != null && Object.hasOwnProperty.call(m, "groupingKey"))
                w.uint32(26).string(m.groupingKey);
            if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
                w.uint32(32).int64(m.senderTimestampMs);
            if (m.unread != null && Object.hasOwnProperty.call(m, "unread"))
                w.uint32(40).bool(m.unread);
            return w;
        };

        Reaction.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Reaction();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.key = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.text = r.string();
                        break;
                    }
                case 3: {
                        m.groupingKey = r.string();
                        break;
                    }
                case 4: {
                        m.senderTimestampMs = r.int64();
                        break;
                    }
                case 5: {
                        m.unread = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Reaction.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Reaction)
                return d;
            var m = new $root.proto.Reaction();
            if (d.key != null) {
                if (typeof d.key !== "object")
                    throw TypeError(".proto.Reaction.key: object expected");
                m.key = $root.proto.MessageKey.fromObject(d.key);
            }
            if (d.text != null) {
                m.text = String(d.text);
            }
            if (d.groupingKey != null) {
                m.groupingKey = String(d.groupingKey);
            }
            if (d.senderTimestampMs != null) {
                if ($util.Long)
                    (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
                else if (typeof d.senderTimestampMs === "string")
                    m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
                else if (typeof d.senderTimestampMs === "number")
                    m.senderTimestampMs = d.senderTimestampMs;
                else if (typeof d.senderTimestampMs === "object")
                    m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
            }
            if (d.unread != null) {
                m.unread = Boolean(d.unread);
            }
            return m;
        };

        Reaction.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.key != null && m.hasOwnProperty("key")) {
                d.key = $root.proto.MessageKey.toObject(m.key, o);
                if (o.oneofs)
                    d._key = "key";
            }
            if (m.text != null && m.hasOwnProperty("text")) {
                d.text = m.text;
                if (o.oneofs)
                    d._text = "text";
            }
            if (m.groupingKey != null && m.hasOwnProperty("groupingKey")) {
                d.groupingKey = m.groupingKey;
                if (o.oneofs)
                    d._groupingKey = "groupingKey";
            }
            if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
                if (typeof m.senderTimestampMs === "number")
                    d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
                else
                    d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
                if (o.oneofs)
                    d._senderTimestampMs = "senderTimestampMs";
            }
            if (m.unread != null && m.hasOwnProperty("unread")) {
                d.unread = m.unread;
                if (o.oneofs)
                    d._unread = "unread";
            }
            return d;
        };

        Reaction.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Reaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Reaction";
        };

        return Reaction;
    })();

    proto.RecentEmojiWeight = (function() {

        function RecentEmojiWeight(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        RecentEmojiWeight.prototype.emoji = null;
        RecentEmojiWeight.prototype.weight = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(RecentEmojiWeight.prototype, "_emoji", {
            get: $util.oneOfGetter($oneOfFields = ["emoji"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(RecentEmojiWeight.prototype, "_weight", {
            get: $util.oneOfGetter($oneOfFields = ["weight"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        RecentEmojiWeight.create = function create(properties) {
            return new RecentEmojiWeight(properties);
        };

        RecentEmojiWeight.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.emoji != null && Object.hasOwnProperty.call(m, "emoji"))
                w.uint32(10).string(m.emoji);
            if (m.weight != null && Object.hasOwnProperty.call(m, "weight"))
                w.uint32(21).float(m.weight);
            return w;
        };

        RecentEmojiWeight.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RecentEmojiWeight();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.emoji = r.string();
                        break;
                    }
                case 2: {
                        m.weight = r.float();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        RecentEmojiWeight.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.RecentEmojiWeight)
                return d;
            var m = new $root.proto.RecentEmojiWeight();
            if (d.emoji != null) {
                m.emoji = String(d.emoji);
            }
            if (d.weight != null) {
                m.weight = Number(d.weight);
            }
            return m;
        };

        RecentEmojiWeight.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.emoji != null && m.hasOwnProperty("emoji")) {
                d.emoji = m.emoji;
                if (o.oneofs)
                    d._emoji = "emoji";
            }
            if (m.weight != null && m.hasOwnProperty("weight")) {
                d.weight = o.json && !isFinite(m.weight) ? String(m.weight) : m.weight;
                if (o.oneofs)
                    d._weight = "weight";
            }
            return d;
        };

        RecentEmojiWeight.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        RecentEmojiWeight.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.RecentEmojiWeight";
        };

        return RecentEmojiWeight;
    })();

    proto.RecordStructure = (function() {

        function RecordStructure(p) {
            this.previousSessions = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        RecordStructure.prototype.currentSession = null;
        RecordStructure.prototype.previousSessions = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(RecordStructure.prototype, "_currentSession", {
            get: $util.oneOfGetter($oneOfFields = ["currentSession"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        RecordStructure.create = function create(properties) {
            return new RecordStructure(properties);
        };

        RecordStructure.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.currentSession != null && Object.hasOwnProperty.call(m, "currentSession"))
                $root.proto.SessionStructure.encode(m.currentSession, w.uint32(10).fork()).ldelim();
            if (m.previousSessions != null && m.previousSessions.length) {
                for (var i = 0; i < m.previousSessions.length; ++i)
                    $root.proto.SessionStructure.encode(m.previousSessions[i], w.uint32(18).fork()).ldelim();
            }
            return w;
        };

        RecordStructure.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RecordStructure();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.currentSession = $root.proto.SessionStructure.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        if (!(m.previousSessions && m.previousSessions.length))
                            m.previousSessions = [];
                        m.previousSessions.push($root.proto.SessionStructure.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        RecordStructure.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.RecordStructure)
                return d;
            var m = new $root.proto.RecordStructure();
            if (d.currentSession != null) {
                if (typeof d.currentSession !== "object")
                    throw TypeError(".proto.RecordStructure.currentSession: object expected");
                m.currentSession = $root.proto.SessionStructure.fromObject(d.currentSession);
            }
            if (d.previousSessions) {
                if (!Array.isArray(d.previousSessions))
                    throw TypeError(".proto.RecordStructure.previousSessions: array expected");
                m.previousSessions = [];
                for (var i = 0; i < d.previousSessions.length; ++i) {
                    if (typeof d.previousSessions[i] !== "object")
                        throw TypeError(".proto.RecordStructure.previousSessions: object expected");
                    m.previousSessions[i] = $root.proto.SessionStructure.fromObject(d.previousSessions[i]);
                }
            }
            return m;
        };

        RecordStructure.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.previousSessions = [];
            }
            if (m.currentSession != null && m.hasOwnProperty("currentSession")) {
                d.currentSession = $root.proto.SessionStructure.toObject(m.currentSession, o);
                if (o.oneofs)
                    d._currentSession = "currentSession";
            }
            if (m.previousSessions && m.previousSessions.length) {
                d.previousSessions = [];
                for (var j = 0; j < m.previousSessions.length; ++j) {
                    d.previousSessions[j] = $root.proto.SessionStructure.toObject(m.previousSessions[j], o);
                }
            }
            return d;
        };

        RecordStructure.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        RecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.RecordStructure";
        };

        return RecordStructure;
    })();

    proto.Reportable = (function() {

        function Reportable(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        Reportable.prototype.minVersion = null;
        Reportable.prototype.maxVersion = null;
        Reportable.prototype.notReportableMinVersion = null;
        Reportable.prototype.never = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reportable.prototype, "_minVersion", {
            get: $util.oneOfGetter($oneOfFields = ["minVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reportable.prototype, "_maxVersion", {
            get: $util.oneOfGetter($oneOfFields = ["maxVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reportable.prototype, "_notReportableMinVersion", {
            get: $util.oneOfGetter($oneOfFields = ["notReportableMinVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(Reportable.prototype, "_never", {
            get: $util.oneOfGetter($oneOfFields = ["never"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Reportable.create = function create(properties) {
            return new Reportable(properties);
        };

        Reportable.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.minVersion != null && Object.hasOwnProperty.call(m, "minVersion"))
                w.uint32(8).uint32(m.minVersion);
            if (m.maxVersion != null && Object.hasOwnProperty.call(m, "maxVersion"))
                w.uint32(16).uint32(m.maxVersion);
            if (m.notReportableMinVersion != null && Object.hasOwnProperty.call(m, "notReportableMinVersion"))
                w.uint32(24).uint32(m.notReportableMinVersion);
            if (m.never != null && Object.hasOwnProperty.call(m, "never"))
                w.uint32(32).bool(m.never);
            return w;
        };

        Reportable.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Reportable();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.minVersion = r.uint32();
                        break;
                    }
                case 2: {
                        m.maxVersion = r.uint32();
                        break;
                    }
                case 3: {
                        m.notReportableMinVersion = r.uint32();
                        break;
                    }
                case 4: {
                        m.never = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        Reportable.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.Reportable)
                return d;
            var m = new $root.proto.Reportable();
            if (d.minVersion != null) {
                m.minVersion = d.minVersion >>> 0;
            }
            if (d.maxVersion != null) {
                m.maxVersion = d.maxVersion >>> 0;
            }
            if (d.notReportableMinVersion != null) {
                m.notReportableMinVersion = d.notReportableMinVersion >>> 0;
            }
            if (d.never != null) {
                m.never = Boolean(d.never);
            }
            return m;
        };

        Reportable.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.minVersion != null && m.hasOwnProperty("minVersion")) {
                d.minVersion = m.minVersion;
                if (o.oneofs)
                    d._minVersion = "minVersion";
            }
            if (m.maxVersion != null && m.hasOwnProperty("maxVersion")) {
                d.maxVersion = m.maxVersion;
                if (o.oneofs)
                    d._maxVersion = "maxVersion";
            }
            if (m.notReportableMinVersion != null && m.hasOwnProperty("notReportableMinVersion")) {
                d.notReportableMinVersion = m.notReportableMinVersion;
                if (o.oneofs)
                    d._notReportableMinVersion = "notReportableMinVersion";
            }
            if (m.never != null && m.hasOwnProperty("never")) {
                d.never = m.never;
                if (o.oneofs)
                    d._never = "never";
            }
            return d;
        };

        Reportable.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        Reportable.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.Reportable";
        };

        return Reportable;
    })();

    proto.ReportingTokenInfo = (function() {

        function ReportingTokenInfo(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ReportingTokenInfo.prototype.reportingTag = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ReportingTokenInfo.prototype, "_reportingTag", {
            get: $util.oneOfGetter($oneOfFields = ["reportingTag"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ReportingTokenInfo.create = function create(properties) {
            return new ReportingTokenInfo(properties);
        };

        ReportingTokenInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.reportingTag != null && Object.hasOwnProperty.call(m, "reportingTag"))
                w.uint32(10).bytes(m.reportingTag);
            return w;
        };

        ReportingTokenInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ReportingTokenInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.reportingTag = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ReportingTokenInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ReportingTokenInfo)
                return d;
            var m = new $root.proto.ReportingTokenInfo();
            if (d.reportingTag != null) {
                if (typeof d.reportingTag === "string")
                    $util.base64.decode(d.reportingTag, m.reportingTag = $util.newBuffer($util.base64.length(d.reportingTag)), 0);
                else if (d.reportingTag.length >= 0)
                    m.reportingTag = d.reportingTag;
            }
            return m;
        };

        ReportingTokenInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.reportingTag != null && m.hasOwnProperty("reportingTag")) {
                d.reportingTag = o.bytes === String ? $util.base64.encode(m.reportingTag, 0, m.reportingTag.length) : o.bytes === Array ? Array.prototype.slice.call(m.reportingTag) : m.reportingTag;
                if (o.oneofs)
                    d._reportingTag = "reportingTag";
            }
            return d;
        };

        ReportingTokenInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ReportingTokenInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ReportingTokenInfo";
        };

        return ReportingTokenInfo;
    })();

    proto.SenderKeyDistributionMessage = (function() {

        function SenderKeyDistributionMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SenderKeyDistributionMessage.prototype.id = null;
        SenderKeyDistributionMessage.prototype.iteration = null;
        SenderKeyDistributionMessage.prototype.chainKey = null;
        SenderKeyDistributionMessage.prototype.signingKey = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyDistributionMessage.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyDistributionMessage.prototype, "_iteration", {
            get: $util.oneOfGetter($oneOfFields = ["iteration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyDistributionMessage.prototype, "_chainKey", {
            get: $util.oneOfGetter($oneOfFields = ["chainKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyDistributionMessage.prototype, "_signingKey", {
            get: $util.oneOfGetter($oneOfFields = ["signingKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SenderKeyDistributionMessage.create = function create(properties) {
            return new SenderKeyDistributionMessage(properties);
        };

        SenderKeyDistributionMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(8).uint32(m.id);
            if (m.iteration != null && Object.hasOwnProperty.call(m, "iteration"))
                w.uint32(16).uint32(m.iteration);
            if (m.chainKey != null && Object.hasOwnProperty.call(m, "chainKey"))
                w.uint32(26).bytes(m.chainKey);
            if (m.signingKey != null && Object.hasOwnProperty.call(m, "signingKey"))
                w.uint32(34).bytes(m.signingKey);
            return w;
        };

        SenderKeyDistributionMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SenderKeyDistributionMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.uint32();
                        break;
                    }
                case 2: {
                        m.iteration = r.uint32();
                        break;
                    }
                case 3: {
                        m.chainKey = r.bytes();
                        break;
                    }
                case 4: {
                        m.signingKey = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SenderKeyDistributionMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SenderKeyDistributionMessage)
                return d;
            var m = new $root.proto.SenderKeyDistributionMessage();
            if (d.id != null) {
                m.id = d.id >>> 0;
            }
            if (d.iteration != null) {
                m.iteration = d.iteration >>> 0;
            }
            if (d.chainKey != null) {
                if (typeof d.chainKey === "string")
                    $util.base64.decode(d.chainKey, m.chainKey = $util.newBuffer($util.base64.length(d.chainKey)), 0);
                else if (d.chainKey.length >= 0)
                    m.chainKey = d.chainKey;
            }
            if (d.signingKey != null) {
                if (typeof d.signingKey === "string")
                    $util.base64.decode(d.signingKey, m.signingKey = $util.newBuffer($util.base64.length(d.signingKey)), 0);
                else if (d.signingKey.length >= 0)
                    m.signingKey = d.signingKey;
            }
            return m;
        };

        SenderKeyDistributionMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            if (m.iteration != null && m.hasOwnProperty("iteration")) {
                d.iteration = m.iteration;
                if (o.oneofs)
                    d._iteration = "iteration";
            }
            if (m.chainKey != null && m.hasOwnProperty("chainKey")) {
                d.chainKey = o.bytes === String ? $util.base64.encode(m.chainKey, 0, m.chainKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.chainKey) : m.chainKey;
                if (o.oneofs)
                    d._chainKey = "chainKey";
            }
            if (m.signingKey != null && m.hasOwnProperty("signingKey")) {
                d.signingKey = o.bytes === String ? $util.base64.encode(m.signingKey, 0, m.signingKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.signingKey) : m.signingKey;
                if (o.oneofs)
                    d._signingKey = "signingKey";
            }
            return d;
        };

        SenderKeyDistributionMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SenderKeyDistributionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SenderKeyDistributionMessage";
        };

        return SenderKeyDistributionMessage;
    })();

    proto.SenderKeyMessage = (function() {

        function SenderKeyMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SenderKeyMessage.prototype.id = null;
        SenderKeyMessage.prototype.iteration = null;
        SenderKeyMessage.prototype.ciphertext = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyMessage.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyMessage.prototype, "_iteration", {
            get: $util.oneOfGetter($oneOfFields = ["iteration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyMessage.prototype, "_ciphertext", {
            get: $util.oneOfGetter($oneOfFields = ["ciphertext"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SenderKeyMessage.create = function create(properties) {
            return new SenderKeyMessage(properties);
        };

        SenderKeyMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(8).uint32(m.id);
            if (m.iteration != null && Object.hasOwnProperty.call(m, "iteration"))
                w.uint32(16).uint32(m.iteration);
            if (m.ciphertext != null && Object.hasOwnProperty.call(m, "ciphertext"))
                w.uint32(26).bytes(m.ciphertext);
            return w;
        };

        SenderKeyMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SenderKeyMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.uint32();
                        break;
                    }
                case 2: {
                        m.iteration = r.uint32();
                        break;
                    }
                case 3: {
                        m.ciphertext = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SenderKeyMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SenderKeyMessage)
                return d;
            var m = new $root.proto.SenderKeyMessage();
            if (d.id != null) {
                m.id = d.id >>> 0;
            }
            if (d.iteration != null) {
                m.iteration = d.iteration >>> 0;
            }
            if (d.ciphertext != null) {
                if (typeof d.ciphertext === "string")
                    $util.base64.decode(d.ciphertext, m.ciphertext = $util.newBuffer($util.base64.length(d.ciphertext)), 0);
                else if (d.ciphertext.length >= 0)
                    m.ciphertext = d.ciphertext;
            }
            return m;
        };

        SenderKeyMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            if (m.iteration != null && m.hasOwnProperty("iteration")) {
                d.iteration = m.iteration;
                if (o.oneofs)
                    d._iteration = "iteration";
            }
            if (m.ciphertext != null && m.hasOwnProperty("ciphertext")) {
                d.ciphertext = o.bytes === String ? $util.base64.encode(m.ciphertext, 0, m.ciphertext.length) : o.bytes === Array ? Array.prototype.slice.call(m.ciphertext) : m.ciphertext;
                if (o.oneofs)
                    d._ciphertext = "ciphertext";
            }
            return d;
        };

        SenderKeyMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SenderKeyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SenderKeyMessage";
        };

        return SenderKeyMessage;
    })();

    proto.SenderKeyRecordStructure = (function() {

        function SenderKeyRecordStructure(p) {
            this.senderKeyStates = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SenderKeyRecordStructure.prototype.senderKeyStates = $util.emptyArray;

        SenderKeyRecordStructure.create = function create(properties) {
            return new SenderKeyRecordStructure(properties);
        };

        SenderKeyRecordStructure.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.senderKeyStates != null && m.senderKeyStates.length) {
                for (var i = 0; i < m.senderKeyStates.length; ++i)
                    $root.proto.SenderKeyStateStructure.encode(m.senderKeyStates[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        SenderKeyRecordStructure.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SenderKeyRecordStructure();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.senderKeyStates && m.senderKeyStates.length))
                            m.senderKeyStates = [];
                        m.senderKeyStates.push($root.proto.SenderKeyStateStructure.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SenderKeyRecordStructure.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SenderKeyRecordStructure)
                return d;
            var m = new $root.proto.SenderKeyRecordStructure();
            if (d.senderKeyStates) {
                if (!Array.isArray(d.senderKeyStates))
                    throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: array expected");
                m.senderKeyStates = [];
                for (var i = 0; i < d.senderKeyStates.length; ++i) {
                    if (typeof d.senderKeyStates[i] !== "object")
                        throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: object expected");
                    m.senderKeyStates[i] = $root.proto.SenderKeyStateStructure.fromObject(d.senderKeyStates[i]);
                }
            }
            return m;
        };

        SenderKeyRecordStructure.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.senderKeyStates = [];
            }
            if (m.senderKeyStates && m.senderKeyStates.length) {
                d.senderKeyStates = [];
                for (var j = 0; j < m.senderKeyStates.length; ++j) {
                    d.senderKeyStates[j] = $root.proto.SenderKeyStateStructure.toObject(m.senderKeyStates[j], o);
                }
            }
            return d;
        };

        SenderKeyRecordStructure.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SenderKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SenderKeyRecordStructure";
        };

        return SenderKeyRecordStructure;
    })();

    proto.SenderKeyStateStructure = (function() {

        function SenderKeyStateStructure(p) {
            this.senderMessageKeys = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SenderKeyStateStructure.prototype.senderKeyId = null;
        SenderKeyStateStructure.prototype.senderChainKey = null;
        SenderKeyStateStructure.prototype.senderSigningKey = null;
        SenderKeyStateStructure.prototype.senderMessageKeys = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyStateStructure.prototype, "_senderKeyId", {
            get: $util.oneOfGetter($oneOfFields = ["senderKeyId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyStateStructure.prototype, "_senderChainKey", {
            get: $util.oneOfGetter($oneOfFields = ["senderChainKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SenderKeyStateStructure.prototype, "_senderSigningKey", {
            get: $util.oneOfGetter($oneOfFields = ["senderSigningKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SenderKeyStateStructure.create = function create(properties) {
            return new SenderKeyStateStructure(properties);
        };

        SenderKeyStateStructure.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.senderKeyId != null && Object.hasOwnProperty.call(m, "senderKeyId"))
                w.uint32(8).uint32(m.senderKeyId);
            if (m.senderChainKey != null && Object.hasOwnProperty.call(m, "senderChainKey"))
                $root.proto.SenderKeyStateStructure.SenderChainKey.encode(m.senderChainKey, w.uint32(18).fork()).ldelim();
            if (m.senderSigningKey != null && Object.hasOwnProperty.call(m, "senderSigningKey"))
                $root.proto.SenderKeyStateStructure.SenderSigningKey.encode(m.senderSigningKey, w.uint32(26).fork()).ldelim();
            if (m.senderMessageKeys != null && m.senderMessageKeys.length) {
                for (var i = 0; i < m.senderMessageKeys.length; ++i)
                    $root.proto.SenderKeyStateStructure.SenderMessageKey.encode(m.senderMessageKeys[i], w.uint32(34).fork()).ldelim();
            }
            return w;
        };

        SenderKeyStateStructure.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SenderKeyStateStructure();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.senderKeyId = r.uint32();
                        break;
                    }
                case 2: {
                        m.senderChainKey = $root.proto.SenderKeyStateStructure.SenderChainKey.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.senderSigningKey = $root.proto.SenderKeyStateStructure.SenderSigningKey.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        if (!(m.senderMessageKeys && m.senderMessageKeys.length))
                            m.senderMessageKeys = [];
                        m.senderMessageKeys.push($root.proto.SenderKeyStateStructure.SenderMessageKey.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SenderKeyStateStructure.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SenderKeyStateStructure)
                return d;
            var m = new $root.proto.SenderKeyStateStructure();
            if (d.senderKeyId != null) {
                m.senderKeyId = d.senderKeyId >>> 0;
            }
            if (d.senderChainKey != null) {
                if (typeof d.senderChainKey !== "object")
                    throw TypeError(".proto.SenderKeyStateStructure.senderChainKey: object expected");
                m.senderChainKey = $root.proto.SenderKeyStateStructure.SenderChainKey.fromObject(d.senderChainKey);
            }
            if (d.senderSigningKey != null) {
                if (typeof d.senderSigningKey !== "object")
                    throw TypeError(".proto.SenderKeyStateStructure.senderSigningKey: object expected");
                m.senderSigningKey = $root.proto.SenderKeyStateStructure.SenderSigningKey.fromObject(d.senderSigningKey);
            }
            if (d.senderMessageKeys) {
                if (!Array.isArray(d.senderMessageKeys))
                    throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: array expected");
                m.senderMessageKeys = [];
                for (var i = 0; i < d.senderMessageKeys.length; ++i) {
                    if (typeof d.senderMessageKeys[i] !== "object")
                        throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: object expected");
                    m.senderMessageKeys[i] = $root.proto.SenderKeyStateStructure.SenderMessageKey.fromObject(d.senderMessageKeys[i]);
                }
            }
            return m;
        };

        SenderKeyStateStructure.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.senderMessageKeys = [];
            }
            if (m.senderKeyId != null && m.hasOwnProperty("senderKeyId")) {
                d.senderKeyId = m.senderKeyId;
                if (o.oneofs)
                    d._senderKeyId = "senderKeyId";
            }
            if (m.senderChainKey != null && m.hasOwnProperty("senderChainKey")) {
                d.senderChainKey = $root.proto.SenderKeyStateStructure.SenderChainKey.toObject(m.senderChainKey, o);
                if (o.oneofs)
                    d._senderChainKey = "senderChainKey";
            }
            if (m.senderSigningKey != null && m.hasOwnProperty("senderSigningKey")) {
                d.senderSigningKey = $root.proto.SenderKeyStateStructure.SenderSigningKey.toObject(m.senderSigningKey, o);
                if (o.oneofs)
                    d._senderSigningKey = "senderSigningKey";
            }
            if (m.senderMessageKeys && m.senderMessageKeys.length) {
                d.senderMessageKeys = [];
                for (var j = 0; j < m.senderMessageKeys.length; ++j) {
                    d.senderMessageKeys[j] = $root.proto.SenderKeyStateStructure.SenderMessageKey.toObject(m.senderMessageKeys[j], o);
                }
            }
            return d;
        };

        SenderKeyStateStructure.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SenderKeyStateStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SenderKeyStateStructure";
        };

        SenderKeyStateStructure.SenderChainKey = (function() {

            function SenderChainKey(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SenderChainKey.prototype.iteration = null;
            SenderChainKey.prototype.seed = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SenderChainKey.prototype, "_iteration", {
                get: $util.oneOfGetter($oneOfFields = ["iteration"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SenderChainKey.prototype, "_seed", {
                get: $util.oneOfGetter($oneOfFields = ["seed"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SenderChainKey.create = function create(properties) {
                return new SenderChainKey(properties);
            };

            SenderChainKey.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.iteration != null && Object.hasOwnProperty.call(m, "iteration"))
                    w.uint32(8).uint32(m.iteration);
                if (m.seed != null && Object.hasOwnProperty.call(m, "seed"))
                    w.uint32(18).bytes(m.seed);
                return w;
            };

            SenderChainKey.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SenderKeyStateStructure.SenderChainKey();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.iteration = r.uint32();
                            break;
                        }
                    case 2: {
                            m.seed = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SenderChainKey.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SenderKeyStateStructure.SenderChainKey)
                    return d;
                var m = new $root.proto.SenderKeyStateStructure.SenderChainKey();
                if (d.iteration != null) {
                    m.iteration = d.iteration >>> 0;
                }
                if (d.seed != null) {
                    if (typeof d.seed === "string")
                        $util.base64.decode(d.seed, m.seed = $util.newBuffer($util.base64.length(d.seed)), 0);
                    else if (d.seed.length >= 0)
                        m.seed = d.seed;
                }
                return m;
            };

            SenderChainKey.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.iteration != null && m.hasOwnProperty("iteration")) {
                    d.iteration = m.iteration;
                    if (o.oneofs)
                        d._iteration = "iteration";
                }
                if (m.seed != null && m.hasOwnProperty("seed")) {
                    d.seed = o.bytes === String ? $util.base64.encode(m.seed, 0, m.seed.length) : o.bytes === Array ? Array.prototype.slice.call(m.seed) : m.seed;
                    if (o.oneofs)
                        d._seed = "seed";
                }
                return d;
            };

            SenderChainKey.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SenderChainKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SenderKeyStateStructure.SenderChainKey";
            };

            return SenderChainKey;
        })();

        SenderKeyStateStructure.SenderMessageKey = (function() {

            function SenderMessageKey(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SenderMessageKey.prototype.iteration = null;
            SenderMessageKey.prototype.seed = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SenderMessageKey.prototype, "_iteration", {
                get: $util.oneOfGetter($oneOfFields = ["iteration"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SenderMessageKey.prototype, "_seed", {
                get: $util.oneOfGetter($oneOfFields = ["seed"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SenderMessageKey.create = function create(properties) {
                return new SenderMessageKey(properties);
            };

            SenderMessageKey.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.iteration != null && Object.hasOwnProperty.call(m, "iteration"))
                    w.uint32(8).uint32(m.iteration);
                if (m.seed != null && Object.hasOwnProperty.call(m, "seed"))
                    w.uint32(18).bytes(m.seed);
                return w;
            };

            SenderMessageKey.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SenderKeyStateStructure.SenderMessageKey();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.iteration = r.uint32();
                            break;
                        }
                    case 2: {
                            m.seed = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SenderMessageKey.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SenderKeyStateStructure.SenderMessageKey)
                    return d;
                var m = new $root.proto.SenderKeyStateStructure.SenderMessageKey();
                if (d.iteration != null) {
                    m.iteration = d.iteration >>> 0;
                }
                if (d.seed != null) {
                    if (typeof d.seed === "string")
                        $util.base64.decode(d.seed, m.seed = $util.newBuffer($util.base64.length(d.seed)), 0);
                    else if (d.seed.length >= 0)
                        m.seed = d.seed;
                }
                return m;
            };

            SenderMessageKey.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.iteration != null && m.hasOwnProperty("iteration")) {
                    d.iteration = m.iteration;
                    if (o.oneofs)
                        d._iteration = "iteration";
                }
                if (m.seed != null && m.hasOwnProperty("seed")) {
                    d.seed = o.bytes === String ? $util.base64.encode(m.seed, 0, m.seed.length) : o.bytes === Array ? Array.prototype.slice.call(m.seed) : m.seed;
                    if (o.oneofs)
                        d._seed = "seed";
                }
                return d;
            };

            SenderMessageKey.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SenderMessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SenderKeyStateStructure.SenderMessageKey";
            };

            return SenderMessageKey;
        })();

        SenderKeyStateStructure.SenderSigningKey = (function() {

            function SenderSigningKey(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SenderSigningKey.prototype["public"] = null;
            SenderSigningKey.prototype["private"] = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SenderSigningKey.prototype, "_public", {
                get: $util.oneOfGetter($oneOfFields = ["public"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SenderSigningKey.prototype, "_private", {
                get: $util.oneOfGetter($oneOfFields = ["private"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SenderSigningKey.create = function create(properties) {
                return new SenderSigningKey(properties);
            };

            SenderSigningKey.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m["public"] != null && Object.hasOwnProperty.call(m, "public"))
                    w.uint32(10).bytes(m["public"]);
                if (m["private"] != null && Object.hasOwnProperty.call(m, "private"))
                    w.uint32(18).bytes(m["private"]);
                return w;
            };

            SenderSigningKey.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SenderKeyStateStructure.SenderSigningKey();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m["public"] = r.bytes();
                            break;
                        }
                    case 2: {
                            m["private"] = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SenderSigningKey.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SenderKeyStateStructure.SenderSigningKey)
                    return d;
                var m = new $root.proto.SenderKeyStateStructure.SenderSigningKey();
                if (d["public"] != null) {
                    if (typeof d["public"] === "string")
                        $util.base64.decode(d["public"], m["public"] = $util.newBuffer($util.base64.length(d["public"])), 0);
                    else if (d["public"].length >= 0)
                        m["public"] = d["public"];
                }
                if (d["private"] != null) {
                    if (typeof d["private"] === "string")
                        $util.base64.decode(d["private"], m["private"] = $util.newBuffer($util.base64.length(d["private"])), 0);
                    else if (d["private"].length >= 0)
                        m["private"] = d["private"];
                }
                return m;
            };

            SenderSigningKey.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m["public"] != null && m.hasOwnProperty("public")) {
                    d["public"] = o.bytes === String ? $util.base64.encode(m["public"], 0, m["public"].length) : o.bytes === Array ? Array.prototype.slice.call(m["public"]) : m["public"];
                    if (o.oneofs)
                        d._public = "public";
                }
                if (m["private"] != null && m.hasOwnProperty("private")) {
                    d["private"] = o.bytes === String ? $util.base64.encode(m["private"], 0, m["private"].length) : o.bytes === Array ? Array.prototype.slice.call(m["private"]) : m["private"];
                    if (o.oneofs)
                        d._private = "private";
                }
                return d;
            };

            SenderSigningKey.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SenderSigningKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SenderKeyStateStructure.SenderSigningKey";
            };

            return SenderSigningKey;
        })();

        return SenderKeyStateStructure;
    })();

    proto.ServerErrorReceipt = (function() {

        function ServerErrorReceipt(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ServerErrorReceipt.prototype.stanzaId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ServerErrorReceipt.prototype, "_stanzaId", {
            get: $util.oneOfGetter($oneOfFields = ["stanzaId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ServerErrorReceipt.create = function create(properties) {
            return new ServerErrorReceipt(properties);
        };

        ServerErrorReceipt.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.stanzaId != null && Object.hasOwnProperty.call(m, "stanzaId"))
                w.uint32(10).string(m.stanzaId);
            return w;
        };

        ServerErrorReceipt.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServerErrorReceipt();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.stanzaId = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ServerErrorReceipt.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ServerErrorReceipt)
                return d;
            var m = new $root.proto.ServerErrorReceipt();
            if (d.stanzaId != null) {
                m.stanzaId = String(d.stanzaId);
            }
            return m;
        };

        ServerErrorReceipt.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) {
                d.stanzaId = m.stanzaId;
                if (o.oneofs)
                    d._stanzaId = "stanzaId";
            }
            return d;
        };

        ServerErrorReceipt.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ServerErrorReceipt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ServerErrorReceipt";
        };

        return ServerErrorReceipt;
    })();

    proto.SessionStructure = (function() {

        function SessionStructure(p) {
            this.receiverChains = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SessionStructure.prototype.sessionVersion = null;
        SessionStructure.prototype.localIdentityPublic = null;
        SessionStructure.prototype.remoteIdentityPublic = null;
        SessionStructure.prototype.rootKey = null;
        SessionStructure.prototype.previousCounter = null;
        SessionStructure.prototype.senderChain = null;
        SessionStructure.prototype.receiverChains = $util.emptyArray;
        SessionStructure.prototype.pendingKeyExchange = null;
        SessionStructure.prototype.pendingPreKey = null;
        SessionStructure.prototype.remoteRegistrationId = null;
        SessionStructure.prototype.localRegistrationId = null;
        SessionStructure.prototype.needsRefresh = null;
        SessionStructure.prototype.aliceBaseKey = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_sessionVersion", {
            get: $util.oneOfGetter($oneOfFields = ["sessionVersion"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_localIdentityPublic", {
            get: $util.oneOfGetter($oneOfFields = ["localIdentityPublic"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_remoteIdentityPublic", {
            get: $util.oneOfGetter($oneOfFields = ["remoteIdentityPublic"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_rootKey", {
            get: $util.oneOfGetter($oneOfFields = ["rootKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_previousCounter", {
            get: $util.oneOfGetter($oneOfFields = ["previousCounter"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_senderChain", {
            get: $util.oneOfGetter($oneOfFields = ["senderChain"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_pendingKeyExchange", {
            get: $util.oneOfGetter($oneOfFields = ["pendingKeyExchange"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_pendingPreKey", {
            get: $util.oneOfGetter($oneOfFields = ["pendingPreKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_remoteRegistrationId", {
            get: $util.oneOfGetter($oneOfFields = ["remoteRegistrationId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_localRegistrationId", {
            get: $util.oneOfGetter($oneOfFields = ["localRegistrationId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_needsRefresh", {
            get: $util.oneOfGetter($oneOfFields = ["needsRefresh"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionStructure.prototype, "_aliceBaseKey", {
            get: $util.oneOfGetter($oneOfFields = ["aliceBaseKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SessionStructure.create = function create(properties) {
            return new SessionStructure(properties);
        };

        SessionStructure.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.sessionVersion != null && Object.hasOwnProperty.call(m, "sessionVersion"))
                w.uint32(8).uint32(m.sessionVersion);
            if (m.localIdentityPublic != null && Object.hasOwnProperty.call(m, "localIdentityPublic"))
                w.uint32(18).bytes(m.localIdentityPublic);
            if (m.remoteIdentityPublic != null && Object.hasOwnProperty.call(m, "remoteIdentityPublic"))
                w.uint32(26).bytes(m.remoteIdentityPublic);
            if (m.rootKey != null && Object.hasOwnProperty.call(m, "rootKey"))
                w.uint32(34).bytes(m.rootKey);
            if (m.previousCounter != null && Object.hasOwnProperty.call(m, "previousCounter"))
                w.uint32(40).uint32(m.previousCounter);
            if (m.senderChain != null && Object.hasOwnProperty.call(m, "senderChain"))
                $root.proto.SessionStructure.Chain.encode(m.senderChain, w.uint32(50).fork()).ldelim();
            if (m.receiverChains != null && m.receiverChains.length) {
                for (var i = 0; i < m.receiverChains.length; ++i)
                    $root.proto.SessionStructure.Chain.encode(m.receiverChains[i], w.uint32(58).fork()).ldelim();
            }
            if (m.pendingKeyExchange != null && Object.hasOwnProperty.call(m, "pendingKeyExchange"))
                $root.proto.SessionStructure.PendingKeyExchange.encode(m.pendingKeyExchange, w.uint32(66).fork()).ldelim();
            if (m.pendingPreKey != null && Object.hasOwnProperty.call(m, "pendingPreKey"))
                $root.proto.SessionStructure.PendingPreKey.encode(m.pendingPreKey, w.uint32(74).fork()).ldelim();
            if (m.remoteRegistrationId != null && Object.hasOwnProperty.call(m, "remoteRegistrationId"))
                w.uint32(80).uint32(m.remoteRegistrationId);
            if (m.localRegistrationId != null && Object.hasOwnProperty.call(m, "localRegistrationId"))
                w.uint32(88).uint32(m.localRegistrationId);
            if (m.needsRefresh != null && Object.hasOwnProperty.call(m, "needsRefresh"))
                w.uint32(96).bool(m.needsRefresh);
            if (m.aliceBaseKey != null && Object.hasOwnProperty.call(m, "aliceBaseKey"))
                w.uint32(106).bytes(m.aliceBaseKey);
            return w;
        };

        SessionStructure.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.sessionVersion = r.uint32();
                        break;
                    }
                case 2: {
                        m.localIdentityPublic = r.bytes();
                        break;
                    }
                case 3: {
                        m.remoteIdentityPublic = r.bytes();
                        break;
                    }
                case 4: {
                        m.rootKey = r.bytes();
                        break;
                    }
                case 5: {
                        m.previousCounter = r.uint32();
                        break;
                    }
                case 6: {
                        m.senderChain = $root.proto.SessionStructure.Chain.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        if (!(m.receiverChains && m.receiverChains.length))
                            m.receiverChains = [];
                        m.receiverChains.push($root.proto.SessionStructure.Chain.decode(r, r.uint32()));
                        break;
                    }
                case 8: {
                        m.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.decode(r, r.uint32());
                        break;
                    }
                case 9: {
                        m.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.decode(r, r.uint32());
                        break;
                    }
                case 10: {
                        m.remoteRegistrationId = r.uint32();
                        break;
                    }
                case 11: {
                        m.localRegistrationId = r.uint32();
                        break;
                    }
                case 12: {
                        m.needsRefresh = r.bool();
                        break;
                    }
                case 13: {
                        m.aliceBaseKey = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SessionStructure.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SessionStructure)
                return d;
            var m = new $root.proto.SessionStructure();
            if (d.sessionVersion != null) {
                m.sessionVersion = d.sessionVersion >>> 0;
            }
            if (d.localIdentityPublic != null) {
                if (typeof d.localIdentityPublic === "string")
                    $util.base64.decode(d.localIdentityPublic, m.localIdentityPublic = $util.newBuffer($util.base64.length(d.localIdentityPublic)), 0);
                else if (d.localIdentityPublic.length >= 0)
                    m.localIdentityPublic = d.localIdentityPublic;
            }
            if (d.remoteIdentityPublic != null) {
                if (typeof d.remoteIdentityPublic === "string")
                    $util.base64.decode(d.remoteIdentityPublic, m.remoteIdentityPublic = $util.newBuffer($util.base64.length(d.remoteIdentityPublic)), 0);
                else if (d.remoteIdentityPublic.length >= 0)
                    m.remoteIdentityPublic = d.remoteIdentityPublic;
            }
            if (d.rootKey != null) {
                if (typeof d.rootKey === "string")
                    $util.base64.decode(d.rootKey, m.rootKey = $util.newBuffer($util.base64.length(d.rootKey)), 0);
                else if (d.rootKey.length >= 0)
                    m.rootKey = d.rootKey;
            }
            if (d.previousCounter != null) {
                m.previousCounter = d.previousCounter >>> 0;
            }
            if (d.senderChain != null) {
                if (typeof d.senderChain !== "object")
                    throw TypeError(".proto.SessionStructure.senderChain: object expected");
                m.senderChain = $root.proto.SessionStructure.Chain.fromObject(d.senderChain);
            }
            if (d.receiverChains) {
                if (!Array.isArray(d.receiverChains))
                    throw TypeError(".proto.SessionStructure.receiverChains: array expected");
                m.receiverChains = [];
                for (var i = 0; i < d.receiverChains.length; ++i) {
                    if (typeof d.receiverChains[i] !== "object")
                        throw TypeError(".proto.SessionStructure.receiverChains: object expected");
                    m.receiverChains[i] = $root.proto.SessionStructure.Chain.fromObject(d.receiverChains[i]);
                }
            }
            if (d.pendingKeyExchange != null) {
                if (typeof d.pendingKeyExchange !== "object")
                    throw TypeError(".proto.SessionStructure.pendingKeyExchange: object expected");
                m.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.fromObject(d.pendingKeyExchange);
            }
            if (d.pendingPreKey != null) {
                if (typeof d.pendingPreKey !== "object")
                    throw TypeError(".proto.SessionStructure.pendingPreKey: object expected");
                m.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.fromObject(d.pendingPreKey);
            }
            if (d.remoteRegistrationId != null) {
                m.remoteRegistrationId = d.remoteRegistrationId >>> 0;
            }
            if (d.localRegistrationId != null) {
                m.localRegistrationId = d.localRegistrationId >>> 0;
            }
            if (d.needsRefresh != null) {
                m.needsRefresh = Boolean(d.needsRefresh);
            }
            if (d.aliceBaseKey != null) {
                if (typeof d.aliceBaseKey === "string")
                    $util.base64.decode(d.aliceBaseKey, m.aliceBaseKey = $util.newBuffer($util.base64.length(d.aliceBaseKey)), 0);
                else if (d.aliceBaseKey.length >= 0)
                    m.aliceBaseKey = d.aliceBaseKey;
            }
            return m;
        };

        SessionStructure.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.receiverChains = [];
            }
            if (m.sessionVersion != null && m.hasOwnProperty("sessionVersion")) {
                d.sessionVersion = m.sessionVersion;
                if (o.oneofs)
                    d._sessionVersion = "sessionVersion";
            }
            if (m.localIdentityPublic != null && m.hasOwnProperty("localIdentityPublic")) {
                d.localIdentityPublic = o.bytes === String ? $util.base64.encode(m.localIdentityPublic, 0, m.localIdentityPublic.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityPublic) : m.localIdentityPublic;
                if (o.oneofs)
                    d._localIdentityPublic = "localIdentityPublic";
            }
            if (m.remoteIdentityPublic != null && m.hasOwnProperty("remoteIdentityPublic")) {
                d.remoteIdentityPublic = o.bytes === String ? $util.base64.encode(m.remoteIdentityPublic, 0, m.remoteIdentityPublic.length) : o.bytes === Array ? Array.prototype.slice.call(m.remoteIdentityPublic) : m.remoteIdentityPublic;
                if (o.oneofs)
                    d._remoteIdentityPublic = "remoteIdentityPublic";
            }
            if (m.rootKey != null && m.hasOwnProperty("rootKey")) {
                d.rootKey = o.bytes === String ? $util.base64.encode(m.rootKey, 0, m.rootKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.rootKey) : m.rootKey;
                if (o.oneofs)
                    d._rootKey = "rootKey";
            }
            if (m.previousCounter != null && m.hasOwnProperty("previousCounter")) {
                d.previousCounter = m.previousCounter;
                if (o.oneofs)
                    d._previousCounter = "previousCounter";
            }
            if (m.senderChain != null && m.hasOwnProperty("senderChain")) {
                d.senderChain = $root.proto.SessionStructure.Chain.toObject(m.senderChain, o);
                if (o.oneofs)
                    d._senderChain = "senderChain";
            }
            if (m.receiverChains && m.receiverChains.length) {
                d.receiverChains = [];
                for (var j = 0; j < m.receiverChains.length; ++j) {
                    d.receiverChains[j] = $root.proto.SessionStructure.Chain.toObject(m.receiverChains[j], o);
                }
            }
            if (m.pendingKeyExchange != null && m.hasOwnProperty("pendingKeyExchange")) {
                d.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.toObject(m.pendingKeyExchange, o);
                if (o.oneofs)
                    d._pendingKeyExchange = "pendingKeyExchange";
            }
            if (m.pendingPreKey != null && m.hasOwnProperty("pendingPreKey")) {
                d.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.toObject(m.pendingPreKey, o);
                if (o.oneofs)
                    d._pendingPreKey = "pendingPreKey";
            }
            if (m.remoteRegistrationId != null && m.hasOwnProperty("remoteRegistrationId")) {
                d.remoteRegistrationId = m.remoteRegistrationId;
                if (o.oneofs)
                    d._remoteRegistrationId = "remoteRegistrationId";
            }
            if (m.localRegistrationId != null && m.hasOwnProperty("localRegistrationId")) {
                d.localRegistrationId = m.localRegistrationId;
                if (o.oneofs)
                    d._localRegistrationId = "localRegistrationId";
            }
            if (m.needsRefresh != null && m.hasOwnProperty("needsRefresh")) {
                d.needsRefresh = m.needsRefresh;
                if (o.oneofs)
                    d._needsRefresh = "needsRefresh";
            }
            if (m.aliceBaseKey != null && m.hasOwnProperty("aliceBaseKey")) {
                d.aliceBaseKey = o.bytes === String ? $util.base64.encode(m.aliceBaseKey, 0, m.aliceBaseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.aliceBaseKey) : m.aliceBaseKey;
                if (o.oneofs)
                    d._aliceBaseKey = "aliceBaseKey";
            }
            return d;
        };

        SessionStructure.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SessionStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SessionStructure";
        };

        SessionStructure.Chain = (function() {

            function Chain(p) {
                this.messageKeys = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            Chain.prototype.senderRatchetKey = null;
            Chain.prototype.senderRatchetKeyPrivate = null;
            Chain.prototype.chainKey = null;
            Chain.prototype.messageKeys = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Chain.prototype, "_senderRatchetKey", {
                get: $util.oneOfGetter($oneOfFields = ["senderRatchetKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Chain.prototype, "_senderRatchetKeyPrivate", {
                get: $util.oneOfGetter($oneOfFields = ["senderRatchetKeyPrivate"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Chain.prototype, "_chainKey", {
                get: $util.oneOfGetter($oneOfFields = ["chainKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Chain.create = function create(properties) {
                return new Chain(properties);
            };

            Chain.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.senderRatchetKey != null && Object.hasOwnProperty.call(m, "senderRatchetKey"))
                    w.uint32(10).bytes(m.senderRatchetKey);
                if (m.senderRatchetKeyPrivate != null && Object.hasOwnProperty.call(m, "senderRatchetKeyPrivate"))
                    w.uint32(18).bytes(m.senderRatchetKeyPrivate);
                if (m.chainKey != null && Object.hasOwnProperty.call(m, "chainKey"))
                    $root.proto.SessionStructure.Chain.ChainKey.encode(m.chainKey, w.uint32(26).fork()).ldelim();
                if (m.messageKeys != null && m.messageKeys.length) {
                    for (var i = 0; i < m.messageKeys.length; ++i)
                        $root.proto.SessionStructure.Chain.MessageKey.encode(m.messageKeys[i], w.uint32(34).fork()).ldelim();
                }
                return w;
            };

            Chain.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.Chain();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.senderRatchetKey = r.bytes();
                            break;
                        }
                    case 2: {
                            m.senderRatchetKeyPrivate = r.bytes();
                            break;
                        }
                    case 3: {
                            m.chainKey = $root.proto.SessionStructure.Chain.ChainKey.decode(r, r.uint32());
                            break;
                        }
                    case 4: {
                            if (!(m.messageKeys && m.messageKeys.length))
                                m.messageKeys = [];
                            m.messageKeys.push($root.proto.SessionStructure.Chain.MessageKey.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            Chain.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SessionStructure.Chain)
                    return d;
                var m = new $root.proto.SessionStructure.Chain();
                if (d.senderRatchetKey != null) {
                    if (typeof d.senderRatchetKey === "string")
                        $util.base64.decode(d.senderRatchetKey, m.senderRatchetKey = $util.newBuffer($util.base64.length(d.senderRatchetKey)), 0);
                    else if (d.senderRatchetKey.length >= 0)
                        m.senderRatchetKey = d.senderRatchetKey;
                }
                if (d.senderRatchetKeyPrivate != null) {
                    if (typeof d.senderRatchetKeyPrivate === "string")
                        $util.base64.decode(d.senderRatchetKeyPrivate, m.senderRatchetKeyPrivate = $util.newBuffer($util.base64.length(d.senderRatchetKeyPrivate)), 0);
                    else if (d.senderRatchetKeyPrivate.length >= 0)
                        m.senderRatchetKeyPrivate = d.senderRatchetKeyPrivate;
                }
                if (d.chainKey != null) {
                    if (typeof d.chainKey !== "object")
                        throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected");
                    m.chainKey = $root.proto.SessionStructure.Chain.ChainKey.fromObject(d.chainKey);
                }
                if (d.messageKeys) {
                    if (!Array.isArray(d.messageKeys))
                        throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected");
                    m.messageKeys = [];
                    for (var i = 0; i < d.messageKeys.length; ++i) {
                        if (typeof d.messageKeys[i] !== "object")
                            throw TypeError(".proto.SessionStructure.Chain.messageKeys: object expected");
                        m.messageKeys[i] = $root.proto.SessionStructure.Chain.MessageKey.fromObject(d.messageKeys[i]);
                    }
                }
                return m;
            };

            Chain.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.messageKeys = [];
                }
                if (m.senderRatchetKey != null && m.hasOwnProperty("senderRatchetKey")) {
                    d.senderRatchetKey = o.bytes === String ? $util.base64.encode(m.senderRatchetKey, 0, m.senderRatchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.senderRatchetKey) : m.senderRatchetKey;
                    if (o.oneofs)
                        d._senderRatchetKey = "senderRatchetKey";
                }
                if (m.senderRatchetKeyPrivate != null && m.hasOwnProperty("senderRatchetKeyPrivate")) {
                    d.senderRatchetKeyPrivate = o.bytes === String ? $util.base64.encode(m.senderRatchetKeyPrivate, 0, m.senderRatchetKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.senderRatchetKeyPrivate) : m.senderRatchetKeyPrivate;
                    if (o.oneofs)
                        d._senderRatchetKeyPrivate = "senderRatchetKeyPrivate";
                }
                if (m.chainKey != null && m.hasOwnProperty("chainKey")) {
                    d.chainKey = $root.proto.SessionStructure.Chain.ChainKey.toObject(m.chainKey, o);
                    if (o.oneofs)
                        d._chainKey = "chainKey";
                }
                if (m.messageKeys && m.messageKeys.length) {
                    d.messageKeys = [];
                    for (var j = 0; j < m.messageKeys.length; ++j) {
                        d.messageKeys[j] = $root.proto.SessionStructure.Chain.MessageKey.toObject(m.messageKeys[j], o);
                    }
                }
                return d;
            };

            Chain.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            Chain.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SessionStructure.Chain";
            };

            Chain.ChainKey = (function() {

                function ChainKey(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                ChainKey.prototype.index = null;
                ChainKey.prototype.key = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ChainKey.prototype, "_index", {
                    get: $util.oneOfGetter($oneOfFields = ["index"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(ChainKey.prototype, "_key", {
                    get: $util.oneOfGetter($oneOfFields = ["key"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                ChainKey.create = function create(properties) {
                    return new ChainKey(properties);
                };

                ChainKey.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.index != null && Object.hasOwnProperty.call(m, "index"))
                        w.uint32(8).uint32(m.index);
                    if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                        w.uint32(18).bytes(m.key);
                    return w;
                };

                ChainKey.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.Chain.ChainKey();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.index = r.uint32();
                                break;
                            }
                        case 2: {
                                m.key = r.bytes();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                ChainKey.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.SessionStructure.Chain.ChainKey)
                        return d;
                    var m = new $root.proto.SessionStructure.Chain.ChainKey();
                    if (d.index != null) {
                        m.index = d.index >>> 0;
                    }
                    if (d.key != null) {
                        if (typeof d.key === "string")
                            $util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0);
                        else if (d.key.length >= 0)
                            m.key = d.key;
                    }
                    return m;
                };

                ChainKey.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.index != null && m.hasOwnProperty("index")) {
                        d.index = m.index;
                        if (o.oneofs)
                            d._index = "index";
                    }
                    if (m.key != null && m.hasOwnProperty("key")) {
                        d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key;
                        if (o.oneofs)
                            d._key = "key";
                    }
                    return d;
                };

                ChainKey.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                ChainKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.SessionStructure.Chain.ChainKey";
                };

                return ChainKey;
            })();

            Chain.MessageKey = (function() {

                function MessageKey(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                MessageKey.prototype.index = null;
                MessageKey.prototype.cipherKey = null;
                MessageKey.prototype.macKey = null;
                MessageKey.prototype.iv = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(MessageKey.prototype, "_index", {
                    get: $util.oneOfGetter($oneOfFields = ["index"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(MessageKey.prototype, "_cipherKey", {
                    get: $util.oneOfGetter($oneOfFields = ["cipherKey"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(MessageKey.prototype, "_macKey", {
                    get: $util.oneOfGetter($oneOfFields = ["macKey"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(MessageKey.prototype, "_iv", {
                    get: $util.oneOfGetter($oneOfFields = ["iv"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                MessageKey.create = function create(properties) {
                    return new MessageKey(properties);
                };

                MessageKey.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.index != null && Object.hasOwnProperty.call(m, "index"))
                        w.uint32(8).uint32(m.index);
                    if (m.cipherKey != null && Object.hasOwnProperty.call(m, "cipherKey"))
                        w.uint32(18).bytes(m.cipherKey);
                    if (m.macKey != null && Object.hasOwnProperty.call(m, "macKey"))
                        w.uint32(26).bytes(m.macKey);
                    if (m.iv != null && Object.hasOwnProperty.call(m, "iv"))
                        w.uint32(34).bytes(m.iv);
                    return w;
                };

                MessageKey.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.Chain.MessageKey();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.index = r.uint32();
                                break;
                            }
                        case 2: {
                                m.cipherKey = r.bytes();
                                break;
                            }
                        case 3: {
                                m.macKey = r.bytes();
                                break;
                            }
                        case 4: {
                                m.iv = r.bytes();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                MessageKey.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.SessionStructure.Chain.MessageKey)
                        return d;
                    var m = new $root.proto.SessionStructure.Chain.MessageKey();
                    if (d.index != null) {
                        m.index = d.index >>> 0;
                    }
                    if (d.cipherKey != null) {
                        if (typeof d.cipherKey === "string")
                            $util.base64.decode(d.cipherKey, m.cipherKey = $util.newBuffer($util.base64.length(d.cipherKey)), 0);
                        else if (d.cipherKey.length >= 0)
                            m.cipherKey = d.cipherKey;
                    }
                    if (d.macKey != null) {
                        if (typeof d.macKey === "string")
                            $util.base64.decode(d.macKey, m.macKey = $util.newBuffer($util.base64.length(d.macKey)), 0);
                        else if (d.macKey.length >= 0)
                            m.macKey = d.macKey;
                    }
                    if (d.iv != null) {
                        if (typeof d.iv === "string")
                            $util.base64.decode(d.iv, m.iv = $util.newBuffer($util.base64.length(d.iv)), 0);
                        else if (d.iv.length >= 0)
                            m.iv = d.iv;
                    }
                    return m;
                };

                MessageKey.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.index != null && m.hasOwnProperty("index")) {
                        d.index = m.index;
                        if (o.oneofs)
                            d._index = "index";
                    }
                    if (m.cipherKey != null && m.hasOwnProperty("cipherKey")) {
                        d.cipherKey = o.bytes === String ? $util.base64.encode(m.cipherKey, 0, m.cipherKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.cipherKey) : m.cipherKey;
                        if (o.oneofs)
                            d._cipherKey = "cipherKey";
                    }
                    if (m.macKey != null && m.hasOwnProperty("macKey")) {
                        d.macKey = o.bytes === String ? $util.base64.encode(m.macKey, 0, m.macKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.macKey) : m.macKey;
                        if (o.oneofs)
                            d._macKey = "macKey";
                    }
                    if (m.iv != null && m.hasOwnProperty("iv")) {
                        d.iv = o.bytes === String ? $util.base64.encode(m.iv, 0, m.iv.length) : o.bytes === Array ? Array.prototype.slice.call(m.iv) : m.iv;
                        if (o.oneofs)
                            d._iv = "iv";
                    }
                    return d;
                };

                MessageKey.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                MessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.SessionStructure.Chain.MessageKey";
                };

                return MessageKey;
            })();

            return Chain;
        })();

        SessionStructure.PendingKeyExchange = (function() {

            function PendingKeyExchange(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PendingKeyExchange.prototype.sequence = null;
            PendingKeyExchange.prototype.localBaseKey = null;
            PendingKeyExchange.prototype.localBaseKeyPrivate = null;
            PendingKeyExchange.prototype.localRatchetKey = null;
            PendingKeyExchange.prototype.localRatchetKeyPrivate = null;
            PendingKeyExchange.prototype.localIdentityKey = null;
            PendingKeyExchange.prototype.localIdentityKeyPrivate = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingKeyExchange.prototype, "_sequence", {
                get: $util.oneOfGetter($oneOfFields = ["sequence"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingKeyExchange.prototype, "_localBaseKey", {
                get: $util.oneOfGetter($oneOfFields = ["localBaseKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingKeyExchange.prototype, "_localBaseKeyPrivate", {
                get: $util.oneOfGetter($oneOfFields = ["localBaseKeyPrivate"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingKeyExchange.prototype, "_localRatchetKey", {
                get: $util.oneOfGetter($oneOfFields = ["localRatchetKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingKeyExchange.prototype, "_localRatchetKeyPrivate", {
                get: $util.oneOfGetter($oneOfFields = ["localRatchetKeyPrivate"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingKeyExchange.prototype, "_localIdentityKey", {
                get: $util.oneOfGetter($oneOfFields = ["localIdentityKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingKeyExchange.prototype, "_localIdentityKeyPrivate", {
                get: $util.oneOfGetter($oneOfFields = ["localIdentityKeyPrivate"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PendingKeyExchange.create = function create(properties) {
                return new PendingKeyExchange(properties);
            };

            PendingKeyExchange.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence"))
                    w.uint32(8).uint32(m.sequence);
                if (m.localBaseKey != null && Object.hasOwnProperty.call(m, "localBaseKey"))
                    w.uint32(18).bytes(m.localBaseKey);
                if (m.localBaseKeyPrivate != null && Object.hasOwnProperty.call(m, "localBaseKeyPrivate"))
                    w.uint32(26).bytes(m.localBaseKeyPrivate);
                if (m.localRatchetKey != null && Object.hasOwnProperty.call(m, "localRatchetKey"))
                    w.uint32(34).bytes(m.localRatchetKey);
                if (m.localRatchetKeyPrivate != null && Object.hasOwnProperty.call(m, "localRatchetKeyPrivate"))
                    w.uint32(42).bytes(m.localRatchetKeyPrivate);
                if (m.localIdentityKey != null && Object.hasOwnProperty.call(m, "localIdentityKey"))
                    w.uint32(58).bytes(m.localIdentityKey);
                if (m.localIdentityKeyPrivate != null && Object.hasOwnProperty.call(m, "localIdentityKeyPrivate"))
                    w.uint32(66).bytes(m.localIdentityKeyPrivate);
                return w;
            };

            PendingKeyExchange.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.PendingKeyExchange();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.sequence = r.uint32();
                            break;
                        }
                    case 2: {
                            m.localBaseKey = r.bytes();
                            break;
                        }
                    case 3: {
                            m.localBaseKeyPrivate = r.bytes();
                            break;
                        }
                    case 4: {
                            m.localRatchetKey = r.bytes();
                            break;
                        }
                    case 5: {
                            m.localRatchetKeyPrivate = r.bytes();
                            break;
                        }
                    case 7: {
                            m.localIdentityKey = r.bytes();
                            break;
                        }
                    case 8: {
                            m.localIdentityKeyPrivate = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PendingKeyExchange.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SessionStructure.PendingKeyExchange)
                    return d;
                var m = new $root.proto.SessionStructure.PendingKeyExchange();
                if (d.sequence != null) {
                    m.sequence = d.sequence >>> 0;
                }
                if (d.localBaseKey != null) {
                    if (typeof d.localBaseKey === "string")
                        $util.base64.decode(d.localBaseKey, m.localBaseKey = $util.newBuffer($util.base64.length(d.localBaseKey)), 0);
                    else if (d.localBaseKey.length >= 0)
                        m.localBaseKey = d.localBaseKey;
                }
                if (d.localBaseKeyPrivate != null) {
                    if (typeof d.localBaseKeyPrivate === "string")
                        $util.base64.decode(d.localBaseKeyPrivate, m.localBaseKeyPrivate = $util.newBuffer($util.base64.length(d.localBaseKeyPrivate)), 0);
                    else if (d.localBaseKeyPrivate.length >= 0)
                        m.localBaseKeyPrivate = d.localBaseKeyPrivate;
                }
                if (d.localRatchetKey != null) {
                    if (typeof d.localRatchetKey === "string")
                        $util.base64.decode(d.localRatchetKey, m.localRatchetKey = $util.newBuffer($util.base64.length(d.localRatchetKey)), 0);
                    else if (d.localRatchetKey.length >= 0)
                        m.localRatchetKey = d.localRatchetKey;
                }
                if (d.localRatchetKeyPrivate != null) {
                    if (typeof d.localRatchetKeyPrivate === "string")
                        $util.base64.decode(d.localRatchetKeyPrivate, m.localRatchetKeyPrivate = $util.newBuffer($util.base64.length(d.localRatchetKeyPrivate)), 0);
                    else if (d.localRatchetKeyPrivate.length >= 0)
                        m.localRatchetKeyPrivate = d.localRatchetKeyPrivate;
                }
                if (d.localIdentityKey != null) {
                    if (typeof d.localIdentityKey === "string")
                        $util.base64.decode(d.localIdentityKey, m.localIdentityKey = $util.newBuffer($util.base64.length(d.localIdentityKey)), 0);
                    else if (d.localIdentityKey.length >= 0)
                        m.localIdentityKey = d.localIdentityKey;
                }
                if (d.localIdentityKeyPrivate != null) {
                    if (typeof d.localIdentityKeyPrivate === "string")
                        $util.base64.decode(d.localIdentityKeyPrivate, m.localIdentityKeyPrivate = $util.newBuffer($util.base64.length(d.localIdentityKeyPrivate)), 0);
                    else if (d.localIdentityKeyPrivate.length >= 0)
                        m.localIdentityKeyPrivate = d.localIdentityKeyPrivate;
                }
                return m;
            };

            PendingKeyExchange.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.sequence != null && m.hasOwnProperty("sequence")) {
                    d.sequence = m.sequence;
                    if (o.oneofs)
                        d._sequence = "sequence";
                }
                if (m.localBaseKey != null && m.hasOwnProperty("localBaseKey")) {
                    d.localBaseKey = o.bytes === String ? $util.base64.encode(m.localBaseKey, 0, m.localBaseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localBaseKey) : m.localBaseKey;
                    if (o.oneofs)
                        d._localBaseKey = "localBaseKey";
                }
                if (m.localBaseKeyPrivate != null && m.hasOwnProperty("localBaseKeyPrivate")) {
                    d.localBaseKeyPrivate = o.bytes === String ? $util.base64.encode(m.localBaseKeyPrivate, 0, m.localBaseKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localBaseKeyPrivate) : m.localBaseKeyPrivate;
                    if (o.oneofs)
                        d._localBaseKeyPrivate = "localBaseKeyPrivate";
                }
                if (m.localRatchetKey != null && m.hasOwnProperty("localRatchetKey")) {
                    d.localRatchetKey = o.bytes === String ? $util.base64.encode(m.localRatchetKey, 0, m.localRatchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localRatchetKey) : m.localRatchetKey;
                    if (o.oneofs)
                        d._localRatchetKey = "localRatchetKey";
                }
                if (m.localRatchetKeyPrivate != null && m.hasOwnProperty("localRatchetKeyPrivate")) {
                    d.localRatchetKeyPrivate = o.bytes === String ? $util.base64.encode(m.localRatchetKeyPrivate, 0, m.localRatchetKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localRatchetKeyPrivate) : m.localRatchetKeyPrivate;
                    if (o.oneofs)
                        d._localRatchetKeyPrivate = "localRatchetKeyPrivate";
                }
                if (m.localIdentityKey != null && m.hasOwnProperty("localIdentityKey")) {
                    d.localIdentityKey = o.bytes === String ? $util.base64.encode(m.localIdentityKey, 0, m.localIdentityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityKey) : m.localIdentityKey;
                    if (o.oneofs)
                        d._localIdentityKey = "localIdentityKey";
                }
                if (m.localIdentityKeyPrivate != null && m.hasOwnProperty("localIdentityKeyPrivate")) {
                    d.localIdentityKeyPrivate = o.bytes === String ? $util.base64.encode(m.localIdentityKeyPrivate, 0, m.localIdentityKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityKeyPrivate) : m.localIdentityKeyPrivate;
                    if (o.oneofs)
                        d._localIdentityKeyPrivate = "localIdentityKeyPrivate";
                }
                return d;
            };

            PendingKeyExchange.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PendingKeyExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SessionStructure.PendingKeyExchange";
            };

            return PendingKeyExchange;
        })();

        SessionStructure.PendingPreKey = (function() {

            function PendingPreKey(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PendingPreKey.prototype.preKeyId = null;
            PendingPreKey.prototype.signedPreKeyId = null;
            PendingPreKey.prototype.baseKey = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingPreKey.prototype, "_preKeyId", {
                get: $util.oneOfGetter($oneOfFields = ["preKeyId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingPreKey.prototype, "_signedPreKeyId", {
                get: $util.oneOfGetter($oneOfFields = ["signedPreKeyId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PendingPreKey.prototype, "_baseKey", {
                get: $util.oneOfGetter($oneOfFields = ["baseKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PendingPreKey.create = function create(properties) {
                return new PendingPreKey(properties);
            };

            PendingPreKey.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.preKeyId != null && Object.hasOwnProperty.call(m, "preKeyId"))
                    w.uint32(8).uint32(m.preKeyId);
                if (m.baseKey != null && Object.hasOwnProperty.call(m, "baseKey"))
                    w.uint32(18).bytes(m.baseKey);
                if (m.signedPreKeyId != null && Object.hasOwnProperty.call(m, "signedPreKeyId"))
                    w.uint32(24).int32(m.signedPreKeyId);
                return w;
            };

            PendingPreKey.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.PendingPreKey();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.preKeyId = r.uint32();
                            break;
                        }
                    case 3: {
                            m.signedPreKeyId = r.int32();
                            break;
                        }
                    case 2: {
                            m.baseKey = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PendingPreKey.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SessionStructure.PendingPreKey)
                    return d;
                var m = new $root.proto.SessionStructure.PendingPreKey();
                if (d.preKeyId != null) {
                    m.preKeyId = d.preKeyId >>> 0;
                }
                if (d.signedPreKeyId != null) {
                    m.signedPreKeyId = d.signedPreKeyId | 0;
                }
                if (d.baseKey != null) {
                    if (typeof d.baseKey === "string")
                        $util.base64.decode(d.baseKey, m.baseKey = $util.newBuffer($util.base64.length(d.baseKey)), 0);
                    else if (d.baseKey.length >= 0)
                        m.baseKey = d.baseKey;
                }
                return m;
            };

            PendingPreKey.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.preKeyId != null && m.hasOwnProperty("preKeyId")) {
                    d.preKeyId = m.preKeyId;
                    if (o.oneofs)
                        d._preKeyId = "preKeyId";
                }
                if (m.baseKey != null && m.hasOwnProperty("baseKey")) {
                    d.baseKey = o.bytes === String ? $util.base64.encode(m.baseKey, 0, m.baseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKey) : m.baseKey;
                    if (o.oneofs)
                        d._baseKey = "baseKey";
                }
                if (m.signedPreKeyId != null && m.hasOwnProperty("signedPreKeyId")) {
                    d.signedPreKeyId = m.signedPreKeyId;
                    if (o.oneofs)
                        d._signedPreKeyId = "signedPreKeyId";
                }
                return d;
            };

            PendingPreKey.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PendingPreKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SessionStructure.PendingPreKey";
            };

            return PendingPreKey;
        })();

        return SessionStructure;
    })();

    proto.SessionTransparencyMetadata = (function() {

        function SessionTransparencyMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SessionTransparencyMetadata.prototype.disclaimerText = null;
        SessionTransparencyMetadata.prototype.hcaId = null;
        SessionTransparencyMetadata.prototype.sessionTransparencyType = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionTransparencyMetadata.prototype, "_disclaimerText", {
            get: $util.oneOfGetter($oneOfFields = ["disclaimerText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionTransparencyMetadata.prototype, "_hcaId", {
            get: $util.oneOfGetter($oneOfFields = ["hcaId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SessionTransparencyMetadata.prototype, "_sessionTransparencyType", {
            get: $util.oneOfGetter($oneOfFields = ["sessionTransparencyType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SessionTransparencyMetadata.create = function create(properties) {
            return new SessionTransparencyMetadata(properties);
        };

        SessionTransparencyMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.disclaimerText != null && Object.hasOwnProperty.call(m, "disclaimerText"))
                w.uint32(10).string(m.disclaimerText);
            if (m.hcaId != null && Object.hasOwnProperty.call(m, "hcaId"))
                w.uint32(18).string(m.hcaId);
            if (m.sessionTransparencyType != null && Object.hasOwnProperty.call(m, "sessionTransparencyType"))
                w.uint32(24).int32(m.sessionTransparencyType);
            return w;
        };

        SessionTransparencyMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionTransparencyMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.disclaimerText = r.string();
                        break;
                    }
                case 2: {
                        m.hcaId = r.string();
                        break;
                    }
                case 3: {
                        m.sessionTransparencyType = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SessionTransparencyMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SessionTransparencyMetadata)
                return d;
            var m = new $root.proto.SessionTransparencyMetadata();
            if (d.disclaimerText != null) {
                m.disclaimerText = String(d.disclaimerText);
            }
            if (d.hcaId != null) {
                m.hcaId = String(d.hcaId);
            }
            switch (d.sessionTransparencyType) {
            default:
                if (typeof d.sessionTransparencyType === "number") {
                    m.sessionTransparencyType = d.sessionTransparencyType;
                    break;
                }
                break;
            case "UNKNOWN_TYPE":
            case 0:
                m.sessionTransparencyType = 0;
                break;
            case "NY_AI_SAFETY_DISCLAIMER":
            case 1:
                m.sessionTransparencyType = 1;
                break;
            }
            return m;
        };

        SessionTransparencyMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.disclaimerText != null && m.hasOwnProperty("disclaimerText")) {
                d.disclaimerText = m.disclaimerText;
                if (o.oneofs)
                    d._disclaimerText = "disclaimerText";
            }
            if (m.hcaId != null && m.hasOwnProperty("hcaId")) {
                d.hcaId = m.hcaId;
                if (o.oneofs)
                    d._hcaId = "hcaId";
            }
            if (m.sessionTransparencyType != null && m.hasOwnProperty("sessionTransparencyType")) {
                d.sessionTransparencyType = o.enums === String ? $root.proto.SessionTransparencyType[m.sessionTransparencyType] === undefined ? m.sessionTransparencyType : $root.proto.SessionTransparencyType[m.sessionTransparencyType] : m.sessionTransparencyType;
                if (o.oneofs)
                    d._sessionTransparencyType = "sessionTransparencyType";
            }
            return d;
        };

        SessionTransparencyMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SessionTransparencyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SessionTransparencyMetadata";
        };

        return SessionTransparencyMetadata;
    })();

    proto.SessionTransparencyType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UNKNOWN_TYPE"] = 0;
        values[valuesById[1] = "NY_AI_SAFETY_DISCLAIMER"] = 1;
        return values;
    })();

    proto.SignalMessage = (function() {

        function SignalMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SignalMessage.prototype.ratchetKey = null;
        SignalMessage.prototype.counter = null;
        SignalMessage.prototype.previousCounter = null;
        SignalMessage.prototype.ciphertext = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignalMessage.prototype, "_ratchetKey", {
            get: $util.oneOfGetter($oneOfFields = ["ratchetKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignalMessage.prototype, "_counter", {
            get: $util.oneOfGetter($oneOfFields = ["counter"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignalMessage.prototype, "_previousCounter", {
            get: $util.oneOfGetter($oneOfFields = ["previousCounter"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignalMessage.prototype, "_ciphertext", {
            get: $util.oneOfGetter($oneOfFields = ["ciphertext"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SignalMessage.create = function create(properties) {
            return new SignalMessage(properties);
        };

        SignalMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.ratchetKey != null && Object.hasOwnProperty.call(m, "ratchetKey"))
                w.uint32(10).bytes(m.ratchetKey);
            if (m.counter != null && Object.hasOwnProperty.call(m, "counter"))
                w.uint32(16).uint32(m.counter);
            if (m.previousCounter != null && Object.hasOwnProperty.call(m, "previousCounter"))
                w.uint32(24).uint32(m.previousCounter);
            if (m.ciphertext != null && Object.hasOwnProperty.call(m, "ciphertext"))
                w.uint32(34).bytes(m.ciphertext);
            return w;
        };

        SignalMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignalMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.ratchetKey = r.bytes();
                        break;
                    }
                case 2: {
                        m.counter = r.uint32();
                        break;
                    }
                case 3: {
                        m.previousCounter = r.uint32();
                        break;
                    }
                case 4: {
                        m.ciphertext = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SignalMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SignalMessage)
                return d;
            var m = new $root.proto.SignalMessage();
            if (d.ratchetKey != null) {
                if (typeof d.ratchetKey === "string")
                    $util.base64.decode(d.ratchetKey, m.ratchetKey = $util.newBuffer($util.base64.length(d.ratchetKey)), 0);
                else if (d.ratchetKey.length >= 0)
                    m.ratchetKey = d.ratchetKey;
            }
            if (d.counter != null) {
                m.counter = d.counter >>> 0;
            }
            if (d.previousCounter != null) {
                m.previousCounter = d.previousCounter >>> 0;
            }
            if (d.ciphertext != null) {
                if (typeof d.ciphertext === "string")
                    $util.base64.decode(d.ciphertext, m.ciphertext = $util.newBuffer($util.base64.length(d.ciphertext)), 0);
                else if (d.ciphertext.length >= 0)
                    m.ciphertext = d.ciphertext;
            }
            return m;
        };

        SignalMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.ratchetKey != null && m.hasOwnProperty("ratchetKey")) {
                d.ratchetKey = o.bytes === String ? $util.base64.encode(m.ratchetKey, 0, m.ratchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.ratchetKey) : m.ratchetKey;
                if (o.oneofs)
                    d._ratchetKey = "ratchetKey";
            }
            if (m.counter != null && m.hasOwnProperty("counter")) {
                d.counter = m.counter;
                if (o.oneofs)
                    d._counter = "counter";
            }
            if (m.previousCounter != null && m.hasOwnProperty("previousCounter")) {
                d.previousCounter = m.previousCounter;
                if (o.oneofs)
                    d._previousCounter = "previousCounter";
            }
            if (m.ciphertext != null && m.hasOwnProperty("ciphertext")) {
                d.ciphertext = o.bytes === String ? $util.base64.encode(m.ciphertext, 0, m.ciphertext.length) : o.bytes === Array ? Array.prototype.slice.call(m.ciphertext) : m.ciphertext;
                if (o.oneofs)
                    d._ciphertext = "ciphertext";
            }
            return d;
        };

        SignalMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SignalMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SignalMessage";
        };

        return SignalMessage;
    })();

    proto.SignedPreKeyRecordStructure = (function() {

        function SignedPreKeyRecordStructure(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SignedPreKeyRecordStructure.prototype.id = null;
        SignedPreKeyRecordStructure.prototype.publicKey = null;
        SignedPreKeyRecordStructure.prototype.privateKey = null;
        SignedPreKeyRecordStructure.prototype.signature = null;
        SignedPreKeyRecordStructure.prototype.timestamp = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_id", {
            get: $util.oneOfGetter($oneOfFields = ["id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_publicKey", {
            get: $util.oneOfGetter($oneOfFields = ["publicKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_privateKey", {
            get: $util.oneOfGetter($oneOfFields = ["privateKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_signature", {
            get: $util.oneOfGetter($oneOfFields = ["signature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_timestamp", {
            get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SignedPreKeyRecordStructure.create = function create(properties) {
            return new SignedPreKeyRecordStructure(properties);
        };

        SignedPreKeyRecordStructure.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(8).uint32(m.id);
            if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey"))
                w.uint32(18).bytes(m.publicKey);
            if (m.privateKey != null && Object.hasOwnProperty.call(m, "privateKey"))
                w.uint32(26).bytes(m.privateKey);
            if (m.signature != null && Object.hasOwnProperty.call(m, "signature"))
                w.uint32(34).bytes(m.signature);
            if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                w.uint32(41).fixed64(m.timestamp);
            return w;
        };

        SignedPreKeyRecordStructure.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignedPreKeyRecordStructure();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.id = r.uint32();
                        break;
                    }
                case 2: {
                        m.publicKey = r.bytes();
                        break;
                    }
                case 3: {
                        m.privateKey = r.bytes();
                        break;
                    }
                case 4: {
                        m.signature = r.bytes();
                        break;
                    }
                case 5: {
                        m.timestamp = r.fixed64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SignedPreKeyRecordStructure.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SignedPreKeyRecordStructure)
                return d;
            var m = new $root.proto.SignedPreKeyRecordStructure();
            if (d.id != null) {
                m.id = d.id >>> 0;
            }
            if (d.publicKey != null) {
                if (typeof d.publicKey === "string")
                    $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0);
                else if (d.publicKey.length >= 0)
                    m.publicKey = d.publicKey;
            }
            if (d.privateKey != null) {
                if (typeof d.privateKey === "string")
                    $util.base64.decode(d.privateKey, m.privateKey = $util.newBuffer($util.base64.length(d.privateKey)), 0);
                else if (d.privateKey.length >= 0)
                    m.privateKey = d.privateKey;
            }
            if (d.signature != null) {
                if (typeof d.signature === "string")
                    $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0);
                else if (d.signature.length >= 0)
                    m.signature = d.signature;
            }
            if (d.timestamp != null) {
                if ($util.Long)
                    (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                else if (typeof d.timestamp === "string")
                    m.timestamp = parseInt(d.timestamp, 10);
                else if (typeof d.timestamp === "number")
                    m.timestamp = d.timestamp;
                else if (typeof d.timestamp === "object")
                    m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
            }
            return m;
        };

        SignedPreKeyRecordStructure.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.id != null && m.hasOwnProperty("id")) {
                d.id = m.id;
                if (o.oneofs)
                    d._id = "id";
            }
            if (m.publicKey != null && m.hasOwnProperty("publicKey")) {
                d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey;
                if (o.oneofs)
                    d._publicKey = "publicKey";
            }
            if (m.privateKey != null && m.hasOwnProperty("privateKey")) {
                d.privateKey = o.bytes === String ? $util.base64.encode(m.privateKey, 0, m.privateKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.privateKey) : m.privateKey;
                if (o.oneofs)
                    d._privateKey = "privateKey";
            }
            if (m.signature != null && m.hasOwnProperty("signature")) {
                d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature;
                if (o.oneofs)
                    d._signature = "signature";
            }
            if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                if (typeof m.timestamp === "number")
                    d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                else
                    d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                if (o.oneofs)
                    d._timestamp = "timestamp";
            }
            return d;
        };

        SignedPreKeyRecordStructure.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SignedPreKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SignedPreKeyRecordStructure";
        };

        return SignedPreKeyRecordStructure;
    })();

    proto.StatusAttribution = (function() {

        function StatusAttribution(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        StatusAttribution.prototype.type = null;
        StatusAttribution.prototype.actionUrl = null;
        StatusAttribution.prototype.statusReshare = null;
        StatusAttribution.prototype.externalShare = null;
        StatusAttribution.prototype.music = null;
        StatusAttribution.prototype.groupStatus = null;
        StatusAttribution.prototype.rlAttribution = null;
        StatusAttribution.prototype.aiCreatedAttribution = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StatusAttribution.prototype, "_type", {
            get: $util.oneOfGetter($oneOfFields = ["type"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StatusAttribution.prototype, "_actionUrl", {
            get: $util.oneOfGetter($oneOfFields = ["actionUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Object.defineProperty(StatusAttribution.prototype, "attributionData", {
            get: $util.oneOfGetter($oneOfFields = ["statusReshare", "externalShare", "music", "groupStatus", "rlAttribution", "aiCreatedAttribution"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        StatusAttribution.create = function create(properties) {
            return new StatusAttribution(properties);
        };

        StatusAttribution.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                w.uint32(8).int32(m.type);
            if (m.actionUrl != null && Object.hasOwnProperty.call(m, "actionUrl"))
                w.uint32(18).string(m.actionUrl);
            if (m.statusReshare != null && Object.hasOwnProperty.call(m, "statusReshare"))
                $root.proto.StatusAttribution.StatusReshare.encode(m.statusReshare, w.uint32(26).fork()).ldelim();
            if (m.externalShare != null && Object.hasOwnProperty.call(m, "externalShare"))
                $root.proto.StatusAttribution.ExternalShare.encode(m.externalShare, w.uint32(34).fork()).ldelim();
            if (m.music != null && Object.hasOwnProperty.call(m, "music"))
                $root.proto.StatusAttribution.Music.encode(m.music, w.uint32(42).fork()).ldelim();
            if (m.groupStatus != null && Object.hasOwnProperty.call(m, "groupStatus"))
                $root.proto.StatusAttribution.GroupStatus.encode(m.groupStatus, w.uint32(50).fork()).ldelim();
            if (m.rlAttribution != null && Object.hasOwnProperty.call(m, "rlAttribution"))
                $root.proto.StatusAttribution.RLAttribution.encode(m.rlAttribution, w.uint32(58).fork()).ldelim();
            if (m.aiCreatedAttribution != null && Object.hasOwnProperty.call(m, "aiCreatedAttribution"))
                $root.proto.StatusAttribution.AiCreatedAttribution.encode(m.aiCreatedAttribution, w.uint32(66).fork()).ldelim();
            return w;
        };

        StatusAttribution.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusAttribution();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.type = r.int32();
                        break;
                    }
                case 2: {
                        m.actionUrl = r.string();
                        break;
                    }
                case 3: {
                        m.statusReshare = $root.proto.StatusAttribution.StatusReshare.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.externalShare = $root.proto.StatusAttribution.ExternalShare.decode(r, r.uint32());
                        break;
                    }
                case 5: {
                        m.music = $root.proto.StatusAttribution.Music.decode(r, r.uint32());
                        break;
                    }
                case 6: {
                        m.groupStatus = $root.proto.StatusAttribution.GroupStatus.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.rlAttribution = $root.proto.StatusAttribution.RLAttribution.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.aiCreatedAttribution = $root.proto.StatusAttribution.AiCreatedAttribution.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        StatusAttribution.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.StatusAttribution)
                return d;
            var m = new $root.proto.StatusAttribution();
            switch (d.type) {
            default:
                if (typeof d.type === "number") {
                    m.type = d.type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.type = 0;
                break;
            case "RESHARE":
            case 1:
                m.type = 1;
                break;
            case "EXTERNAL_SHARE":
            case 2:
                m.type = 2;
                break;
            case "MUSIC":
            case 3:
                m.type = 3;
                break;
            case "STATUS_MENTION":
            case 4:
                m.type = 4;
                break;
            case "GROUP_STATUS":
            case 5:
                m.type = 5;
                break;
            case "RL_ATTRIBUTION":
            case 6:
                m.type = 6;
                break;
            case "AI_CREATED":
            case 7:
                m.type = 7;
                break;
            case "LAYOUTS":
            case 8:
                m.type = 8;
                break;
            }
            if (d.actionUrl != null) {
                m.actionUrl = String(d.actionUrl);
            }
            if (d.statusReshare != null) {
                if (typeof d.statusReshare !== "object")
                    throw TypeError(".proto.StatusAttribution.statusReshare: object expected");
                m.statusReshare = $root.proto.StatusAttribution.StatusReshare.fromObject(d.statusReshare);
            }
            if (d.externalShare != null) {
                if (typeof d.externalShare !== "object")
                    throw TypeError(".proto.StatusAttribution.externalShare: object expected");
                m.externalShare = $root.proto.StatusAttribution.ExternalShare.fromObject(d.externalShare);
            }
            if (d.music != null) {
                if (typeof d.music !== "object")
                    throw TypeError(".proto.StatusAttribution.music: object expected");
                m.music = $root.proto.StatusAttribution.Music.fromObject(d.music);
            }
            if (d.groupStatus != null) {
                if (typeof d.groupStatus !== "object")
                    throw TypeError(".proto.StatusAttribution.groupStatus: object expected");
                m.groupStatus = $root.proto.StatusAttribution.GroupStatus.fromObject(d.groupStatus);
            }
            if (d.rlAttribution != null) {
                if (typeof d.rlAttribution !== "object")
                    throw TypeError(".proto.StatusAttribution.rlAttribution: object expected");
                m.rlAttribution = $root.proto.StatusAttribution.RLAttribution.fromObject(d.rlAttribution);
            }
            if (d.aiCreatedAttribution != null) {
                if (typeof d.aiCreatedAttribution !== "object")
                    throw TypeError(".proto.StatusAttribution.aiCreatedAttribution: object expected");
                m.aiCreatedAttribution = $root.proto.StatusAttribution.AiCreatedAttribution.fromObject(d.aiCreatedAttribution);
            }
            return m;
        };

        StatusAttribution.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.type != null && m.hasOwnProperty("type")) {
                d.type = o.enums === String ? $root.proto.StatusAttribution.Type[m.type] === undefined ? m.type : $root.proto.StatusAttribution.Type[m.type] : m.type;
                if (o.oneofs)
                    d._type = "type";
            }
            if (m.actionUrl != null && m.hasOwnProperty("actionUrl")) {
                d.actionUrl = m.actionUrl;
                if (o.oneofs)
                    d._actionUrl = "actionUrl";
            }
            if (m.statusReshare != null && m.hasOwnProperty("statusReshare")) {
                d.statusReshare = $root.proto.StatusAttribution.StatusReshare.toObject(m.statusReshare, o);
                if (o.oneofs)
                    d.attributionData = "statusReshare";
            }
            if (m.externalShare != null && m.hasOwnProperty("externalShare")) {
                d.externalShare = $root.proto.StatusAttribution.ExternalShare.toObject(m.externalShare, o);
                if (o.oneofs)
                    d.attributionData = "externalShare";
            }
            if (m.music != null && m.hasOwnProperty("music")) {
                d.music = $root.proto.StatusAttribution.Music.toObject(m.music, o);
                if (o.oneofs)
                    d.attributionData = "music";
            }
            if (m.groupStatus != null && m.hasOwnProperty("groupStatus")) {
                d.groupStatus = $root.proto.StatusAttribution.GroupStatus.toObject(m.groupStatus, o);
                if (o.oneofs)
                    d.attributionData = "groupStatus";
            }
            if (m.rlAttribution != null && m.hasOwnProperty("rlAttribution")) {
                d.rlAttribution = $root.proto.StatusAttribution.RLAttribution.toObject(m.rlAttribution, o);
                if (o.oneofs)
                    d.attributionData = "rlAttribution";
            }
            if (m.aiCreatedAttribution != null && m.hasOwnProperty("aiCreatedAttribution")) {
                d.aiCreatedAttribution = $root.proto.StatusAttribution.AiCreatedAttribution.toObject(m.aiCreatedAttribution, o);
                if (o.oneofs)
                    d.attributionData = "aiCreatedAttribution";
            }
            return d;
        };

        StatusAttribution.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        StatusAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.StatusAttribution";
        };

        StatusAttribution.AiCreatedAttribution = (function() {

            function AiCreatedAttribution(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AiCreatedAttribution.prototype.source = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AiCreatedAttribution.prototype, "_source", {
                get: $util.oneOfGetter($oneOfFields = ["source"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AiCreatedAttribution.create = function create(properties) {
                return new AiCreatedAttribution(properties);
            };

            AiCreatedAttribution.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.source != null && Object.hasOwnProperty.call(m, "source"))
                    w.uint32(8).int32(m.source);
                return w;
            };

            AiCreatedAttribution.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusAttribution.AiCreatedAttribution();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.source = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AiCreatedAttribution.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.StatusAttribution.AiCreatedAttribution)
                    return d;
                var m = new $root.proto.StatusAttribution.AiCreatedAttribution();
                switch (d.source) {
                default:
                    if (typeof d.source === "number") {
                        m.source = d.source;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.source = 0;
                    break;
                case "STATUS_MIMICRY":
                case 1:
                    m.source = 1;
                    break;
                }
                return m;
            };

            AiCreatedAttribution.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.source != null && m.hasOwnProperty("source")) {
                    d.source = o.enums === String ? $root.proto.StatusAttribution.AiCreatedAttribution.Source[m.source] === undefined ? m.source : $root.proto.StatusAttribution.AiCreatedAttribution.Source[m.source] : m.source;
                    if (o.oneofs)
                        d._source = "source";
                }
                return d;
            };

            AiCreatedAttribution.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AiCreatedAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.StatusAttribution.AiCreatedAttribution";
            };

            AiCreatedAttribution.Source = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "STATUS_MIMICRY"] = 1;
                return values;
            })();

            return AiCreatedAttribution;
        })();

        StatusAttribution.ExternalShare = (function() {

            function ExternalShare(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ExternalShare.prototype.actionUrl = null;
            ExternalShare.prototype.source = null;
            ExternalShare.prototype.duration = null;
            ExternalShare.prototype.actionFallbackUrl = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalShare.prototype, "_actionUrl", {
                get: $util.oneOfGetter($oneOfFields = ["actionUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalShare.prototype, "_source", {
                get: $util.oneOfGetter($oneOfFields = ["source"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalShare.prototype, "_duration", {
                get: $util.oneOfGetter($oneOfFields = ["duration"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalShare.prototype, "_actionFallbackUrl", {
                get: $util.oneOfGetter($oneOfFields = ["actionFallbackUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ExternalShare.create = function create(properties) {
                return new ExternalShare(properties);
            };

            ExternalShare.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.actionUrl != null && Object.hasOwnProperty.call(m, "actionUrl"))
                    w.uint32(10).string(m.actionUrl);
                if (m.source != null && Object.hasOwnProperty.call(m, "source"))
                    w.uint32(16).int32(m.source);
                if (m.duration != null && Object.hasOwnProperty.call(m, "duration"))
                    w.uint32(24).int32(m.duration);
                if (m.actionFallbackUrl != null && Object.hasOwnProperty.call(m, "actionFallbackUrl"))
                    w.uint32(34).string(m.actionFallbackUrl);
                return w;
            };

            ExternalShare.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusAttribution.ExternalShare();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.actionUrl = r.string();
                            break;
                        }
                    case 2: {
                            m.source = r.int32();
                            break;
                        }
                    case 3: {
                            m.duration = r.int32();
                            break;
                        }
                    case 4: {
                            m.actionFallbackUrl = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ExternalShare.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.StatusAttribution.ExternalShare)
                    return d;
                var m = new $root.proto.StatusAttribution.ExternalShare();
                if (d.actionUrl != null) {
                    m.actionUrl = String(d.actionUrl);
                }
                switch (d.source) {
                default:
                    if (typeof d.source === "number") {
                        m.source = d.source;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.source = 0;
                    break;
                case "INSTAGRAM":
                case 1:
                    m.source = 1;
                    break;
                case "FACEBOOK":
                case 2:
                    m.source = 2;
                    break;
                case "MESSENGER":
                case 3:
                    m.source = 3;
                    break;
                case "SPOTIFY":
                case 4:
                    m.source = 4;
                    break;
                case "YOUTUBE":
                case 5:
                    m.source = 5;
                    break;
                case "PINTEREST":
                case 6:
                    m.source = 6;
                    break;
                case "THREADS":
                case 7:
                    m.source = 7;
                    break;
                case "APPLE_MUSIC":
                case 8:
                    m.source = 8;
                    break;
                case "SHARECHAT":
                case 9:
                    m.source = 9;
                    break;
                case "GOOGLE_PHOTOS":
                case 10:
                    m.source = 10;
                    break;
                }
                if (d.duration != null) {
                    m.duration = d.duration | 0;
                }
                if (d.actionFallbackUrl != null) {
                    m.actionFallbackUrl = String(d.actionFallbackUrl);
                }
                return m;
            };

            ExternalShare.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.actionUrl != null && m.hasOwnProperty("actionUrl")) {
                    d.actionUrl = m.actionUrl;
                    if (o.oneofs)
                        d._actionUrl = "actionUrl";
                }
                if (m.source != null && m.hasOwnProperty("source")) {
                    d.source = o.enums === String ? $root.proto.StatusAttribution.ExternalShare.Source[m.source] === undefined ? m.source : $root.proto.StatusAttribution.ExternalShare.Source[m.source] : m.source;
                    if (o.oneofs)
                        d._source = "source";
                }
                if (m.duration != null && m.hasOwnProperty("duration")) {
                    d.duration = m.duration;
                    if (o.oneofs)
                        d._duration = "duration";
                }
                if (m.actionFallbackUrl != null && m.hasOwnProperty("actionFallbackUrl")) {
                    d.actionFallbackUrl = m.actionFallbackUrl;
                    if (o.oneofs)
                        d._actionFallbackUrl = "actionFallbackUrl";
                }
                return d;
            };

            ExternalShare.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ExternalShare.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.StatusAttribution.ExternalShare";
            };

            ExternalShare.Source = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "INSTAGRAM"] = 1;
                values[valuesById[2] = "FACEBOOK"] = 2;
                values[valuesById[3] = "MESSENGER"] = 3;
                values[valuesById[4] = "SPOTIFY"] = 4;
                values[valuesById[5] = "YOUTUBE"] = 5;
                values[valuesById[6] = "PINTEREST"] = 6;
                values[valuesById[7] = "THREADS"] = 7;
                values[valuesById[8] = "APPLE_MUSIC"] = 8;
                values[valuesById[9] = "SHARECHAT"] = 9;
                values[valuesById[10] = "GOOGLE_PHOTOS"] = 10;
                return values;
            })();

            return ExternalShare;
        })();

        StatusAttribution.GroupStatus = (function() {

            function GroupStatus(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            GroupStatus.prototype.authorJid = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(GroupStatus.prototype, "_authorJid", {
                get: $util.oneOfGetter($oneOfFields = ["authorJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            GroupStatus.create = function create(properties) {
                return new GroupStatus(properties);
            };

            GroupStatus.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.authorJid != null && Object.hasOwnProperty.call(m, "authorJid"))
                    w.uint32(10).string(m.authorJid);
                return w;
            };

            GroupStatus.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusAttribution.GroupStatus();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.authorJid = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            GroupStatus.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.StatusAttribution.GroupStatus)
                    return d;
                var m = new $root.proto.StatusAttribution.GroupStatus();
                if (d.authorJid != null) {
                    m.authorJid = String(d.authorJid);
                }
                return m;
            };

            GroupStatus.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.authorJid != null && m.hasOwnProperty("authorJid")) {
                    d.authorJid = m.authorJid;
                    if (o.oneofs)
                        d._authorJid = "authorJid";
                }
                return d;
            };

            GroupStatus.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            GroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.StatusAttribution.GroupStatus";
            };

            return GroupStatus;
        })();

        StatusAttribution.Music = (function() {

            function Music(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            Music.prototype.authorName = null;
            Music.prototype.songId = null;
            Music.prototype.title = null;
            Music.prototype.author = null;
            Music.prototype.artistAttribution = null;
            Music.prototype.isExplicit = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Music.prototype, "_authorName", {
                get: $util.oneOfGetter($oneOfFields = ["authorName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Music.prototype, "_songId", {
                get: $util.oneOfGetter($oneOfFields = ["songId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Music.prototype, "_title", {
                get: $util.oneOfGetter($oneOfFields = ["title"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Music.prototype, "_author", {
                get: $util.oneOfGetter($oneOfFields = ["author"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Music.prototype, "_artistAttribution", {
                get: $util.oneOfGetter($oneOfFields = ["artistAttribution"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Music.prototype, "_isExplicit", {
                get: $util.oneOfGetter($oneOfFields = ["isExplicit"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Music.create = function create(properties) {
                return new Music(properties);
            };

            Music.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.authorName != null && Object.hasOwnProperty.call(m, "authorName"))
                    w.uint32(10).string(m.authorName);
                if (m.songId != null && Object.hasOwnProperty.call(m, "songId"))
                    w.uint32(18).string(m.songId);
                if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                    w.uint32(26).string(m.title);
                if (m.author != null && Object.hasOwnProperty.call(m, "author"))
                    w.uint32(34).string(m.author);
                if (m.artistAttribution != null && Object.hasOwnProperty.call(m, "artistAttribution"))
                    w.uint32(42).string(m.artistAttribution);
                if (m.isExplicit != null && Object.hasOwnProperty.call(m, "isExplicit"))
                    w.uint32(48).bool(m.isExplicit);
                return w;
            };

            Music.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusAttribution.Music();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.authorName = r.string();
                            break;
                        }
                    case 2: {
                            m.songId = r.string();
                            break;
                        }
                    case 3: {
                            m.title = r.string();
                            break;
                        }
                    case 4: {
                            m.author = r.string();
                            break;
                        }
                    case 5: {
                            m.artistAttribution = r.string();
                            break;
                        }
                    case 6: {
                            m.isExplicit = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            Music.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.StatusAttribution.Music)
                    return d;
                var m = new $root.proto.StatusAttribution.Music();
                if (d.authorName != null) {
                    m.authorName = String(d.authorName);
                }
                if (d.songId != null) {
                    m.songId = String(d.songId);
                }
                if (d.title != null) {
                    m.title = String(d.title);
                }
                if (d.author != null) {
                    m.author = String(d.author);
                }
                if (d.artistAttribution != null) {
                    m.artistAttribution = String(d.artistAttribution);
                }
                if (d.isExplicit != null) {
                    m.isExplicit = Boolean(d.isExplicit);
                }
                return m;
            };

            Music.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.authorName != null && m.hasOwnProperty("authorName")) {
                    d.authorName = m.authorName;
                    if (o.oneofs)
                        d._authorName = "authorName";
                }
                if (m.songId != null && m.hasOwnProperty("songId")) {
                    d.songId = m.songId;
                    if (o.oneofs)
                        d._songId = "songId";
                }
                if (m.title != null && m.hasOwnProperty("title")) {
                    d.title = m.title;
                    if (o.oneofs)
                        d._title = "title";
                }
                if (m.author != null && m.hasOwnProperty("author")) {
                    d.author = m.author;
                    if (o.oneofs)
                        d._author = "author";
                }
                if (m.artistAttribution != null && m.hasOwnProperty("artistAttribution")) {
                    d.artistAttribution = m.artistAttribution;
                    if (o.oneofs)
                        d._artistAttribution = "artistAttribution";
                }
                if (m.isExplicit != null && m.hasOwnProperty("isExplicit")) {
                    d.isExplicit = m.isExplicit;
                    if (o.oneofs)
                        d._isExplicit = "isExplicit";
                }
                return d;
            };

            Music.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            Music.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.StatusAttribution.Music";
            };

            return Music;
        })();

        StatusAttribution.RLAttribution = (function() {

            function RLAttribution(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            RLAttribution.prototype.source = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RLAttribution.prototype, "_source", {
                get: $util.oneOfGetter($oneOfFields = ["source"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            RLAttribution.create = function create(properties) {
                return new RLAttribution(properties);
            };

            RLAttribution.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.source != null && Object.hasOwnProperty.call(m, "source"))
                    w.uint32(8).int32(m.source);
                return w;
            };

            RLAttribution.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusAttribution.RLAttribution();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.source = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            RLAttribution.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.StatusAttribution.RLAttribution)
                    return d;
                var m = new $root.proto.StatusAttribution.RLAttribution();
                switch (d.source) {
                default:
                    if (typeof d.source === "number") {
                        m.source = d.source;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.source = 0;
                    break;
                case "RAY_BAN_META_GLASSES":
                case 1:
                    m.source = 1;
                    break;
                case "OAKLEY_META_GLASSES":
                case 2:
                    m.source = 2;
                    break;
                case "HYPERNOVA_GLASSES":
                case 3:
                    m.source = 3;
                    break;
                }
                return m;
            };

            RLAttribution.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.source != null && m.hasOwnProperty("source")) {
                    d.source = o.enums === String ? $root.proto.StatusAttribution.RLAttribution.Source[m.source] === undefined ? m.source : $root.proto.StatusAttribution.RLAttribution.Source[m.source] : m.source;
                    if (o.oneofs)
                        d._source = "source";
                }
                return d;
            };

            RLAttribution.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            RLAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.StatusAttribution.RLAttribution";
            };

            RLAttribution.Source = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "RAY_BAN_META_GLASSES"] = 1;
                values[valuesById[2] = "OAKLEY_META_GLASSES"] = 2;
                values[valuesById[3] = "HYPERNOVA_GLASSES"] = 3;
                return values;
            })();

            return RLAttribution;
        })();

        StatusAttribution.StatusReshare = (function() {

            function StatusReshare(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StatusReshare.prototype.source = null;
            StatusReshare.prototype.metadata = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusReshare.prototype, "_source", {
                get: $util.oneOfGetter($oneOfFields = ["source"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusReshare.prototype, "_metadata", {
                get: $util.oneOfGetter($oneOfFields = ["metadata"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StatusReshare.create = function create(properties) {
                return new StatusReshare(properties);
            };

            StatusReshare.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.source != null && Object.hasOwnProperty.call(m, "source"))
                    w.uint32(8).int32(m.source);
                if (m.metadata != null && Object.hasOwnProperty.call(m, "metadata"))
                    $root.proto.StatusAttribution.StatusReshare.Metadata.encode(m.metadata, w.uint32(18).fork()).ldelim();
                return w;
            };

            StatusReshare.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusAttribution.StatusReshare();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.source = r.int32();
                            break;
                        }
                    case 2: {
                            m.metadata = $root.proto.StatusAttribution.StatusReshare.Metadata.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StatusReshare.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.StatusAttribution.StatusReshare)
                    return d;
                var m = new $root.proto.StatusAttribution.StatusReshare();
                switch (d.source) {
                default:
                    if (typeof d.source === "number") {
                        m.source = d.source;
                        break;
                    }
                    break;
                case "UNKNOWN":
                case 0:
                    m.source = 0;
                    break;
                case "INTERNAL_RESHARE":
                case 1:
                    m.source = 1;
                    break;
                case "MENTION_RESHARE":
                case 2:
                    m.source = 2;
                    break;
                case "CHANNEL_RESHARE":
                case 3:
                    m.source = 3;
                    break;
                case "FORWARD":
                case 4:
                    m.source = 4;
                    break;
                }
                if (d.metadata != null) {
                    if (typeof d.metadata !== "object")
                        throw TypeError(".proto.StatusAttribution.StatusReshare.metadata: object expected");
                    m.metadata = $root.proto.StatusAttribution.StatusReshare.Metadata.fromObject(d.metadata);
                }
                return m;
            };

            StatusReshare.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.source != null && m.hasOwnProperty("source")) {
                    d.source = o.enums === String ? $root.proto.StatusAttribution.StatusReshare.Source[m.source] === undefined ? m.source : $root.proto.StatusAttribution.StatusReshare.Source[m.source] : m.source;
                    if (o.oneofs)
                        d._source = "source";
                }
                if (m.metadata != null && m.hasOwnProperty("metadata")) {
                    d.metadata = $root.proto.StatusAttribution.StatusReshare.Metadata.toObject(m.metadata, o);
                    if (o.oneofs)
                        d._metadata = "metadata";
                }
                return d;
            };

            StatusReshare.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StatusReshare.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.StatusAttribution.StatusReshare";
            };

            StatusReshare.Metadata = (function() {

                function Metadata(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Metadata.prototype.duration = null;
                Metadata.prototype.channelJid = null;
                Metadata.prototype.channelMessageId = null;
                Metadata.prototype.hasMultipleReshares = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Metadata.prototype, "_duration", {
                    get: $util.oneOfGetter($oneOfFields = ["duration"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Metadata.prototype, "_channelJid", {
                    get: $util.oneOfGetter($oneOfFields = ["channelJid"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Metadata.prototype, "_channelMessageId", {
                    get: $util.oneOfGetter($oneOfFields = ["channelMessageId"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Metadata.prototype, "_hasMultipleReshares", {
                    get: $util.oneOfGetter($oneOfFields = ["hasMultipleReshares"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Metadata.create = function create(properties) {
                    return new Metadata(properties);
                };

                Metadata.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.duration != null && Object.hasOwnProperty.call(m, "duration"))
                        w.uint32(8).int32(m.duration);
                    if (m.channelJid != null && Object.hasOwnProperty.call(m, "channelJid"))
                        w.uint32(18).string(m.channelJid);
                    if (m.channelMessageId != null && Object.hasOwnProperty.call(m, "channelMessageId"))
                        w.uint32(24).int32(m.channelMessageId);
                    if (m.hasMultipleReshares != null && Object.hasOwnProperty.call(m, "hasMultipleReshares"))
                        w.uint32(32).bool(m.hasMultipleReshares);
                    return w;
                };

                Metadata.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusAttribution.StatusReshare.Metadata();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.duration = r.int32();
                                break;
                            }
                        case 2: {
                                m.channelJid = r.string();
                                break;
                            }
                        case 3: {
                                m.channelMessageId = r.int32();
                                break;
                            }
                        case 4: {
                                m.hasMultipleReshares = r.bool();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Metadata.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.StatusAttribution.StatusReshare.Metadata)
                        return d;
                    var m = new $root.proto.StatusAttribution.StatusReshare.Metadata();
                    if (d.duration != null) {
                        m.duration = d.duration | 0;
                    }
                    if (d.channelJid != null) {
                        m.channelJid = String(d.channelJid);
                    }
                    if (d.channelMessageId != null) {
                        m.channelMessageId = d.channelMessageId | 0;
                    }
                    if (d.hasMultipleReshares != null) {
                        m.hasMultipleReshares = Boolean(d.hasMultipleReshares);
                    }
                    return m;
                };

                Metadata.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.duration != null && m.hasOwnProperty("duration")) {
                        d.duration = m.duration;
                        if (o.oneofs)
                            d._duration = "duration";
                    }
                    if (m.channelJid != null && m.hasOwnProperty("channelJid")) {
                        d.channelJid = m.channelJid;
                        if (o.oneofs)
                            d._channelJid = "channelJid";
                    }
                    if (m.channelMessageId != null && m.hasOwnProperty("channelMessageId")) {
                        d.channelMessageId = m.channelMessageId;
                        if (o.oneofs)
                            d._channelMessageId = "channelMessageId";
                    }
                    if (m.hasMultipleReshares != null && m.hasOwnProperty("hasMultipleReshares")) {
                        d.hasMultipleReshares = m.hasMultipleReshares;
                        if (o.oneofs)
                            d._hasMultipleReshares = "hasMultipleReshares";
                    }
                    return d;
                };

                Metadata.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.StatusAttribution.StatusReshare.Metadata";
                };

                return Metadata;
            })();

            StatusReshare.Source = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNKNOWN"] = 0;
                values[valuesById[1] = "INTERNAL_RESHARE"] = 1;
                values[valuesById[2] = "MENTION_RESHARE"] = 2;
                values[valuesById[3] = "CHANNEL_RESHARE"] = 3;
                values[valuesById[4] = "FORWARD"] = 4;
                return values;
            })();

            return StatusReshare;
        })();

        StatusAttribution.Type = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "RESHARE"] = 1;
            values[valuesById[2] = "EXTERNAL_SHARE"] = 2;
            values[valuesById[3] = "MUSIC"] = 3;
            values[valuesById[4] = "STATUS_MENTION"] = 4;
            values[valuesById[5] = "GROUP_STATUS"] = 5;
            values[valuesById[6] = "RL_ATTRIBUTION"] = 6;
            values[valuesById[7] = "AI_CREATED"] = 7;
            values[valuesById[8] = "LAYOUTS"] = 8;
            return values;
        })();

        return StatusAttribution;
    })();

    proto.StatusMentionMessage = (function() {

        function StatusMentionMessage(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        StatusMentionMessage.prototype.quotedStatus = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StatusMentionMessage.prototype, "_quotedStatus", {
            get: $util.oneOfGetter($oneOfFields = ["quotedStatus"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        StatusMentionMessage.create = function create(properties) {
            return new StatusMentionMessage(properties);
        };

        StatusMentionMessage.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.quotedStatus != null && Object.hasOwnProperty.call(m, "quotedStatus"))
                $root.proto.Message.encode(m.quotedStatus, w.uint32(10).fork()).ldelim();
            return w;
        };

        StatusMentionMessage.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusMentionMessage();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.quotedStatus = $root.proto.Message.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        StatusMentionMessage.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.StatusMentionMessage)
                return d;
            var m = new $root.proto.StatusMentionMessage();
            if (d.quotedStatus != null) {
                if (typeof d.quotedStatus !== "object")
                    throw TypeError(".proto.StatusMentionMessage.quotedStatus: object expected");
                m.quotedStatus = $root.proto.Message.fromObject(d.quotedStatus);
            }
            return m;
        };

        StatusMentionMessage.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.quotedStatus != null && m.hasOwnProperty("quotedStatus")) {
                d.quotedStatus = $root.proto.Message.toObject(m.quotedStatus, o);
                if (o.oneofs)
                    d._quotedStatus = "quotedStatus";
            }
            return d;
        };

        StatusMentionMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        StatusMentionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.StatusMentionMessage";
        };

        return StatusMentionMessage;
    })();

    proto.StatusPSA = (function() {

        function StatusPSA(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        StatusPSA.prototype.campaignId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
        StatusPSA.prototype.campaignExpirationTimestamp = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StatusPSA.prototype, "_campaignExpirationTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["campaignExpirationTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        StatusPSA.create = function create(properties) {
            return new StatusPSA(properties);
        };

        StatusPSA.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.campaignId != null && Object.hasOwnProperty.call(m, "campaignId"))
                w.uint32(352).uint64(m.campaignId);
            if (m.campaignExpirationTimestamp != null && Object.hasOwnProperty.call(m, "campaignExpirationTimestamp"))
                w.uint32(360).uint64(m.campaignExpirationTimestamp);
            return w;
        };

        StatusPSA.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StatusPSA();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 44: {
                        m.campaignId = r.uint64();
                        break;
                    }
                case 45: {
                        m.campaignExpirationTimestamp = r.uint64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        StatusPSA.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.StatusPSA)
                return d;
            var m = new $root.proto.StatusPSA();
            if (d.campaignId != null) {
                if ($util.Long)
                    (m.campaignId = $util.Long.fromValue(d.campaignId)).unsigned = true;
                else if (typeof d.campaignId === "string")
                    m.campaignId = parseInt(d.campaignId, 10);
                else if (typeof d.campaignId === "number")
                    m.campaignId = d.campaignId;
                else if (typeof d.campaignId === "object")
                    m.campaignId = new $util.LongBits(d.campaignId.low >>> 0, d.campaignId.high >>> 0).toNumber(true);
            }
            if (d.campaignExpirationTimestamp != null) {
                if ($util.Long)
                    (m.campaignExpirationTimestamp = $util.Long.fromValue(d.campaignExpirationTimestamp)).unsigned = true;
                else if (typeof d.campaignExpirationTimestamp === "string")
                    m.campaignExpirationTimestamp = parseInt(d.campaignExpirationTimestamp, 10);
                else if (typeof d.campaignExpirationTimestamp === "number")
                    m.campaignExpirationTimestamp = d.campaignExpirationTimestamp;
                else if (typeof d.campaignExpirationTimestamp === "object")
                    m.campaignExpirationTimestamp = new $util.LongBits(d.campaignExpirationTimestamp.low >>> 0, d.campaignExpirationTimestamp.high >>> 0).toNumber(true);
            }
            return m;
        };

        StatusPSA.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.campaignId = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.campaignId = o.longs === String ? "0" : 0;
            }
            if (m.campaignId != null && m.hasOwnProperty("campaignId")) {
                if (typeof m.campaignId === "number")
                    d.campaignId = o.longs === String ? String(m.campaignId) : m.campaignId;
                else
                    d.campaignId = o.longs === String ? longToString(m.campaignId, true) : o.longs === Number ? longToNumber(m.campaignId, true) : m.campaignId;
            }
            if (m.campaignExpirationTimestamp != null && m.hasOwnProperty("campaignExpirationTimestamp")) {
                if (typeof m.campaignExpirationTimestamp === "number")
                    d.campaignExpirationTimestamp = o.longs === String ? String(m.campaignExpirationTimestamp) : m.campaignExpirationTimestamp;
                else
                    d.campaignExpirationTimestamp = o.longs === String ? longToString(m.campaignExpirationTimestamp, true) : o.longs === Number ? longToNumber(m.campaignExpirationTimestamp, true) : m.campaignExpirationTimestamp;
                if (o.oneofs)
                    d._campaignExpirationTimestamp = "campaignExpirationTimestamp";
            }
            return d;
        };

        StatusPSA.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        StatusPSA.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.StatusPSA";
        };

        return StatusPSA;
    })();

    proto.StickerMetadata = (function() {

        function StickerMetadata(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        StickerMetadata.prototype.url = null;
        StickerMetadata.prototype.fileSha256 = null;
        StickerMetadata.prototype.fileEncSha256 = null;
        StickerMetadata.prototype.mediaKey = null;
        StickerMetadata.prototype.mimetype = null;
        StickerMetadata.prototype.height = null;
        StickerMetadata.prototype.width = null;
        StickerMetadata.prototype.directPath = null;
        StickerMetadata.prototype.fileLength = null;
        StickerMetadata.prototype.weight = null;
        StickerMetadata.prototype.lastStickerSentTs = null;
        StickerMetadata.prototype.isLottie = null;
        StickerMetadata.prototype.imageHash = null;
        StickerMetadata.prototype.isAvatarSticker = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_url", {
            get: $util.oneOfGetter($oneOfFields = ["url"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_fileSha256", {
            get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_fileEncSha256", {
            get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_mediaKey", {
            get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_mimetype", {
            get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_height", {
            get: $util.oneOfGetter($oneOfFields = ["height"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_width", {
            get: $util.oneOfGetter($oneOfFields = ["width"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_directPath", {
            get: $util.oneOfGetter($oneOfFields = ["directPath"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_fileLength", {
            get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_weight", {
            get: $util.oneOfGetter($oneOfFields = ["weight"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_lastStickerSentTs", {
            get: $util.oneOfGetter($oneOfFields = ["lastStickerSentTs"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_isLottie", {
            get: $util.oneOfGetter($oneOfFields = ["isLottie"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_imageHash", {
            get: $util.oneOfGetter($oneOfFields = ["imageHash"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(StickerMetadata.prototype, "_isAvatarSticker", {
            get: $util.oneOfGetter($oneOfFields = ["isAvatarSticker"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        StickerMetadata.create = function create(properties) {
            return new StickerMetadata(properties);
        };

        StickerMetadata.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                w.uint32(10).string(m.url);
            if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
                w.uint32(18).bytes(m.fileSha256);
            if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                w.uint32(26).bytes(m.fileEncSha256);
            if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                w.uint32(34).bytes(m.mediaKey);
            if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                w.uint32(42).string(m.mimetype);
            if (m.height != null && Object.hasOwnProperty.call(m, "height"))
                w.uint32(48).uint32(m.height);
            if (m.width != null && Object.hasOwnProperty.call(m, "width"))
                w.uint32(56).uint32(m.width);
            if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                w.uint32(66).string(m.directPath);
            if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                w.uint32(72).uint64(m.fileLength);
            if (m.weight != null && Object.hasOwnProperty.call(m, "weight"))
                w.uint32(85).float(m.weight);
            if (m.lastStickerSentTs != null && Object.hasOwnProperty.call(m, "lastStickerSentTs"))
                w.uint32(88).int64(m.lastStickerSentTs);
            if (m.isLottie != null && Object.hasOwnProperty.call(m, "isLottie"))
                w.uint32(96).bool(m.isLottie);
            if (m.imageHash != null && Object.hasOwnProperty.call(m, "imageHash"))
                w.uint32(106).string(m.imageHash);
            if (m.isAvatarSticker != null && Object.hasOwnProperty.call(m, "isAvatarSticker"))
                w.uint32(112).bool(m.isAvatarSticker);
            return w;
        };

        StickerMetadata.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StickerMetadata();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.url = r.string();
                        break;
                    }
                case 2: {
                        m.fileSha256 = r.bytes();
                        break;
                    }
                case 3: {
                        m.fileEncSha256 = r.bytes();
                        break;
                    }
                case 4: {
                        m.mediaKey = r.bytes();
                        break;
                    }
                case 5: {
                        m.mimetype = r.string();
                        break;
                    }
                case 6: {
                        m.height = r.uint32();
                        break;
                    }
                case 7: {
                        m.width = r.uint32();
                        break;
                    }
                case 8: {
                        m.directPath = r.string();
                        break;
                    }
                case 9: {
                        m.fileLength = r.uint64();
                        break;
                    }
                case 10: {
                        m.weight = r.float();
                        break;
                    }
                case 11: {
                        m.lastStickerSentTs = r.int64();
                        break;
                    }
                case 12: {
                        m.isLottie = r.bool();
                        break;
                    }
                case 13: {
                        m.imageHash = r.string();
                        break;
                    }
                case 14: {
                        m.isAvatarSticker = r.bool();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        StickerMetadata.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.StickerMetadata)
                return d;
            var m = new $root.proto.StickerMetadata();
            if (d.url != null) {
                m.url = String(d.url);
            }
            if (d.fileSha256 != null) {
                if (typeof d.fileSha256 === "string")
                    $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
                else if (d.fileSha256.length >= 0)
                    m.fileSha256 = d.fileSha256;
            }
            if (d.fileEncSha256 != null) {
                if (typeof d.fileEncSha256 === "string")
                    $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                else if (d.fileEncSha256.length >= 0)
                    m.fileEncSha256 = d.fileEncSha256;
            }
            if (d.mediaKey != null) {
                if (typeof d.mediaKey === "string")
                    $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                else if (d.mediaKey.length >= 0)
                    m.mediaKey = d.mediaKey;
            }
            if (d.mimetype != null) {
                m.mimetype = String(d.mimetype);
            }
            if (d.height != null) {
                m.height = d.height >>> 0;
            }
            if (d.width != null) {
                m.width = d.width >>> 0;
            }
            if (d.directPath != null) {
                m.directPath = String(d.directPath);
            }
            if (d.fileLength != null) {
                if ($util.Long)
                    (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                else if (typeof d.fileLength === "string")
                    m.fileLength = parseInt(d.fileLength, 10);
                else if (typeof d.fileLength === "number")
                    m.fileLength = d.fileLength;
                else if (typeof d.fileLength === "object")
                    m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
            }
            if (d.weight != null) {
                m.weight = Number(d.weight);
            }
            if (d.lastStickerSentTs != null) {
                if ($util.Long)
                    (m.lastStickerSentTs = $util.Long.fromValue(d.lastStickerSentTs)).unsigned = false;
                else if (typeof d.lastStickerSentTs === "string")
                    m.lastStickerSentTs = parseInt(d.lastStickerSentTs, 10);
                else if (typeof d.lastStickerSentTs === "number")
                    m.lastStickerSentTs = d.lastStickerSentTs;
                else if (typeof d.lastStickerSentTs === "object")
                    m.lastStickerSentTs = new $util.LongBits(d.lastStickerSentTs.low >>> 0, d.lastStickerSentTs.high >>> 0).toNumber();
            }
            if (d.isLottie != null) {
                m.isLottie = Boolean(d.isLottie);
            }
            if (d.imageHash != null) {
                m.imageHash = String(d.imageHash);
            }
            if (d.isAvatarSticker != null) {
                m.isAvatarSticker = Boolean(d.isAvatarSticker);
            }
            return m;
        };

        StickerMetadata.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.url != null && m.hasOwnProperty("url")) {
                d.url = m.url;
                if (o.oneofs)
                    d._url = "url";
            }
            if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
                d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
                if (o.oneofs)
                    d._fileSha256 = "fileSha256";
            }
            if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                if (o.oneofs)
                    d._fileEncSha256 = "fileEncSha256";
            }
            if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                if (o.oneofs)
                    d._mediaKey = "mediaKey";
            }
            if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                d.mimetype = m.mimetype;
                if (o.oneofs)
                    d._mimetype = "mimetype";
            }
            if (m.height != null && m.hasOwnProperty("height")) {
                d.height = m.height;
                if (o.oneofs)
                    d._height = "height";
            }
            if (m.width != null && m.hasOwnProperty("width")) {
                d.width = m.width;
                if (o.oneofs)
                    d._width = "width";
            }
            if (m.directPath != null && m.hasOwnProperty("directPath")) {
                d.directPath = m.directPath;
                if (o.oneofs)
                    d._directPath = "directPath";
            }
            if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                if (typeof m.fileLength === "number")
                    d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                else
                    d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                if (o.oneofs)
                    d._fileLength = "fileLength";
            }
            if (m.weight != null && m.hasOwnProperty("weight")) {
                d.weight = o.json && !isFinite(m.weight) ? String(m.weight) : m.weight;
                if (o.oneofs)
                    d._weight = "weight";
            }
            if (m.lastStickerSentTs != null && m.hasOwnProperty("lastStickerSentTs")) {
                if (typeof m.lastStickerSentTs === "number")
                    d.lastStickerSentTs = o.longs === String ? String(m.lastStickerSentTs) : m.lastStickerSentTs;
                else
                    d.lastStickerSentTs = o.longs === String ? longToString(m.lastStickerSentTs) : o.longs === Number ? longToNumber(m.lastStickerSentTs) : m.lastStickerSentTs;
                if (o.oneofs)
                    d._lastStickerSentTs = "lastStickerSentTs";
            }
            if (m.isLottie != null && m.hasOwnProperty("isLottie")) {
                d.isLottie = m.isLottie;
                if (o.oneofs)
                    d._isLottie = "isLottie";
            }
            if (m.imageHash != null && m.hasOwnProperty("imageHash")) {
                d.imageHash = m.imageHash;
                if (o.oneofs)
                    d._imageHash = "imageHash";
            }
            if (m.isAvatarSticker != null && m.hasOwnProperty("isAvatarSticker")) {
                d.isAvatarSticker = m.isAvatarSticker;
                if (o.oneofs)
                    d._isAvatarSticker = "isAvatarSticker";
            }
            return d;
        };

        StickerMetadata.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        StickerMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.StickerMetadata";
        };

        return StickerMetadata;
    })();

    proto.SyncActionData = (function() {

        function SyncActionData(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncActionData.prototype.index = null;
        SyncActionData.prototype.value = null;
        SyncActionData.prototype.padding = null;
        SyncActionData.prototype.version = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionData.prototype, "_index", {
            get: $util.oneOfGetter($oneOfFields = ["index"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionData.prototype, "_value", {
            get: $util.oneOfGetter($oneOfFields = ["value"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionData.prototype, "_padding", {
            get: $util.oneOfGetter($oneOfFields = ["padding"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionData.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncActionData.create = function create(properties) {
            return new SyncActionData(properties);
        };

        SyncActionData.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.index != null && Object.hasOwnProperty.call(m, "index"))
                w.uint32(10).bytes(m.index);
            if (m.value != null && Object.hasOwnProperty.call(m, "value"))
                $root.proto.SyncActionValue.encode(m.value, w.uint32(18).fork()).ldelim();
            if (m.padding != null && Object.hasOwnProperty.call(m, "padding"))
                w.uint32(26).bytes(m.padding);
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                w.uint32(32).int32(m.version);
            return w;
        };

        SyncActionData.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionData();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.index = r.bytes();
                        break;
                    }
                case 2: {
                        m.value = $root.proto.SyncActionValue.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.padding = r.bytes();
                        break;
                    }
                case 4: {
                        m.version = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncActionData.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncActionData)
                return d;
            var m = new $root.proto.SyncActionData();
            if (d.index != null) {
                if (typeof d.index === "string")
                    $util.base64.decode(d.index, m.index = $util.newBuffer($util.base64.length(d.index)), 0);
                else if (d.index.length >= 0)
                    m.index = d.index;
            }
            if (d.value != null) {
                if (typeof d.value !== "object")
                    throw TypeError(".proto.SyncActionData.value: object expected");
                m.value = $root.proto.SyncActionValue.fromObject(d.value);
            }
            if (d.padding != null) {
                if (typeof d.padding === "string")
                    $util.base64.decode(d.padding, m.padding = $util.newBuffer($util.base64.length(d.padding)), 0);
                else if (d.padding.length >= 0)
                    m.padding = d.padding;
            }
            if (d.version != null) {
                m.version = d.version | 0;
            }
            return m;
        };

        SyncActionData.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.index != null && m.hasOwnProperty("index")) {
                d.index = o.bytes === String ? $util.base64.encode(m.index, 0, m.index.length) : o.bytes === Array ? Array.prototype.slice.call(m.index) : m.index;
                if (o.oneofs)
                    d._index = "index";
            }
            if (m.value != null && m.hasOwnProperty("value")) {
                d.value = $root.proto.SyncActionValue.toObject(m.value, o);
                if (o.oneofs)
                    d._value = "value";
            }
            if (m.padding != null && m.hasOwnProperty("padding")) {
                d.padding = o.bytes === String ? $util.base64.encode(m.padding, 0, m.padding.length) : o.bytes === Array ? Array.prototype.slice.call(m.padding) : m.padding;
                if (o.oneofs)
                    d._padding = "padding";
            }
            if (m.version != null && m.hasOwnProperty("version")) {
                d.version = m.version;
                if (o.oneofs)
                    d._version = "version";
            }
            return d;
        };

        SyncActionData.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncActionData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncActionData";
        };

        return SyncActionData;
    })();

    proto.SyncActionValue = (function() {

        function SyncActionValue(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncActionValue.prototype.timestamp = null;
        SyncActionValue.prototype.starAction = null;
        SyncActionValue.prototype.contactAction = null;
        SyncActionValue.prototype.muteAction = null;
        SyncActionValue.prototype.pinAction = null;
        SyncActionValue.prototype.pushNameSetting = null;
        SyncActionValue.prototype.quickReplyAction = null;
        SyncActionValue.prototype.recentEmojiWeightsAction = null;
        SyncActionValue.prototype.labelEditAction = null;
        SyncActionValue.prototype.labelAssociationAction = null;
        SyncActionValue.prototype.localeSetting = null;
        SyncActionValue.prototype.archiveChatAction = null;
        SyncActionValue.prototype.deleteMessageForMeAction = null;
        SyncActionValue.prototype.keyExpiration = null;
        SyncActionValue.prototype.markChatAsReadAction = null;
        SyncActionValue.prototype.clearChatAction = null;
        SyncActionValue.prototype.deleteChatAction = null;
        SyncActionValue.prototype.unarchiveChatsSetting = null;
        SyncActionValue.prototype.primaryFeature = null;
        SyncActionValue.prototype.androidUnsupportedActions = null;
        SyncActionValue.prototype.agentAction = null;
        SyncActionValue.prototype.subscriptionAction = null;
        SyncActionValue.prototype.userStatusMuteAction = null;
        SyncActionValue.prototype.timeFormatAction = null;
        SyncActionValue.prototype.nuxAction = null;
        SyncActionValue.prototype.primaryVersionAction = null;
        SyncActionValue.prototype.stickerAction = null;
        SyncActionValue.prototype.removeRecentStickerAction = null;
        SyncActionValue.prototype.chatAssignment = null;
        SyncActionValue.prototype.chatAssignmentOpenedStatus = null;
        SyncActionValue.prototype.pnForLidChatAction = null;
        SyncActionValue.prototype.marketingMessageAction = null;
        SyncActionValue.prototype.marketingMessageBroadcastAction = null;
        SyncActionValue.prototype.externalWebBetaAction = null;
        SyncActionValue.prototype.privacySettingRelayAllCalls = null;
        SyncActionValue.prototype.callLogAction = null;
        SyncActionValue.prototype.ugcBot = null;
        SyncActionValue.prototype.statusPrivacy = null;
        SyncActionValue.prototype.botWelcomeRequestAction = null;
        SyncActionValue.prototype.deleteIndividualCallLog = null;
        SyncActionValue.prototype.labelReorderingAction = null;
        SyncActionValue.prototype.paymentInfoAction = null;
        SyncActionValue.prototype.customPaymentMethodsAction = null;
        SyncActionValue.prototype.lockChatAction = null;
        SyncActionValue.prototype.chatLockSettings = null;
        SyncActionValue.prototype.wamoUserIdentifierAction = null;
        SyncActionValue.prototype.privacySettingDisableLinkPreviewsAction = null;
        SyncActionValue.prototype.deviceCapabilities = null;
        SyncActionValue.prototype.noteEditAction = null;
        SyncActionValue.prototype.favoritesAction = null;
        SyncActionValue.prototype.merchantPaymentPartnerAction = null;
        SyncActionValue.prototype.waffleAccountLinkStateAction = null;
        SyncActionValue.prototype.usernameChatStartMode = null;
        SyncActionValue.prototype.notificationActivitySettingAction = null;
        SyncActionValue.prototype.lidContactAction = null;
        SyncActionValue.prototype.ctwaPerCustomerDataSharingAction = null;
        SyncActionValue.prototype.paymentTosAction = null;
        SyncActionValue.prototype.privacySettingChannelsPersonalisedRecommendationAction = null;
        SyncActionValue.prototype.businessBroadcastAssociationAction = null;
        SyncActionValue.prototype.detectedOutcomesStatusAction = null;
        SyncActionValue.prototype.maibaAiFeaturesControlAction = null;
        SyncActionValue.prototype.businessBroadcastListAction = null;
        SyncActionValue.prototype.musicUserIdAction = null;
        SyncActionValue.prototype.statusPostOptInNotificationPreferencesAction = null;
        SyncActionValue.prototype.avatarUpdatedAction = null;
        SyncActionValue.prototype.privateProcessingSettingAction = null;
        SyncActionValue.prototype.newsletterSavedInterestsAction = null;
        SyncActionValue.prototype.aiThreadRenameAction = null;
        SyncActionValue.prototype.interactiveMessageAction = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_timestamp", {
            get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_starAction", {
            get: $util.oneOfGetter($oneOfFields = ["starAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_contactAction", {
            get: $util.oneOfGetter($oneOfFields = ["contactAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_muteAction", {
            get: $util.oneOfGetter($oneOfFields = ["muteAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_pinAction", {
            get: $util.oneOfGetter($oneOfFields = ["pinAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_pushNameSetting", {
            get: $util.oneOfGetter($oneOfFields = ["pushNameSetting"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_quickReplyAction", {
            get: $util.oneOfGetter($oneOfFields = ["quickReplyAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_recentEmojiWeightsAction", {
            get: $util.oneOfGetter($oneOfFields = ["recentEmojiWeightsAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_labelEditAction", {
            get: $util.oneOfGetter($oneOfFields = ["labelEditAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_labelAssociationAction", {
            get: $util.oneOfGetter($oneOfFields = ["labelAssociationAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_localeSetting", {
            get: $util.oneOfGetter($oneOfFields = ["localeSetting"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_archiveChatAction", {
            get: $util.oneOfGetter($oneOfFields = ["archiveChatAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_deleteMessageForMeAction", {
            get: $util.oneOfGetter($oneOfFields = ["deleteMessageForMeAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_keyExpiration", {
            get: $util.oneOfGetter($oneOfFields = ["keyExpiration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_markChatAsReadAction", {
            get: $util.oneOfGetter($oneOfFields = ["markChatAsReadAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_clearChatAction", {
            get: $util.oneOfGetter($oneOfFields = ["clearChatAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_deleteChatAction", {
            get: $util.oneOfGetter($oneOfFields = ["deleteChatAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_unarchiveChatsSetting", {
            get: $util.oneOfGetter($oneOfFields = ["unarchiveChatsSetting"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_primaryFeature", {
            get: $util.oneOfGetter($oneOfFields = ["primaryFeature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_androidUnsupportedActions", {
            get: $util.oneOfGetter($oneOfFields = ["androidUnsupportedActions"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_agentAction", {
            get: $util.oneOfGetter($oneOfFields = ["agentAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_subscriptionAction", {
            get: $util.oneOfGetter($oneOfFields = ["subscriptionAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_userStatusMuteAction", {
            get: $util.oneOfGetter($oneOfFields = ["userStatusMuteAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_timeFormatAction", {
            get: $util.oneOfGetter($oneOfFields = ["timeFormatAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_nuxAction", {
            get: $util.oneOfGetter($oneOfFields = ["nuxAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_primaryVersionAction", {
            get: $util.oneOfGetter($oneOfFields = ["primaryVersionAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_stickerAction", {
            get: $util.oneOfGetter($oneOfFields = ["stickerAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_removeRecentStickerAction", {
            get: $util.oneOfGetter($oneOfFields = ["removeRecentStickerAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_chatAssignment", {
            get: $util.oneOfGetter($oneOfFields = ["chatAssignment"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_chatAssignmentOpenedStatus", {
            get: $util.oneOfGetter($oneOfFields = ["chatAssignmentOpenedStatus"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_pnForLidChatAction", {
            get: $util.oneOfGetter($oneOfFields = ["pnForLidChatAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_marketingMessageAction", {
            get: $util.oneOfGetter($oneOfFields = ["marketingMessageAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_marketingMessageBroadcastAction", {
            get: $util.oneOfGetter($oneOfFields = ["marketingMessageBroadcastAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_externalWebBetaAction", {
            get: $util.oneOfGetter($oneOfFields = ["externalWebBetaAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_privacySettingRelayAllCalls", {
            get: $util.oneOfGetter($oneOfFields = ["privacySettingRelayAllCalls"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_callLogAction", {
            get: $util.oneOfGetter($oneOfFields = ["callLogAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_ugcBot", {
            get: $util.oneOfGetter($oneOfFields = ["ugcBot"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_statusPrivacy", {
            get: $util.oneOfGetter($oneOfFields = ["statusPrivacy"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_botWelcomeRequestAction", {
            get: $util.oneOfGetter($oneOfFields = ["botWelcomeRequestAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_deleteIndividualCallLog", {
            get: $util.oneOfGetter($oneOfFields = ["deleteIndividualCallLog"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_labelReorderingAction", {
            get: $util.oneOfGetter($oneOfFields = ["labelReorderingAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_paymentInfoAction", {
            get: $util.oneOfGetter($oneOfFields = ["paymentInfoAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_customPaymentMethodsAction", {
            get: $util.oneOfGetter($oneOfFields = ["customPaymentMethodsAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_lockChatAction", {
            get: $util.oneOfGetter($oneOfFields = ["lockChatAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_chatLockSettings", {
            get: $util.oneOfGetter($oneOfFields = ["chatLockSettings"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_wamoUserIdentifierAction", {
            get: $util.oneOfGetter($oneOfFields = ["wamoUserIdentifierAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_privacySettingDisableLinkPreviewsAction", {
            get: $util.oneOfGetter($oneOfFields = ["privacySettingDisableLinkPreviewsAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_deviceCapabilities", {
            get: $util.oneOfGetter($oneOfFields = ["deviceCapabilities"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_noteEditAction", {
            get: $util.oneOfGetter($oneOfFields = ["noteEditAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_favoritesAction", {
            get: $util.oneOfGetter($oneOfFields = ["favoritesAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_merchantPaymentPartnerAction", {
            get: $util.oneOfGetter($oneOfFields = ["merchantPaymentPartnerAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_waffleAccountLinkStateAction", {
            get: $util.oneOfGetter($oneOfFields = ["waffleAccountLinkStateAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_usernameChatStartMode", {
            get: $util.oneOfGetter($oneOfFields = ["usernameChatStartMode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_notificationActivitySettingAction", {
            get: $util.oneOfGetter($oneOfFields = ["notificationActivitySettingAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_lidContactAction", {
            get: $util.oneOfGetter($oneOfFields = ["lidContactAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_ctwaPerCustomerDataSharingAction", {
            get: $util.oneOfGetter($oneOfFields = ["ctwaPerCustomerDataSharingAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_paymentTosAction", {
            get: $util.oneOfGetter($oneOfFields = ["paymentTosAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_privacySettingChannelsPersonalisedRecommendationAction", {
            get: $util.oneOfGetter($oneOfFields = ["privacySettingChannelsPersonalisedRecommendationAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_businessBroadcastAssociationAction", {
            get: $util.oneOfGetter($oneOfFields = ["businessBroadcastAssociationAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_detectedOutcomesStatusAction", {
            get: $util.oneOfGetter($oneOfFields = ["detectedOutcomesStatusAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_maibaAiFeaturesControlAction", {
            get: $util.oneOfGetter($oneOfFields = ["maibaAiFeaturesControlAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_businessBroadcastListAction", {
            get: $util.oneOfGetter($oneOfFields = ["businessBroadcastListAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_musicUserIdAction", {
            get: $util.oneOfGetter($oneOfFields = ["musicUserIdAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_statusPostOptInNotificationPreferencesAction", {
            get: $util.oneOfGetter($oneOfFields = ["statusPostOptInNotificationPreferencesAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_avatarUpdatedAction", {
            get: $util.oneOfGetter($oneOfFields = ["avatarUpdatedAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_privateProcessingSettingAction", {
            get: $util.oneOfGetter($oneOfFields = ["privateProcessingSettingAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_newsletterSavedInterestsAction", {
            get: $util.oneOfGetter($oneOfFields = ["newsletterSavedInterestsAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_aiThreadRenameAction", {
            get: $util.oneOfGetter($oneOfFields = ["aiThreadRenameAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncActionValue.prototype, "_interactiveMessageAction", {
            get: $util.oneOfGetter($oneOfFields = ["interactiveMessageAction"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncActionValue.create = function create(properties) {
            return new SyncActionValue(properties);
        };

        SyncActionValue.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                w.uint32(8).int64(m.timestamp);
            if (m.starAction != null && Object.hasOwnProperty.call(m, "starAction"))
                $root.proto.SyncActionValue.StarAction.encode(m.starAction, w.uint32(18).fork()).ldelim();
            if (m.contactAction != null && Object.hasOwnProperty.call(m, "contactAction"))
                $root.proto.SyncActionValue.ContactAction.encode(m.contactAction, w.uint32(26).fork()).ldelim();
            if (m.muteAction != null && Object.hasOwnProperty.call(m, "muteAction"))
                $root.proto.SyncActionValue.MuteAction.encode(m.muteAction, w.uint32(34).fork()).ldelim();
            if (m.pinAction != null && Object.hasOwnProperty.call(m, "pinAction"))
                $root.proto.SyncActionValue.PinAction.encode(m.pinAction, w.uint32(42).fork()).ldelim();
            if (m.pushNameSetting != null && Object.hasOwnProperty.call(m, "pushNameSetting"))
                $root.proto.SyncActionValue.PushNameSetting.encode(m.pushNameSetting, w.uint32(58).fork()).ldelim();
            if (m.quickReplyAction != null && Object.hasOwnProperty.call(m, "quickReplyAction"))
                $root.proto.SyncActionValue.QuickReplyAction.encode(m.quickReplyAction, w.uint32(66).fork()).ldelim();
            if (m.recentEmojiWeightsAction != null && Object.hasOwnProperty.call(m, "recentEmojiWeightsAction"))
                $root.proto.SyncActionValue.RecentEmojiWeightsAction.encode(m.recentEmojiWeightsAction, w.uint32(90).fork()).ldelim();
            if (m.labelEditAction != null && Object.hasOwnProperty.call(m, "labelEditAction"))
                $root.proto.SyncActionValue.LabelEditAction.encode(m.labelEditAction, w.uint32(114).fork()).ldelim();
            if (m.labelAssociationAction != null && Object.hasOwnProperty.call(m, "labelAssociationAction"))
                $root.proto.SyncActionValue.LabelAssociationAction.encode(m.labelAssociationAction, w.uint32(122).fork()).ldelim();
            if (m.localeSetting != null && Object.hasOwnProperty.call(m, "localeSetting"))
                $root.proto.SyncActionValue.LocaleSetting.encode(m.localeSetting, w.uint32(130).fork()).ldelim();
            if (m.archiveChatAction != null && Object.hasOwnProperty.call(m, "archiveChatAction"))
                $root.proto.SyncActionValue.ArchiveChatAction.encode(m.archiveChatAction, w.uint32(138).fork()).ldelim();
            if (m.deleteMessageForMeAction != null && Object.hasOwnProperty.call(m, "deleteMessageForMeAction"))
                $root.proto.SyncActionValue.DeleteMessageForMeAction.encode(m.deleteMessageForMeAction, w.uint32(146).fork()).ldelim();
            if (m.keyExpiration != null && Object.hasOwnProperty.call(m, "keyExpiration"))
                $root.proto.SyncActionValue.KeyExpiration.encode(m.keyExpiration, w.uint32(154).fork()).ldelim();
            if (m.markChatAsReadAction != null && Object.hasOwnProperty.call(m, "markChatAsReadAction"))
                $root.proto.SyncActionValue.MarkChatAsReadAction.encode(m.markChatAsReadAction, w.uint32(162).fork()).ldelim();
            if (m.clearChatAction != null && Object.hasOwnProperty.call(m, "clearChatAction"))
                $root.proto.SyncActionValue.ClearChatAction.encode(m.clearChatAction, w.uint32(170).fork()).ldelim();
            if (m.deleteChatAction != null && Object.hasOwnProperty.call(m, "deleteChatAction"))
                $root.proto.SyncActionValue.DeleteChatAction.encode(m.deleteChatAction, w.uint32(178).fork()).ldelim();
            if (m.unarchiveChatsSetting != null && Object.hasOwnProperty.call(m, "unarchiveChatsSetting"))
                $root.proto.SyncActionValue.UnarchiveChatsSetting.encode(m.unarchiveChatsSetting, w.uint32(186).fork()).ldelim();
            if (m.primaryFeature != null && Object.hasOwnProperty.call(m, "primaryFeature"))
                $root.proto.SyncActionValue.PrimaryFeature.encode(m.primaryFeature, w.uint32(194).fork()).ldelim();
            if (m.androidUnsupportedActions != null && Object.hasOwnProperty.call(m, "androidUnsupportedActions"))
                $root.proto.SyncActionValue.AndroidUnsupportedActions.encode(m.androidUnsupportedActions, w.uint32(210).fork()).ldelim();
            if (m.agentAction != null && Object.hasOwnProperty.call(m, "agentAction"))
                $root.proto.SyncActionValue.AgentAction.encode(m.agentAction, w.uint32(218).fork()).ldelim();
            if (m.subscriptionAction != null && Object.hasOwnProperty.call(m, "subscriptionAction"))
                $root.proto.SyncActionValue.SubscriptionAction.encode(m.subscriptionAction, w.uint32(226).fork()).ldelim();
            if (m.userStatusMuteAction != null && Object.hasOwnProperty.call(m, "userStatusMuteAction"))
                $root.proto.SyncActionValue.UserStatusMuteAction.encode(m.userStatusMuteAction, w.uint32(234).fork()).ldelim();
            if (m.timeFormatAction != null && Object.hasOwnProperty.call(m, "timeFormatAction"))
                $root.proto.SyncActionValue.TimeFormatAction.encode(m.timeFormatAction, w.uint32(242).fork()).ldelim();
            if (m.nuxAction != null && Object.hasOwnProperty.call(m, "nuxAction"))
                $root.proto.SyncActionValue.NuxAction.encode(m.nuxAction, w.uint32(250).fork()).ldelim();
            if (m.primaryVersionAction != null && Object.hasOwnProperty.call(m, "primaryVersionAction"))
                $root.proto.SyncActionValue.PrimaryVersionAction.encode(m.primaryVersionAction, w.uint32(258).fork()).ldelim();
            if (m.stickerAction != null && Object.hasOwnProperty.call(m, "stickerAction"))
                $root.proto.SyncActionValue.StickerAction.encode(m.stickerAction, w.uint32(266).fork()).ldelim();
            if (m.removeRecentStickerAction != null && Object.hasOwnProperty.call(m, "removeRecentStickerAction"))
                $root.proto.SyncActionValue.RemoveRecentStickerAction.encode(m.removeRecentStickerAction, w.uint32(274).fork()).ldelim();
            if (m.chatAssignment != null && Object.hasOwnProperty.call(m, "chatAssignment"))
                $root.proto.SyncActionValue.ChatAssignmentAction.encode(m.chatAssignment, w.uint32(282).fork()).ldelim();
            if (m.chatAssignmentOpenedStatus != null && Object.hasOwnProperty.call(m, "chatAssignmentOpenedStatus"))
                $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.encode(m.chatAssignmentOpenedStatus, w.uint32(290).fork()).ldelim();
            if (m.pnForLidChatAction != null && Object.hasOwnProperty.call(m, "pnForLidChatAction"))
                $root.proto.SyncActionValue.PnForLidChatAction.encode(m.pnForLidChatAction, w.uint32(298).fork()).ldelim();
            if (m.marketingMessageAction != null && Object.hasOwnProperty.call(m, "marketingMessageAction"))
                $root.proto.SyncActionValue.MarketingMessageAction.encode(m.marketingMessageAction, w.uint32(306).fork()).ldelim();
            if (m.marketingMessageBroadcastAction != null && Object.hasOwnProperty.call(m, "marketingMessageBroadcastAction"))
                $root.proto.SyncActionValue.MarketingMessageBroadcastAction.encode(m.marketingMessageBroadcastAction, w.uint32(314).fork()).ldelim();
            if (m.externalWebBetaAction != null && Object.hasOwnProperty.call(m, "externalWebBetaAction"))
                $root.proto.SyncActionValue.ExternalWebBetaAction.encode(m.externalWebBetaAction, w.uint32(322).fork()).ldelim();
            if (m.privacySettingRelayAllCalls != null && Object.hasOwnProperty.call(m, "privacySettingRelayAllCalls"))
                $root.proto.SyncActionValue.PrivacySettingRelayAllCalls.encode(m.privacySettingRelayAllCalls, w.uint32(330).fork()).ldelim();
            if (m.callLogAction != null && Object.hasOwnProperty.call(m, "callLogAction"))
                $root.proto.SyncActionValue.CallLogAction.encode(m.callLogAction, w.uint32(338).fork()).ldelim();
            if (m.ugcBot != null && Object.hasOwnProperty.call(m, "ugcBot"))
                $root.proto.SyncActionValue.UGCBot.encode(m.ugcBot, w.uint32(346).fork()).ldelim();
            if (m.statusPrivacy != null && Object.hasOwnProperty.call(m, "statusPrivacy"))
                $root.proto.SyncActionValue.StatusPrivacyAction.encode(m.statusPrivacy, w.uint32(354).fork()).ldelim();
            if (m.botWelcomeRequestAction != null && Object.hasOwnProperty.call(m, "botWelcomeRequestAction"))
                $root.proto.SyncActionValue.BotWelcomeRequestAction.encode(m.botWelcomeRequestAction, w.uint32(362).fork()).ldelim();
            if (m.deleteIndividualCallLog != null && Object.hasOwnProperty.call(m, "deleteIndividualCallLog"))
                $root.proto.SyncActionValue.DeleteIndividualCallLogAction.encode(m.deleteIndividualCallLog, w.uint32(370).fork()).ldelim();
            if (m.labelReorderingAction != null && Object.hasOwnProperty.call(m, "labelReorderingAction"))
                $root.proto.SyncActionValue.LabelReorderingAction.encode(m.labelReorderingAction, w.uint32(378).fork()).ldelim();
            if (m.paymentInfoAction != null && Object.hasOwnProperty.call(m, "paymentInfoAction"))
                $root.proto.SyncActionValue.PaymentInfoAction.encode(m.paymentInfoAction, w.uint32(386).fork()).ldelim();
            if (m.customPaymentMethodsAction != null && Object.hasOwnProperty.call(m, "customPaymentMethodsAction"))
                $root.proto.SyncActionValue.CustomPaymentMethodsAction.encode(m.customPaymentMethodsAction, w.uint32(394).fork()).ldelim();
            if (m.lockChatAction != null && Object.hasOwnProperty.call(m, "lockChatAction"))
                $root.proto.SyncActionValue.LockChatAction.encode(m.lockChatAction, w.uint32(402).fork()).ldelim();
            if (m.chatLockSettings != null && Object.hasOwnProperty.call(m, "chatLockSettings"))
                $root.proto.ChatLockSettings.encode(m.chatLockSettings, w.uint32(410).fork()).ldelim();
            if (m.wamoUserIdentifierAction != null && Object.hasOwnProperty.call(m, "wamoUserIdentifierAction"))
                $root.proto.SyncActionValue.WamoUserIdentifierAction.encode(m.wamoUserIdentifierAction, w.uint32(418).fork()).ldelim();
            if (m.privacySettingDisableLinkPreviewsAction != null && Object.hasOwnProperty.call(m, "privacySettingDisableLinkPreviewsAction"))
                $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.encode(m.privacySettingDisableLinkPreviewsAction, w.uint32(426).fork()).ldelim();
            if (m.deviceCapabilities != null && Object.hasOwnProperty.call(m, "deviceCapabilities"))
                $root.proto.DeviceCapabilities.encode(m.deviceCapabilities, w.uint32(434).fork()).ldelim();
            if (m.noteEditAction != null && Object.hasOwnProperty.call(m, "noteEditAction"))
                $root.proto.SyncActionValue.NoteEditAction.encode(m.noteEditAction, w.uint32(442).fork()).ldelim();
            if (m.favoritesAction != null && Object.hasOwnProperty.call(m, "favoritesAction"))
                $root.proto.SyncActionValue.FavoritesAction.encode(m.favoritesAction, w.uint32(450).fork()).ldelim();
            if (m.merchantPaymentPartnerAction != null && Object.hasOwnProperty.call(m, "merchantPaymentPartnerAction"))
                $root.proto.SyncActionValue.MerchantPaymentPartnerAction.encode(m.merchantPaymentPartnerAction, w.uint32(458).fork()).ldelim();
            if (m.waffleAccountLinkStateAction != null && Object.hasOwnProperty.call(m, "waffleAccountLinkStateAction"))
                $root.proto.SyncActionValue.WaffleAccountLinkStateAction.encode(m.waffleAccountLinkStateAction, w.uint32(466).fork()).ldelim();
            if (m.usernameChatStartMode != null && Object.hasOwnProperty.call(m, "usernameChatStartMode"))
                $root.proto.SyncActionValue.UsernameChatStartModeAction.encode(m.usernameChatStartMode, w.uint32(474).fork()).ldelim();
            if (m.notificationActivitySettingAction != null && Object.hasOwnProperty.call(m, "notificationActivitySettingAction"))
                $root.proto.SyncActionValue.NotificationActivitySettingAction.encode(m.notificationActivitySettingAction, w.uint32(482).fork()).ldelim();
            if (m.lidContactAction != null && Object.hasOwnProperty.call(m, "lidContactAction"))
                $root.proto.SyncActionValue.LidContactAction.encode(m.lidContactAction, w.uint32(490).fork()).ldelim();
            if (m.ctwaPerCustomerDataSharingAction != null && Object.hasOwnProperty.call(m, "ctwaPerCustomerDataSharingAction"))
                $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.encode(m.ctwaPerCustomerDataSharingAction, w.uint32(498).fork()).ldelim();
            if (m.paymentTosAction != null && Object.hasOwnProperty.call(m, "paymentTosAction"))
                $root.proto.SyncActionValue.PaymentTosAction.encode(m.paymentTosAction, w.uint32(506).fork()).ldelim();
            if (m.privacySettingChannelsPersonalisedRecommendationAction != null && Object.hasOwnProperty.call(m, "privacySettingChannelsPersonalisedRecommendationAction"))
                $root.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.encode(m.privacySettingChannelsPersonalisedRecommendationAction, w.uint32(514).fork()).ldelim();
            if (m.businessBroadcastAssociationAction != null && Object.hasOwnProperty.call(m, "businessBroadcastAssociationAction"))
                $root.proto.SyncActionValue.BusinessBroadcastAssociationAction.encode(m.businessBroadcastAssociationAction, w.uint32(522).fork()).ldelim();
            if (m.detectedOutcomesStatusAction != null && Object.hasOwnProperty.call(m, "detectedOutcomesStatusAction"))
                $root.proto.SyncActionValue.DetectedOutcomesStatusAction.encode(m.detectedOutcomesStatusAction, w.uint32(530).fork()).ldelim();
            if (m.maibaAiFeaturesControlAction != null && Object.hasOwnProperty.call(m, "maibaAiFeaturesControlAction"))
                $root.proto.SyncActionValue.MaibaAIFeaturesControlAction.encode(m.maibaAiFeaturesControlAction, w.uint32(546).fork()).ldelim();
            if (m.businessBroadcastListAction != null && Object.hasOwnProperty.call(m, "businessBroadcastListAction"))
                $root.proto.SyncActionValue.BusinessBroadcastListAction.encode(m.businessBroadcastListAction, w.uint32(554).fork()).ldelim();
            if (m.musicUserIdAction != null && Object.hasOwnProperty.call(m, "musicUserIdAction"))
                $root.proto.SyncActionValue.MusicUserIdAction.encode(m.musicUserIdAction, w.uint32(562).fork()).ldelim();
            if (m.statusPostOptInNotificationPreferencesAction != null && Object.hasOwnProperty.call(m, "statusPostOptInNotificationPreferencesAction"))
                $root.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.encode(m.statusPostOptInNotificationPreferencesAction, w.uint32(570).fork()).ldelim();
            if (m.avatarUpdatedAction != null && Object.hasOwnProperty.call(m, "avatarUpdatedAction"))
                $root.proto.SyncActionValue.AvatarUpdatedAction.encode(m.avatarUpdatedAction, w.uint32(578).fork()).ldelim();
            if (m.privateProcessingSettingAction != null && Object.hasOwnProperty.call(m, "privateProcessingSettingAction"))
                $root.proto.SyncActionValue.PrivateProcessingSettingAction.encode(m.privateProcessingSettingAction, w.uint32(594).fork()).ldelim();
            if (m.newsletterSavedInterestsAction != null && Object.hasOwnProperty.call(m, "newsletterSavedInterestsAction"))
                $root.proto.SyncActionValue.NewsletterSavedInterestsAction.encode(m.newsletterSavedInterestsAction, w.uint32(602).fork()).ldelim();
            if (m.aiThreadRenameAction != null && Object.hasOwnProperty.call(m, "aiThreadRenameAction"))
                $root.proto.SyncActionValue.AiThreadRenameAction.encode(m.aiThreadRenameAction, w.uint32(610).fork()).ldelim();
            if (m.interactiveMessageAction != null && Object.hasOwnProperty.call(m, "interactiveMessageAction"))
                $root.proto.SyncActionValue.InteractiveMessageAction.encode(m.interactiveMessageAction, w.uint32(618).fork()).ldelim();
            return w;
        };

        SyncActionValue.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.timestamp = r.int64();
                        break;
                    }
                case 2: {
                        m.starAction = $root.proto.SyncActionValue.StarAction.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.contactAction = $root.proto.SyncActionValue.ContactAction.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.muteAction = $root.proto.SyncActionValue.MuteAction.decode(r, r.uint32());
                        break;
                    }
                case 5: {
                        m.pinAction = $root.proto.SyncActionValue.PinAction.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.pushNameSetting = $root.proto.SyncActionValue.PushNameSetting.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.quickReplyAction = $root.proto.SyncActionValue.QuickReplyAction.decode(r, r.uint32());
                        break;
                    }
                case 11: {
                        m.recentEmojiWeightsAction = $root.proto.SyncActionValue.RecentEmojiWeightsAction.decode(r, r.uint32());
                        break;
                    }
                case 14: {
                        m.labelEditAction = $root.proto.SyncActionValue.LabelEditAction.decode(r, r.uint32());
                        break;
                    }
                case 15: {
                        m.labelAssociationAction = $root.proto.SyncActionValue.LabelAssociationAction.decode(r, r.uint32());
                        break;
                    }
                case 16: {
                        m.localeSetting = $root.proto.SyncActionValue.LocaleSetting.decode(r, r.uint32());
                        break;
                    }
                case 17: {
                        m.archiveChatAction = $root.proto.SyncActionValue.ArchiveChatAction.decode(r, r.uint32());
                        break;
                    }
                case 18: {
                        m.deleteMessageForMeAction = $root.proto.SyncActionValue.DeleteMessageForMeAction.decode(r, r.uint32());
                        break;
                    }
                case 19: {
                        m.keyExpiration = $root.proto.SyncActionValue.KeyExpiration.decode(r, r.uint32());
                        break;
                    }
                case 20: {
                        m.markChatAsReadAction = $root.proto.SyncActionValue.MarkChatAsReadAction.decode(r, r.uint32());
                        break;
                    }
                case 21: {
                        m.clearChatAction = $root.proto.SyncActionValue.ClearChatAction.decode(r, r.uint32());
                        break;
                    }
                case 22: {
                        m.deleteChatAction = $root.proto.SyncActionValue.DeleteChatAction.decode(r, r.uint32());
                        break;
                    }
                case 23: {
                        m.unarchiveChatsSetting = $root.proto.SyncActionValue.UnarchiveChatsSetting.decode(r, r.uint32());
                        break;
                    }
                case 24: {
                        m.primaryFeature = $root.proto.SyncActionValue.PrimaryFeature.decode(r, r.uint32());
                        break;
                    }
                case 26: {
                        m.androidUnsupportedActions = $root.proto.SyncActionValue.AndroidUnsupportedActions.decode(r, r.uint32());
                        break;
                    }
                case 27: {
                        m.agentAction = $root.proto.SyncActionValue.AgentAction.decode(r, r.uint32());
                        break;
                    }
                case 28: {
                        m.subscriptionAction = $root.proto.SyncActionValue.SubscriptionAction.decode(r, r.uint32());
                        break;
                    }
                case 29: {
                        m.userStatusMuteAction = $root.proto.SyncActionValue.UserStatusMuteAction.decode(r, r.uint32());
                        break;
                    }
                case 30: {
                        m.timeFormatAction = $root.proto.SyncActionValue.TimeFormatAction.decode(r, r.uint32());
                        break;
                    }
                case 31: {
                        m.nuxAction = $root.proto.SyncActionValue.NuxAction.decode(r, r.uint32());
                        break;
                    }
                case 32: {
                        m.primaryVersionAction = $root.proto.SyncActionValue.PrimaryVersionAction.decode(r, r.uint32());
                        break;
                    }
                case 33: {
                        m.stickerAction = $root.proto.SyncActionValue.StickerAction.decode(r, r.uint32());
                        break;
                    }
                case 34: {
                        m.removeRecentStickerAction = $root.proto.SyncActionValue.RemoveRecentStickerAction.decode(r, r.uint32());
                        break;
                    }
                case 35: {
                        m.chatAssignment = $root.proto.SyncActionValue.ChatAssignmentAction.decode(r, r.uint32());
                        break;
                    }
                case 36: {
                        m.chatAssignmentOpenedStatus = $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.decode(r, r.uint32());
                        break;
                    }
                case 37: {
                        m.pnForLidChatAction = $root.proto.SyncActionValue.PnForLidChatAction.decode(r, r.uint32());
                        break;
                    }
                case 38: {
                        m.marketingMessageAction = $root.proto.SyncActionValue.MarketingMessageAction.decode(r, r.uint32());
                        break;
                    }
                case 39: {
                        m.marketingMessageBroadcastAction = $root.proto.SyncActionValue.MarketingMessageBroadcastAction.decode(r, r.uint32());
                        break;
                    }
                case 40: {
                        m.externalWebBetaAction = $root.proto.SyncActionValue.ExternalWebBetaAction.decode(r, r.uint32());
                        break;
                    }
                case 41: {
                        m.privacySettingRelayAllCalls = $root.proto.SyncActionValue.PrivacySettingRelayAllCalls.decode(r, r.uint32());
                        break;
                    }
                case 42: {
                        m.callLogAction = $root.proto.SyncActionValue.CallLogAction.decode(r, r.uint32());
                        break;
                    }
                case 43: {
                        m.ugcBot = $root.proto.SyncActionValue.UGCBot.decode(r, r.uint32());
                        break;
                    }
                case 44: {
                        m.statusPrivacy = $root.proto.SyncActionValue.StatusPrivacyAction.decode(r, r.uint32());
                        break;
                    }
                case 45: {
                        m.botWelcomeRequestAction = $root.proto.SyncActionValue.BotWelcomeRequestAction.decode(r, r.uint32());
                        break;
                    }
                case 46: {
                        m.deleteIndividualCallLog = $root.proto.SyncActionValue.DeleteIndividualCallLogAction.decode(r, r.uint32());
                        break;
                    }
                case 47: {
                        m.labelReorderingAction = $root.proto.SyncActionValue.LabelReorderingAction.decode(r, r.uint32());
                        break;
                    }
                case 48: {
                        m.paymentInfoAction = $root.proto.SyncActionValue.PaymentInfoAction.decode(r, r.uint32());
                        break;
                    }
                case 49: {
                        m.customPaymentMethodsAction = $root.proto.SyncActionValue.CustomPaymentMethodsAction.decode(r, r.uint32());
                        break;
                    }
                case 50: {
                        m.lockChatAction = $root.proto.SyncActionValue.LockChatAction.decode(r, r.uint32());
                        break;
                    }
                case 51: {
                        m.chatLockSettings = $root.proto.ChatLockSettings.decode(r, r.uint32());
                        break;
                    }
                case 52: {
                        m.wamoUserIdentifierAction = $root.proto.SyncActionValue.WamoUserIdentifierAction.decode(r, r.uint32());
                        break;
                    }
                case 53: {
                        m.privacySettingDisableLinkPreviewsAction = $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.decode(r, r.uint32());
                        break;
                    }
                case 54: {
                        m.deviceCapabilities = $root.proto.DeviceCapabilities.decode(r, r.uint32());
                        break;
                    }
                case 55: {
                        m.noteEditAction = $root.proto.SyncActionValue.NoteEditAction.decode(r, r.uint32());
                        break;
                    }
                case 56: {
                        m.favoritesAction = $root.proto.SyncActionValue.FavoritesAction.decode(r, r.uint32());
                        break;
                    }
                case 57: {
                        m.merchantPaymentPartnerAction = $root.proto.SyncActionValue.MerchantPaymentPartnerAction.decode(r, r.uint32());
                        break;
                    }
                case 58: {
                        m.waffleAccountLinkStateAction = $root.proto.SyncActionValue.WaffleAccountLinkStateAction.decode(r, r.uint32());
                        break;
                    }
                case 59: {
                        m.usernameChatStartMode = $root.proto.SyncActionValue.UsernameChatStartModeAction.decode(r, r.uint32());
                        break;
                    }
                case 60: {
                        m.notificationActivitySettingAction = $root.proto.SyncActionValue.NotificationActivitySettingAction.decode(r, r.uint32());
                        break;
                    }
                case 61: {
                        m.lidContactAction = $root.proto.SyncActionValue.LidContactAction.decode(r, r.uint32());
                        break;
                    }
                case 62: {
                        m.ctwaPerCustomerDataSharingAction = $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.decode(r, r.uint32());
                        break;
                    }
                case 63: {
                        m.paymentTosAction = $root.proto.SyncActionValue.PaymentTosAction.decode(r, r.uint32());
                        break;
                    }
                case 64: {
                        m.privacySettingChannelsPersonalisedRecommendationAction = $root.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.decode(r, r.uint32());
                        break;
                    }
                case 65: {
                        m.businessBroadcastAssociationAction = $root.proto.SyncActionValue.BusinessBroadcastAssociationAction.decode(r, r.uint32());
                        break;
                    }
                case 66: {
                        m.detectedOutcomesStatusAction = $root.proto.SyncActionValue.DetectedOutcomesStatusAction.decode(r, r.uint32());
                        break;
                    }
                case 68: {
                        m.maibaAiFeaturesControlAction = $root.proto.SyncActionValue.MaibaAIFeaturesControlAction.decode(r, r.uint32());
                        break;
                    }
                case 69: {
                        m.businessBroadcastListAction = $root.proto.SyncActionValue.BusinessBroadcastListAction.decode(r, r.uint32());
                        break;
                    }
                case 70: {
                        m.musicUserIdAction = $root.proto.SyncActionValue.MusicUserIdAction.decode(r, r.uint32());
                        break;
                    }
                case 71: {
                        m.statusPostOptInNotificationPreferencesAction = $root.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.decode(r, r.uint32());
                        break;
                    }
                case 72: {
                        m.avatarUpdatedAction = $root.proto.SyncActionValue.AvatarUpdatedAction.decode(r, r.uint32());
                        break;
                    }
                case 74: {
                        m.privateProcessingSettingAction = $root.proto.SyncActionValue.PrivateProcessingSettingAction.decode(r, r.uint32());
                        break;
                    }
                case 75: {
                        m.newsletterSavedInterestsAction = $root.proto.SyncActionValue.NewsletterSavedInterestsAction.decode(r, r.uint32());
                        break;
                    }
                case 76: {
                        m.aiThreadRenameAction = $root.proto.SyncActionValue.AiThreadRenameAction.decode(r, r.uint32());
                        break;
                    }
                case 77: {
                        m.interactiveMessageAction = $root.proto.SyncActionValue.InteractiveMessageAction.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncActionValue.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncActionValue)
                return d;
            var m = new $root.proto.SyncActionValue();
            if (d.timestamp != null) {
                if ($util.Long)
                    (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                else if (typeof d.timestamp === "string")
                    m.timestamp = parseInt(d.timestamp, 10);
                else if (typeof d.timestamp === "number")
                    m.timestamp = d.timestamp;
                else if (typeof d.timestamp === "object")
                    m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
            }
            if (d.starAction != null) {
                if (typeof d.starAction !== "object")
                    throw TypeError(".proto.SyncActionValue.starAction: object expected");
                m.starAction = $root.proto.SyncActionValue.StarAction.fromObject(d.starAction);
            }
            if (d.contactAction != null) {
                if (typeof d.contactAction !== "object")
                    throw TypeError(".proto.SyncActionValue.contactAction: object expected");
                m.contactAction = $root.proto.SyncActionValue.ContactAction.fromObject(d.contactAction);
            }
            if (d.muteAction != null) {
                if (typeof d.muteAction !== "object")
                    throw TypeError(".proto.SyncActionValue.muteAction: object expected");
                m.muteAction = $root.proto.SyncActionValue.MuteAction.fromObject(d.muteAction);
            }
            if (d.pinAction != null) {
                if (typeof d.pinAction !== "object")
                    throw TypeError(".proto.SyncActionValue.pinAction: object expected");
                m.pinAction = $root.proto.SyncActionValue.PinAction.fromObject(d.pinAction);
            }
            if (d.pushNameSetting != null) {
                if (typeof d.pushNameSetting !== "object")
                    throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected");
                m.pushNameSetting = $root.proto.SyncActionValue.PushNameSetting.fromObject(d.pushNameSetting);
            }
            if (d.quickReplyAction != null) {
                if (typeof d.quickReplyAction !== "object")
                    throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected");
                m.quickReplyAction = $root.proto.SyncActionValue.QuickReplyAction.fromObject(d.quickReplyAction);
            }
            if (d.recentEmojiWeightsAction != null) {
                if (typeof d.recentEmojiWeightsAction !== "object")
                    throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected");
                m.recentEmojiWeightsAction = $root.proto.SyncActionValue.RecentEmojiWeightsAction.fromObject(d.recentEmojiWeightsAction);
            }
            if (d.labelEditAction != null) {
                if (typeof d.labelEditAction !== "object")
                    throw TypeError(".proto.SyncActionValue.labelEditAction: object expected");
                m.labelEditAction = $root.proto.SyncActionValue.LabelEditAction.fromObject(d.labelEditAction);
            }
            if (d.labelAssociationAction != null) {
                if (typeof d.labelAssociationAction !== "object")
                    throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected");
                m.labelAssociationAction = $root.proto.SyncActionValue.LabelAssociationAction.fromObject(d.labelAssociationAction);
            }
            if (d.localeSetting != null) {
                if (typeof d.localeSetting !== "object")
                    throw TypeError(".proto.SyncActionValue.localeSetting: object expected");
                m.localeSetting = $root.proto.SyncActionValue.LocaleSetting.fromObject(d.localeSetting);
            }
            if (d.archiveChatAction != null) {
                if (typeof d.archiveChatAction !== "object")
                    throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected");
                m.archiveChatAction = $root.proto.SyncActionValue.ArchiveChatAction.fromObject(d.archiveChatAction);
            }
            if (d.deleteMessageForMeAction != null) {
                if (typeof d.deleteMessageForMeAction !== "object")
                    throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected");
                m.deleteMessageForMeAction = $root.proto.SyncActionValue.DeleteMessageForMeAction.fromObject(d.deleteMessageForMeAction);
            }
            if (d.keyExpiration != null) {
                if (typeof d.keyExpiration !== "object")
                    throw TypeError(".proto.SyncActionValue.keyExpiration: object expected");
                m.keyExpiration = $root.proto.SyncActionValue.KeyExpiration.fromObject(d.keyExpiration);
            }
            if (d.markChatAsReadAction != null) {
                if (typeof d.markChatAsReadAction !== "object")
                    throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected");
                m.markChatAsReadAction = $root.proto.SyncActionValue.MarkChatAsReadAction.fromObject(d.markChatAsReadAction);
            }
            if (d.clearChatAction != null) {
                if (typeof d.clearChatAction !== "object")
                    throw TypeError(".proto.SyncActionValue.clearChatAction: object expected");
                m.clearChatAction = $root.proto.SyncActionValue.ClearChatAction.fromObject(d.clearChatAction);
            }
            if (d.deleteChatAction != null) {
                if (typeof d.deleteChatAction !== "object")
                    throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected");
                m.deleteChatAction = $root.proto.SyncActionValue.DeleteChatAction.fromObject(d.deleteChatAction);
            }
            if (d.unarchiveChatsSetting != null) {
                if (typeof d.unarchiveChatsSetting !== "object")
                    throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected");
                m.unarchiveChatsSetting = $root.proto.SyncActionValue.UnarchiveChatsSetting.fromObject(d.unarchiveChatsSetting);
            }
            if (d.primaryFeature != null) {
                if (typeof d.primaryFeature !== "object")
                    throw TypeError(".proto.SyncActionValue.primaryFeature: object expected");
                m.primaryFeature = $root.proto.SyncActionValue.PrimaryFeature.fromObject(d.primaryFeature);
            }
            if (d.androidUnsupportedActions != null) {
                if (typeof d.androidUnsupportedActions !== "object")
                    throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected");
                m.androidUnsupportedActions = $root.proto.SyncActionValue.AndroidUnsupportedActions.fromObject(d.androidUnsupportedActions);
            }
            if (d.agentAction != null) {
                if (typeof d.agentAction !== "object")
                    throw TypeError(".proto.SyncActionValue.agentAction: object expected");
                m.agentAction = $root.proto.SyncActionValue.AgentAction.fromObject(d.agentAction);
            }
            if (d.subscriptionAction != null) {
                if (typeof d.subscriptionAction !== "object")
                    throw TypeError(".proto.SyncActionValue.subscriptionAction: object expected");
                m.subscriptionAction = $root.proto.SyncActionValue.SubscriptionAction.fromObject(d.subscriptionAction);
            }
            if (d.userStatusMuteAction != null) {
                if (typeof d.userStatusMuteAction !== "object")
                    throw TypeError(".proto.SyncActionValue.userStatusMuteAction: object expected");
                m.userStatusMuteAction = $root.proto.SyncActionValue.UserStatusMuteAction.fromObject(d.userStatusMuteAction);
            }
            if (d.timeFormatAction != null) {
                if (typeof d.timeFormatAction !== "object")
                    throw TypeError(".proto.SyncActionValue.timeFormatAction: object expected");
                m.timeFormatAction = $root.proto.SyncActionValue.TimeFormatAction.fromObject(d.timeFormatAction);
            }
            if (d.nuxAction != null) {
                if (typeof d.nuxAction !== "object")
                    throw TypeError(".proto.SyncActionValue.nuxAction: object expected");
                m.nuxAction = $root.proto.SyncActionValue.NuxAction.fromObject(d.nuxAction);
            }
            if (d.primaryVersionAction != null) {
                if (typeof d.primaryVersionAction !== "object")
                    throw TypeError(".proto.SyncActionValue.primaryVersionAction: object expected");
                m.primaryVersionAction = $root.proto.SyncActionValue.PrimaryVersionAction.fromObject(d.primaryVersionAction);
            }
            if (d.stickerAction != null) {
                if (typeof d.stickerAction !== "object")
                    throw TypeError(".proto.SyncActionValue.stickerAction: object expected");
                m.stickerAction = $root.proto.SyncActionValue.StickerAction.fromObject(d.stickerAction);
            }
            if (d.removeRecentStickerAction != null) {
                if (typeof d.removeRecentStickerAction !== "object")
                    throw TypeError(".proto.SyncActionValue.removeRecentStickerAction: object expected");
                m.removeRecentStickerAction = $root.proto.SyncActionValue.RemoveRecentStickerAction.fromObject(d.removeRecentStickerAction);
            }
            if (d.chatAssignment != null) {
                if (typeof d.chatAssignment !== "object")
                    throw TypeError(".proto.SyncActionValue.chatAssignment: object expected");
                m.chatAssignment = $root.proto.SyncActionValue.ChatAssignmentAction.fromObject(d.chatAssignment);
            }
            if (d.chatAssignmentOpenedStatus != null) {
                if (typeof d.chatAssignmentOpenedStatus !== "object")
                    throw TypeError(".proto.SyncActionValue.chatAssignmentOpenedStatus: object expected");
                m.chatAssignmentOpenedStatus = $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.fromObject(d.chatAssignmentOpenedStatus);
            }
            if (d.pnForLidChatAction != null) {
                if (typeof d.pnForLidChatAction !== "object")
                    throw TypeError(".proto.SyncActionValue.pnForLidChatAction: object expected");
                m.pnForLidChatAction = $root.proto.SyncActionValue.PnForLidChatAction.fromObject(d.pnForLidChatAction);
            }
            if (d.marketingMessageAction != null) {
                if (typeof d.marketingMessageAction !== "object")
                    throw TypeError(".proto.SyncActionValue.marketingMessageAction: object expected");
                m.marketingMessageAction = $root.proto.SyncActionValue.MarketingMessageAction.fromObject(d.marketingMessageAction);
            }
            if (d.marketingMessageBroadcastAction != null) {
                if (typeof d.marketingMessageBroadcastAction !== "object")
                    throw TypeError(".proto.SyncActionValue.marketingMessageBroadcastAction: object expected");
                m.marketingMessageBroadcastAction = $root.proto.SyncActionValue.MarketingMessageBroadcastAction.fromObject(d.marketingMessageBroadcastAction);
            }
            if (d.externalWebBetaAction != null) {
                if (typeof d.externalWebBetaAction !== "object")
                    throw TypeError(".proto.SyncActionValue.externalWebBetaAction: object expected");
                m.externalWebBetaAction = $root.proto.SyncActionValue.ExternalWebBetaAction.fromObject(d.externalWebBetaAction);
            }
            if (d.privacySettingRelayAllCalls != null) {
                if (typeof d.privacySettingRelayAllCalls !== "object")
                    throw TypeError(".proto.SyncActionValue.privacySettingRelayAllCalls: object expected");
                m.privacySettingRelayAllCalls = $root.proto.SyncActionValue.PrivacySettingRelayAllCalls.fromObject(d.privacySettingRelayAllCalls);
            }
            if (d.callLogAction != null) {
                if (typeof d.callLogAction !== "object")
                    throw TypeError(".proto.SyncActionValue.callLogAction: object expected");
                m.callLogAction = $root.proto.SyncActionValue.CallLogAction.fromObject(d.callLogAction);
            }
            if (d.ugcBot != null) {
                if (typeof d.ugcBot !== "object")
                    throw TypeError(".proto.SyncActionValue.ugcBot: object expected");
                m.ugcBot = $root.proto.SyncActionValue.UGCBot.fromObject(d.ugcBot);
            }
            if (d.statusPrivacy != null) {
                if (typeof d.statusPrivacy !== "object")
                    throw TypeError(".proto.SyncActionValue.statusPrivacy: object expected");
                m.statusPrivacy = $root.proto.SyncActionValue.StatusPrivacyAction.fromObject(d.statusPrivacy);
            }
            if (d.botWelcomeRequestAction != null) {
                if (typeof d.botWelcomeRequestAction !== "object")
                    throw TypeError(".proto.SyncActionValue.botWelcomeRequestAction: object expected");
                m.botWelcomeRequestAction = $root.proto.SyncActionValue.BotWelcomeRequestAction.fromObject(d.botWelcomeRequestAction);
            }
            if (d.deleteIndividualCallLog != null) {
                if (typeof d.deleteIndividualCallLog !== "object")
                    throw TypeError(".proto.SyncActionValue.deleteIndividualCallLog: object expected");
                m.deleteIndividualCallLog = $root.proto.SyncActionValue.DeleteIndividualCallLogAction.fromObject(d.deleteIndividualCallLog);
            }
            if (d.labelReorderingAction != null) {
                if (typeof d.labelReorderingAction !== "object")
                    throw TypeError(".proto.SyncActionValue.labelReorderingAction: object expected");
                m.labelReorderingAction = $root.proto.SyncActionValue.LabelReorderingAction.fromObject(d.labelReorderingAction);
            }
            if (d.paymentInfoAction != null) {
                if (typeof d.paymentInfoAction !== "object")
                    throw TypeError(".proto.SyncActionValue.paymentInfoAction: object expected");
                m.paymentInfoAction = $root.proto.SyncActionValue.PaymentInfoAction.fromObject(d.paymentInfoAction);
            }
            if (d.customPaymentMethodsAction != null) {
                if (typeof d.customPaymentMethodsAction !== "object")
                    throw TypeError(".proto.SyncActionValue.customPaymentMethodsAction: object expected");
                m.customPaymentMethodsAction = $root.proto.SyncActionValue.CustomPaymentMethodsAction.fromObject(d.customPaymentMethodsAction);
            }
            if (d.lockChatAction != null) {
                if (typeof d.lockChatAction !== "object")
                    throw TypeError(".proto.SyncActionValue.lockChatAction: object expected");
                m.lockChatAction = $root.proto.SyncActionValue.LockChatAction.fromObject(d.lockChatAction);
            }
            if (d.chatLockSettings != null) {
                if (typeof d.chatLockSettings !== "object")
                    throw TypeError(".proto.SyncActionValue.chatLockSettings: object expected");
                m.chatLockSettings = $root.proto.ChatLockSettings.fromObject(d.chatLockSettings);
            }
            if (d.wamoUserIdentifierAction != null) {
                if (typeof d.wamoUserIdentifierAction !== "object")
                    throw TypeError(".proto.SyncActionValue.wamoUserIdentifierAction: object expected");
                m.wamoUserIdentifierAction = $root.proto.SyncActionValue.WamoUserIdentifierAction.fromObject(d.wamoUserIdentifierAction);
            }
            if (d.privacySettingDisableLinkPreviewsAction != null) {
                if (typeof d.privacySettingDisableLinkPreviewsAction !== "object")
                    throw TypeError(".proto.SyncActionValue.privacySettingDisableLinkPreviewsAction: object expected");
                m.privacySettingDisableLinkPreviewsAction = $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.fromObject(d.privacySettingDisableLinkPreviewsAction);
            }
            if (d.deviceCapabilities != null) {
                if (typeof d.deviceCapabilities !== "object")
                    throw TypeError(".proto.SyncActionValue.deviceCapabilities: object expected");
                m.deviceCapabilities = $root.proto.DeviceCapabilities.fromObject(d.deviceCapabilities);
            }
            if (d.noteEditAction != null) {
                if (typeof d.noteEditAction !== "object")
                    throw TypeError(".proto.SyncActionValue.noteEditAction: object expected");
                m.noteEditAction = $root.proto.SyncActionValue.NoteEditAction.fromObject(d.noteEditAction);
            }
            if (d.favoritesAction != null) {
                if (typeof d.favoritesAction !== "object")
                    throw TypeError(".proto.SyncActionValue.favoritesAction: object expected");
                m.favoritesAction = $root.proto.SyncActionValue.FavoritesAction.fromObject(d.favoritesAction);
            }
            if (d.merchantPaymentPartnerAction != null) {
                if (typeof d.merchantPaymentPartnerAction !== "object")
                    throw TypeError(".proto.SyncActionValue.merchantPaymentPartnerAction: object expected");
                m.merchantPaymentPartnerAction = $root.proto.SyncActionValue.MerchantPaymentPartnerAction.fromObject(d.merchantPaymentPartnerAction);
            }
            if (d.waffleAccountLinkStateAction != null) {
                if (typeof d.waffleAccountLinkStateAction !== "object")
                    throw TypeError(".proto.SyncActionValue.waffleAccountLinkStateAction: object expected");
                m.waffleAccountLinkStateAction = $root.proto.SyncActionValue.WaffleAccountLinkStateAction.fromObject(d.waffleAccountLinkStateAction);
            }
            if (d.usernameChatStartMode != null) {
                if (typeof d.usernameChatStartMode !== "object")
                    throw TypeError(".proto.SyncActionValue.usernameChatStartMode: object expected");
                m.usernameChatStartMode = $root.proto.SyncActionValue.UsernameChatStartModeAction.fromObject(d.usernameChatStartMode);
            }
            if (d.notificationActivitySettingAction != null) {
                if (typeof d.notificationActivitySettingAction !== "object")
                    throw TypeError(".proto.SyncActionValue.notificationActivitySettingAction: object expected");
                m.notificationActivitySettingAction = $root.proto.SyncActionValue.NotificationActivitySettingAction.fromObject(d.notificationActivitySettingAction);
            }
            if (d.lidContactAction != null) {
                if (typeof d.lidContactAction !== "object")
                    throw TypeError(".proto.SyncActionValue.lidContactAction: object expected");
                m.lidContactAction = $root.proto.SyncActionValue.LidContactAction.fromObject(d.lidContactAction);
            }
            if (d.ctwaPerCustomerDataSharingAction != null) {
                if (typeof d.ctwaPerCustomerDataSharingAction !== "object")
                    throw TypeError(".proto.SyncActionValue.ctwaPerCustomerDataSharingAction: object expected");
                m.ctwaPerCustomerDataSharingAction = $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.fromObject(d.ctwaPerCustomerDataSharingAction);
            }
            if (d.paymentTosAction != null) {
                if (typeof d.paymentTosAction !== "object")
                    throw TypeError(".proto.SyncActionValue.paymentTosAction: object expected");
                m.paymentTosAction = $root.proto.SyncActionValue.PaymentTosAction.fromObject(d.paymentTosAction);
            }
            if (d.privacySettingChannelsPersonalisedRecommendationAction != null) {
                if (typeof d.privacySettingChannelsPersonalisedRecommendationAction !== "object")
                    throw TypeError(".proto.SyncActionValue.privacySettingChannelsPersonalisedRecommendationAction: object expected");
                m.privacySettingChannelsPersonalisedRecommendationAction = $root.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.fromObject(d.privacySettingChannelsPersonalisedRecommendationAction);
            }
            if (d.businessBroadcastAssociationAction != null) {
                if (typeof d.businessBroadcastAssociationAction !== "object")
                    throw TypeError(".proto.SyncActionValue.businessBroadcastAssociationAction: object expected");
                m.businessBroadcastAssociationAction = $root.proto.SyncActionValue.BusinessBroadcastAssociationAction.fromObject(d.businessBroadcastAssociationAction);
            }
            if (d.detectedOutcomesStatusAction != null) {
                if (typeof d.detectedOutcomesStatusAction !== "object")
                    throw TypeError(".proto.SyncActionValue.detectedOutcomesStatusAction: object expected");
                m.detectedOutcomesStatusAction = $root.proto.SyncActionValue.DetectedOutcomesStatusAction.fromObject(d.detectedOutcomesStatusAction);
            }
            if (d.maibaAiFeaturesControlAction != null) {
                if (typeof d.maibaAiFeaturesControlAction !== "object")
                    throw TypeError(".proto.SyncActionValue.maibaAiFeaturesControlAction: object expected");
                m.maibaAiFeaturesControlAction = $root.proto.SyncActionValue.MaibaAIFeaturesControlAction.fromObject(d.maibaAiFeaturesControlAction);
            }
            if (d.businessBroadcastListAction != null) {
                if (typeof d.businessBroadcastListAction !== "object")
                    throw TypeError(".proto.SyncActionValue.businessBroadcastListAction: object expected");
                m.businessBroadcastListAction = $root.proto.SyncActionValue.BusinessBroadcastListAction.fromObject(d.businessBroadcastListAction);
            }
            if (d.musicUserIdAction != null) {
                if (typeof d.musicUserIdAction !== "object")
                    throw TypeError(".proto.SyncActionValue.musicUserIdAction: object expected");
                m.musicUserIdAction = $root.proto.SyncActionValue.MusicUserIdAction.fromObject(d.musicUserIdAction);
            }
            if (d.statusPostOptInNotificationPreferencesAction != null) {
                if (typeof d.statusPostOptInNotificationPreferencesAction !== "object")
                    throw TypeError(".proto.SyncActionValue.statusPostOptInNotificationPreferencesAction: object expected");
                m.statusPostOptInNotificationPreferencesAction = $root.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.fromObject(d.statusPostOptInNotificationPreferencesAction);
            }
            if (d.avatarUpdatedAction != null) {
                if (typeof d.avatarUpdatedAction !== "object")
                    throw TypeError(".proto.SyncActionValue.avatarUpdatedAction: object expected");
                m.avatarUpdatedAction = $root.proto.SyncActionValue.AvatarUpdatedAction.fromObject(d.avatarUpdatedAction);
            }
            if (d.privateProcessingSettingAction != null) {
                if (typeof d.privateProcessingSettingAction !== "object")
                    throw TypeError(".proto.SyncActionValue.privateProcessingSettingAction: object expected");
                m.privateProcessingSettingAction = $root.proto.SyncActionValue.PrivateProcessingSettingAction.fromObject(d.privateProcessingSettingAction);
            }
            if (d.newsletterSavedInterestsAction != null) {
                if (typeof d.newsletterSavedInterestsAction !== "object")
                    throw TypeError(".proto.SyncActionValue.newsletterSavedInterestsAction: object expected");
                m.newsletterSavedInterestsAction = $root.proto.SyncActionValue.NewsletterSavedInterestsAction.fromObject(d.newsletterSavedInterestsAction);
            }
            if (d.aiThreadRenameAction != null) {
                if (typeof d.aiThreadRenameAction !== "object")
                    throw TypeError(".proto.SyncActionValue.aiThreadRenameAction: object expected");
                m.aiThreadRenameAction = $root.proto.SyncActionValue.AiThreadRenameAction.fromObject(d.aiThreadRenameAction);
            }
            if (d.interactiveMessageAction != null) {
                if (typeof d.interactiveMessageAction !== "object")
                    throw TypeError(".proto.SyncActionValue.interactiveMessageAction: object expected");
                m.interactiveMessageAction = $root.proto.SyncActionValue.InteractiveMessageAction.fromObject(d.interactiveMessageAction);
            }
            return m;
        };

        SyncActionValue.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                if (typeof m.timestamp === "number")
                    d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                else
                    d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                if (o.oneofs)
                    d._timestamp = "timestamp";
            }
            if (m.starAction != null && m.hasOwnProperty("starAction")) {
                d.starAction = $root.proto.SyncActionValue.StarAction.toObject(m.starAction, o);
                if (o.oneofs)
                    d._starAction = "starAction";
            }
            if (m.contactAction != null && m.hasOwnProperty("contactAction")) {
                d.contactAction = $root.proto.SyncActionValue.ContactAction.toObject(m.contactAction, o);
                if (o.oneofs)
                    d._contactAction = "contactAction";
            }
            if (m.muteAction != null && m.hasOwnProperty("muteAction")) {
                d.muteAction = $root.proto.SyncActionValue.MuteAction.toObject(m.muteAction, o);
                if (o.oneofs)
                    d._muteAction = "muteAction";
            }
            if (m.pinAction != null && m.hasOwnProperty("pinAction")) {
                d.pinAction = $root.proto.SyncActionValue.PinAction.toObject(m.pinAction, o);
                if (o.oneofs)
                    d._pinAction = "pinAction";
            }
            if (m.pushNameSetting != null && m.hasOwnProperty("pushNameSetting")) {
                d.pushNameSetting = $root.proto.SyncActionValue.PushNameSetting.toObject(m.pushNameSetting, o);
                if (o.oneofs)
                    d._pushNameSetting = "pushNameSetting";
            }
            if (m.quickReplyAction != null && m.hasOwnProperty("quickReplyAction")) {
                d.quickReplyAction = $root.proto.SyncActionValue.QuickReplyAction.toObject(m.quickReplyAction, o);
                if (o.oneofs)
                    d._quickReplyAction = "quickReplyAction";
            }
            if (m.recentEmojiWeightsAction != null && m.hasOwnProperty("recentEmojiWeightsAction")) {
                d.recentEmojiWeightsAction = $root.proto.SyncActionValue.RecentEmojiWeightsAction.toObject(m.recentEmojiWeightsAction, o);
                if (o.oneofs)
                    d._recentEmojiWeightsAction = "recentEmojiWeightsAction";
            }
            if (m.labelEditAction != null && m.hasOwnProperty("labelEditAction")) {
                d.labelEditAction = $root.proto.SyncActionValue.LabelEditAction.toObject(m.labelEditAction, o);
                if (o.oneofs)
                    d._labelEditAction = "labelEditAction";
            }
            if (m.labelAssociationAction != null && m.hasOwnProperty("labelAssociationAction")) {
                d.labelAssociationAction = $root.proto.SyncActionValue.LabelAssociationAction.toObject(m.labelAssociationAction, o);
                if (o.oneofs)
                    d._labelAssociationAction = "labelAssociationAction";
            }
            if (m.localeSetting != null && m.hasOwnProperty("localeSetting")) {
                d.localeSetting = $root.proto.SyncActionValue.LocaleSetting.toObject(m.localeSetting, o);
                if (o.oneofs)
                    d._localeSetting = "localeSetting";
            }
            if (m.archiveChatAction != null && m.hasOwnProperty("archiveChatAction")) {
                d.archiveChatAction = $root.proto.SyncActionValue.ArchiveChatAction.toObject(m.archiveChatAction, o);
                if (o.oneofs)
                    d._archiveChatAction = "archiveChatAction";
            }
            if (m.deleteMessageForMeAction != null && m.hasOwnProperty("deleteMessageForMeAction")) {
                d.deleteMessageForMeAction = $root.proto.SyncActionValue.DeleteMessageForMeAction.toObject(m.deleteMessageForMeAction, o);
                if (o.oneofs)
                    d._deleteMessageForMeAction = "deleteMessageForMeAction";
            }
            if (m.keyExpiration != null && m.hasOwnProperty("keyExpiration")) {
                d.keyExpiration = $root.proto.SyncActionValue.KeyExpiration.toObject(m.keyExpiration, o);
                if (o.oneofs)
                    d._keyExpiration = "keyExpiration";
            }
            if (m.markChatAsReadAction != null && m.hasOwnProperty("markChatAsReadAction")) {
                d.markChatAsReadAction = $root.proto.SyncActionValue.MarkChatAsReadAction.toObject(m.markChatAsReadAction, o);
                if (o.oneofs)
                    d._markChatAsReadAction = "markChatAsReadAction";
            }
            if (m.clearChatAction != null && m.hasOwnProperty("clearChatAction")) {
                d.clearChatAction = $root.proto.SyncActionValue.ClearChatAction.toObject(m.clearChatAction, o);
                if (o.oneofs)
                    d._clearChatAction = "clearChatAction";
            }
            if (m.deleteChatAction != null && m.hasOwnProperty("deleteChatAction")) {
                d.deleteChatAction = $root.proto.SyncActionValue.DeleteChatAction.toObject(m.deleteChatAction, o);
                if (o.oneofs)
                    d._deleteChatAction = "deleteChatAction";
            }
            if (m.unarchiveChatsSetting != null && m.hasOwnProperty("unarchiveChatsSetting")) {
                d.unarchiveChatsSetting = $root.proto.SyncActionValue.UnarchiveChatsSetting.toObject(m.unarchiveChatsSetting, o);
                if (o.oneofs)
                    d._unarchiveChatsSetting = "unarchiveChatsSetting";
            }
            if (m.primaryFeature != null && m.hasOwnProperty("primaryFeature")) {
                d.primaryFeature = $root.proto.SyncActionValue.PrimaryFeature.toObject(m.primaryFeature, o);
                if (o.oneofs)
                    d._primaryFeature = "primaryFeature";
            }
            if (m.androidUnsupportedActions != null && m.hasOwnProperty("androidUnsupportedActions")) {
                d.androidUnsupportedActions = $root.proto.SyncActionValue.AndroidUnsupportedActions.toObject(m.androidUnsupportedActions, o);
                if (o.oneofs)
                    d._androidUnsupportedActions = "androidUnsupportedActions";
            }
            if (m.agentAction != null && m.hasOwnProperty("agentAction")) {
                d.agentAction = $root.proto.SyncActionValue.AgentAction.toObject(m.agentAction, o);
                if (o.oneofs)
                    d._agentAction = "agentAction";
            }
            if (m.subscriptionAction != null && m.hasOwnProperty("subscriptionAction")) {
                d.subscriptionAction = $root.proto.SyncActionValue.SubscriptionAction.toObject(m.subscriptionAction, o);
                if (o.oneofs)
                    d._subscriptionAction = "subscriptionAction";
            }
            if (m.userStatusMuteAction != null && m.hasOwnProperty("userStatusMuteAction")) {
                d.userStatusMuteAction = $root.proto.SyncActionValue.UserStatusMuteAction.toObject(m.userStatusMuteAction, o);
                if (o.oneofs)
                    d._userStatusMuteAction = "userStatusMuteAction";
            }
            if (m.timeFormatAction != null && m.hasOwnProperty("timeFormatAction")) {
                d.timeFormatAction = $root.proto.SyncActionValue.TimeFormatAction.toObject(m.timeFormatAction, o);
                if (o.oneofs)
                    d._timeFormatAction = "timeFormatAction";
            }
            if (m.nuxAction != null && m.hasOwnProperty("nuxAction")) {
                d.nuxAction = $root.proto.SyncActionValue.NuxAction.toObject(m.nuxAction, o);
                if (o.oneofs)
                    d._nuxAction = "nuxAction";
            }
            if (m.primaryVersionAction != null && m.hasOwnProperty("primaryVersionAction")) {
                d.primaryVersionAction = $root.proto.SyncActionValue.PrimaryVersionAction.toObject(m.primaryVersionAction, o);
                if (o.oneofs)
                    d._primaryVersionAction = "primaryVersionAction";
            }
            if (m.stickerAction != null && m.hasOwnProperty("stickerAction")) {
                d.stickerAction = $root.proto.SyncActionValue.StickerAction.toObject(m.stickerAction, o);
                if (o.oneofs)
                    d._stickerAction = "stickerAction";
            }
            if (m.removeRecentStickerAction != null && m.hasOwnProperty("removeRecentStickerAction")) {
                d.removeRecentStickerAction = $root.proto.SyncActionValue.RemoveRecentStickerAction.toObject(m.removeRecentStickerAction, o);
                if (o.oneofs)
                    d._removeRecentStickerAction = "removeRecentStickerAction";
            }
            if (m.chatAssignment != null && m.hasOwnProperty("chatAssignment")) {
                d.chatAssignment = $root.proto.SyncActionValue.ChatAssignmentAction.toObject(m.chatAssignment, o);
                if (o.oneofs)
                    d._chatAssignment = "chatAssignment";
            }
            if (m.chatAssignmentOpenedStatus != null && m.hasOwnProperty("chatAssignmentOpenedStatus")) {
                d.chatAssignmentOpenedStatus = $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.toObject(m.chatAssignmentOpenedStatus, o);
                if (o.oneofs)
                    d._chatAssignmentOpenedStatus = "chatAssignmentOpenedStatus";
            }
            if (m.pnForLidChatAction != null && m.hasOwnProperty("pnForLidChatAction")) {
                d.pnForLidChatAction = $root.proto.SyncActionValue.PnForLidChatAction.toObject(m.pnForLidChatAction, o);
                if (o.oneofs)
                    d._pnForLidChatAction = "pnForLidChatAction";
            }
            if (m.marketingMessageAction != null && m.hasOwnProperty("marketingMessageAction")) {
                d.marketingMessageAction = $root.proto.SyncActionValue.MarketingMessageAction.toObject(m.marketingMessageAction, o);
                if (o.oneofs)
                    d._marketingMessageAction = "marketingMessageAction";
            }
            if (m.marketingMessageBroadcastAction != null && m.hasOwnProperty("marketingMessageBroadcastAction")) {
                d.marketingMessageBroadcastAction = $root.proto.SyncActionValue.MarketingMessageBroadcastAction.toObject(m.marketingMessageBroadcastAction, o);
                if (o.oneofs)
                    d._marketingMessageBroadcastAction = "marketingMessageBroadcastAction";
            }
            if (m.externalWebBetaAction != null && m.hasOwnProperty("externalWebBetaAction")) {
                d.externalWebBetaAction = $root.proto.SyncActionValue.ExternalWebBetaAction.toObject(m.externalWebBetaAction, o);
                if (o.oneofs)
                    d._externalWebBetaAction = "externalWebBetaAction";
            }
            if (m.privacySettingRelayAllCalls != null && m.hasOwnProperty("privacySettingRelayAllCalls")) {
                d.privacySettingRelayAllCalls = $root.proto.SyncActionValue.PrivacySettingRelayAllCalls.toObject(m.privacySettingRelayAllCalls, o);
                if (o.oneofs)
                    d._privacySettingRelayAllCalls = "privacySettingRelayAllCalls";
            }
            if (m.callLogAction != null && m.hasOwnProperty("callLogAction")) {
                d.callLogAction = $root.proto.SyncActionValue.CallLogAction.toObject(m.callLogAction, o);
                if (o.oneofs)
                    d._callLogAction = "callLogAction";
            }
            if (m.ugcBot != null && m.hasOwnProperty("ugcBot")) {
                d.ugcBot = $root.proto.SyncActionValue.UGCBot.toObject(m.ugcBot, o);
                if (o.oneofs)
                    d._ugcBot = "ugcBot";
            }
            if (m.statusPrivacy != null && m.hasOwnProperty("statusPrivacy")) {
                d.statusPrivacy = $root.proto.SyncActionValue.StatusPrivacyAction.toObject(m.statusPrivacy, o);
                if (o.oneofs)
                    d._statusPrivacy = "statusPrivacy";
            }
            if (m.botWelcomeRequestAction != null && m.hasOwnProperty("botWelcomeRequestAction")) {
                d.botWelcomeRequestAction = $root.proto.SyncActionValue.BotWelcomeRequestAction.toObject(m.botWelcomeRequestAction, o);
                if (o.oneofs)
                    d._botWelcomeRequestAction = "botWelcomeRequestAction";
            }
            if (m.deleteIndividualCallLog != null && m.hasOwnProperty("deleteIndividualCallLog")) {
                d.deleteIndividualCallLog = $root.proto.SyncActionValue.DeleteIndividualCallLogAction.toObject(m.deleteIndividualCallLog, o);
                if (o.oneofs)
                    d._deleteIndividualCallLog = "deleteIndividualCallLog";
            }
            if (m.labelReorderingAction != null && m.hasOwnProperty("labelReorderingAction")) {
                d.labelReorderingAction = $root.proto.SyncActionValue.LabelReorderingAction.toObject(m.labelReorderingAction, o);
                if (o.oneofs)
                    d._labelReorderingAction = "labelReorderingAction";
            }
            if (m.paymentInfoAction != null && m.hasOwnProperty("paymentInfoAction")) {
                d.paymentInfoAction = $root.proto.SyncActionValue.PaymentInfoAction.toObject(m.paymentInfoAction, o);
                if (o.oneofs)
                    d._paymentInfoAction = "paymentInfoAction";
            }
            if (m.customPaymentMethodsAction != null && m.hasOwnProperty("customPaymentMethodsAction")) {
                d.customPaymentMethodsAction = $root.proto.SyncActionValue.CustomPaymentMethodsAction.toObject(m.customPaymentMethodsAction, o);
                if (o.oneofs)
                    d._customPaymentMethodsAction = "customPaymentMethodsAction";
            }
            if (m.lockChatAction != null && m.hasOwnProperty("lockChatAction")) {
                d.lockChatAction = $root.proto.SyncActionValue.LockChatAction.toObject(m.lockChatAction, o);
                if (o.oneofs)
                    d._lockChatAction = "lockChatAction";
            }
            if (m.chatLockSettings != null && m.hasOwnProperty("chatLockSettings")) {
                d.chatLockSettings = $root.proto.ChatLockSettings.toObject(m.chatLockSettings, o);
                if (o.oneofs)
                    d._chatLockSettings = "chatLockSettings";
            }
            if (m.wamoUserIdentifierAction != null && m.hasOwnProperty("wamoUserIdentifierAction")) {
                d.wamoUserIdentifierAction = $root.proto.SyncActionValue.WamoUserIdentifierAction.toObject(m.wamoUserIdentifierAction, o);
                if (o.oneofs)
                    d._wamoUserIdentifierAction = "wamoUserIdentifierAction";
            }
            if (m.privacySettingDisableLinkPreviewsAction != null && m.hasOwnProperty("privacySettingDisableLinkPreviewsAction")) {
                d.privacySettingDisableLinkPreviewsAction = $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.toObject(m.privacySettingDisableLinkPreviewsAction, o);
                if (o.oneofs)
                    d._privacySettingDisableLinkPreviewsAction = "privacySettingDisableLinkPreviewsAction";
            }
            if (m.deviceCapabilities != null && m.hasOwnProperty("deviceCapabilities")) {
                d.deviceCapabilities = $root.proto.DeviceCapabilities.toObject(m.deviceCapabilities, o);
                if (o.oneofs)
                    d._deviceCapabilities = "deviceCapabilities";
            }
            if (m.noteEditAction != null && m.hasOwnProperty("noteEditAction")) {
                d.noteEditAction = $root.proto.SyncActionValue.NoteEditAction.toObject(m.noteEditAction, o);
                if (o.oneofs)
                    d._noteEditAction = "noteEditAction";
            }
            if (m.favoritesAction != null && m.hasOwnProperty("favoritesAction")) {
                d.favoritesAction = $root.proto.SyncActionValue.FavoritesAction.toObject(m.favoritesAction, o);
                if (o.oneofs)
                    d._favoritesAction = "favoritesAction";
            }
            if (m.merchantPaymentPartnerAction != null && m.hasOwnProperty("merchantPaymentPartnerAction")) {
                d.merchantPaymentPartnerAction = $root.proto.SyncActionValue.MerchantPaymentPartnerAction.toObject(m.merchantPaymentPartnerAction, o);
                if (o.oneofs)
                    d._merchantPaymentPartnerAction = "merchantPaymentPartnerAction";
            }
            if (m.waffleAccountLinkStateAction != null && m.hasOwnProperty("waffleAccountLinkStateAction")) {
                d.waffleAccountLinkStateAction = $root.proto.SyncActionValue.WaffleAccountLinkStateAction.toObject(m.waffleAccountLinkStateAction, o);
                if (o.oneofs)
                    d._waffleAccountLinkStateAction = "waffleAccountLinkStateAction";
            }
            if (m.usernameChatStartMode != null && m.hasOwnProperty("usernameChatStartMode")) {
                d.usernameChatStartMode = $root.proto.SyncActionValue.UsernameChatStartModeAction.toObject(m.usernameChatStartMode, o);
                if (o.oneofs)
                    d._usernameChatStartMode = "usernameChatStartMode";
            }
            if (m.notificationActivitySettingAction != null && m.hasOwnProperty("notificationActivitySettingAction")) {
                d.notificationActivitySettingAction = $root.proto.SyncActionValue.NotificationActivitySettingAction.toObject(m.notificationActivitySettingAction, o);
                if (o.oneofs)
                    d._notificationActivitySettingAction = "notificationActivitySettingAction";
            }
            if (m.lidContactAction != null && m.hasOwnProperty("lidContactAction")) {
                d.lidContactAction = $root.proto.SyncActionValue.LidContactAction.toObject(m.lidContactAction, o);
                if (o.oneofs)
                    d._lidContactAction = "lidContactAction";
            }
            if (m.ctwaPerCustomerDataSharingAction != null && m.hasOwnProperty("ctwaPerCustomerDataSharingAction")) {
                d.ctwaPerCustomerDataSharingAction = $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.toObject(m.ctwaPerCustomerDataSharingAction, o);
                if (o.oneofs)
                    d._ctwaPerCustomerDataSharingAction = "ctwaPerCustomerDataSharingAction";
            }
            if (m.paymentTosAction != null && m.hasOwnProperty("paymentTosAction")) {
                d.paymentTosAction = $root.proto.SyncActionValue.PaymentTosAction.toObject(m.paymentTosAction, o);
                if (o.oneofs)
                    d._paymentTosAction = "paymentTosAction";
            }
            if (m.privacySettingChannelsPersonalisedRecommendationAction != null && m.hasOwnProperty("privacySettingChannelsPersonalisedRecommendationAction")) {
                d.privacySettingChannelsPersonalisedRecommendationAction = $root.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.toObject(m.privacySettingChannelsPersonalisedRecommendationAction, o);
                if (o.oneofs)
                    d._privacySettingChannelsPersonalisedRecommendationAction = "privacySettingChannelsPersonalisedRecommendationAction";
            }
            if (m.businessBroadcastAssociationAction != null && m.hasOwnProperty("businessBroadcastAssociationAction")) {
                d.businessBroadcastAssociationAction = $root.proto.SyncActionValue.BusinessBroadcastAssociationAction.toObject(m.businessBroadcastAssociationAction, o);
                if (o.oneofs)
                    d._businessBroadcastAssociationAction = "businessBroadcastAssociationAction";
            }
            if (m.detectedOutcomesStatusAction != null && m.hasOwnProperty("detectedOutcomesStatusAction")) {
                d.detectedOutcomesStatusAction = $root.proto.SyncActionValue.DetectedOutcomesStatusAction.toObject(m.detectedOutcomesStatusAction, o);
                if (o.oneofs)
                    d._detectedOutcomesStatusAction = "detectedOutcomesStatusAction";
            }
            if (m.maibaAiFeaturesControlAction != null && m.hasOwnProperty("maibaAiFeaturesControlAction")) {
                d.maibaAiFeaturesControlAction = $root.proto.SyncActionValue.MaibaAIFeaturesControlAction.toObject(m.maibaAiFeaturesControlAction, o);
                if (o.oneofs)
                    d._maibaAiFeaturesControlAction = "maibaAiFeaturesControlAction";
            }
            if (m.businessBroadcastListAction != null && m.hasOwnProperty("businessBroadcastListAction")) {
                d.businessBroadcastListAction = $root.proto.SyncActionValue.BusinessBroadcastListAction.toObject(m.businessBroadcastListAction, o);
                if (o.oneofs)
                    d._businessBroadcastListAction = "businessBroadcastListAction";
            }
            if (m.musicUserIdAction != null && m.hasOwnProperty("musicUserIdAction")) {
                d.musicUserIdAction = $root.proto.SyncActionValue.MusicUserIdAction.toObject(m.musicUserIdAction, o);
                if (o.oneofs)
                    d._musicUserIdAction = "musicUserIdAction";
            }
            if (m.statusPostOptInNotificationPreferencesAction != null && m.hasOwnProperty("statusPostOptInNotificationPreferencesAction")) {
                d.statusPostOptInNotificationPreferencesAction = $root.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.toObject(m.statusPostOptInNotificationPreferencesAction, o);
                if (o.oneofs)
                    d._statusPostOptInNotificationPreferencesAction = "statusPostOptInNotificationPreferencesAction";
            }
            if (m.avatarUpdatedAction != null && m.hasOwnProperty("avatarUpdatedAction")) {
                d.avatarUpdatedAction = $root.proto.SyncActionValue.AvatarUpdatedAction.toObject(m.avatarUpdatedAction, o);
                if (o.oneofs)
                    d._avatarUpdatedAction = "avatarUpdatedAction";
            }
            if (m.privateProcessingSettingAction != null && m.hasOwnProperty("privateProcessingSettingAction")) {
                d.privateProcessingSettingAction = $root.proto.SyncActionValue.PrivateProcessingSettingAction.toObject(m.privateProcessingSettingAction, o);
                if (o.oneofs)
                    d._privateProcessingSettingAction = "privateProcessingSettingAction";
            }
            if (m.newsletterSavedInterestsAction != null && m.hasOwnProperty("newsletterSavedInterestsAction")) {
                d.newsletterSavedInterestsAction = $root.proto.SyncActionValue.NewsletterSavedInterestsAction.toObject(m.newsletterSavedInterestsAction, o);
                if (o.oneofs)
                    d._newsletterSavedInterestsAction = "newsletterSavedInterestsAction";
            }
            if (m.aiThreadRenameAction != null && m.hasOwnProperty("aiThreadRenameAction")) {
                d.aiThreadRenameAction = $root.proto.SyncActionValue.AiThreadRenameAction.toObject(m.aiThreadRenameAction, o);
                if (o.oneofs)
                    d._aiThreadRenameAction = "aiThreadRenameAction";
            }
            if (m.interactiveMessageAction != null && m.hasOwnProperty("interactiveMessageAction")) {
                d.interactiveMessageAction = $root.proto.SyncActionValue.InteractiveMessageAction.toObject(m.interactiveMessageAction, o);
                if (o.oneofs)
                    d._interactiveMessageAction = "interactiveMessageAction";
            }
            return d;
        };

        SyncActionValue.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncActionValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncActionValue";
        };

        SyncActionValue.AgentAction = (function() {

            function AgentAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AgentAction.prototype.name = null;
            AgentAction.prototype.deviceID = null;
            AgentAction.prototype.isDeleted = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AgentAction.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AgentAction.prototype, "_deviceID", {
                get: $util.oneOfGetter($oneOfFields = ["deviceID"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AgentAction.prototype, "_isDeleted", {
                get: $util.oneOfGetter($oneOfFields = ["isDeleted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AgentAction.create = function create(properties) {
                return new AgentAction(properties);
            };

            AgentAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(10).string(m.name);
                if (m.deviceID != null && Object.hasOwnProperty.call(m, "deviceID"))
                    w.uint32(16).int32(m.deviceID);
                if (m.isDeleted != null && Object.hasOwnProperty.call(m, "isDeleted"))
                    w.uint32(24).bool(m.isDeleted);
                return w;
            };

            AgentAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.AgentAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.name = r.string();
                            break;
                        }
                    case 2: {
                            m.deviceID = r.int32();
                            break;
                        }
                    case 3: {
                            m.isDeleted = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AgentAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.AgentAction)
                    return d;
                var m = new $root.proto.SyncActionValue.AgentAction();
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.deviceID != null) {
                    m.deviceID = d.deviceID | 0;
                }
                if (d.isDeleted != null) {
                    m.isDeleted = Boolean(d.isDeleted);
                }
                return m;
            };

            AgentAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.deviceID != null && m.hasOwnProperty("deviceID")) {
                    d.deviceID = m.deviceID;
                    if (o.oneofs)
                        d._deviceID = "deviceID";
                }
                if (m.isDeleted != null && m.hasOwnProperty("isDeleted")) {
                    d.isDeleted = m.isDeleted;
                    if (o.oneofs)
                        d._isDeleted = "isDeleted";
                }
                return d;
            };

            AgentAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AgentAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.AgentAction";
            };

            return AgentAction;
        })();

        SyncActionValue.AiThreadRenameAction = (function() {

            function AiThreadRenameAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AiThreadRenameAction.prototype.newTitle = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AiThreadRenameAction.prototype, "_newTitle", {
                get: $util.oneOfGetter($oneOfFields = ["newTitle"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AiThreadRenameAction.create = function create(properties) {
                return new AiThreadRenameAction(properties);
            };

            AiThreadRenameAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.newTitle != null && Object.hasOwnProperty.call(m, "newTitle"))
                    w.uint32(10).string(m.newTitle);
                return w;
            };

            AiThreadRenameAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.AiThreadRenameAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.newTitle = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AiThreadRenameAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.AiThreadRenameAction)
                    return d;
                var m = new $root.proto.SyncActionValue.AiThreadRenameAction();
                if (d.newTitle != null) {
                    m.newTitle = String(d.newTitle);
                }
                return m;
            };

            AiThreadRenameAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.newTitle != null && m.hasOwnProperty("newTitle")) {
                    d.newTitle = m.newTitle;
                    if (o.oneofs)
                        d._newTitle = "newTitle";
                }
                return d;
            };

            AiThreadRenameAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AiThreadRenameAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.AiThreadRenameAction";
            };

            return AiThreadRenameAction;
        })();

        SyncActionValue.AndroidUnsupportedActions = (function() {

            function AndroidUnsupportedActions(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AndroidUnsupportedActions.prototype.allowed = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AndroidUnsupportedActions.prototype, "_allowed", {
                get: $util.oneOfGetter($oneOfFields = ["allowed"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AndroidUnsupportedActions.create = function create(properties) {
                return new AndroidUnsupportedActions(properties);
            };

            AndroidUnsupportedActions.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.allowed != null && Object.hasOwnProperty.call(m, "allowed"))
                    w.uint32(8).bool(m.allowed);
                return w;
            };

            AndroidUnsupportedActions.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.AndroidUnsupportedActions();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.allowed = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AndroidUnsupportedActions.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.AndroidUnsupportedActions)
                    return d;
                var m = new $root.proto.SyncActionValue.AndroidUnsupportedActions();
                if (d.allowed != null) {
                    m.allowed = Boolean(d.allowed);
                }
                return m;
            };

            AndroidUnsupportedActions.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.allowed != null && m.hasOwnProperty("allowed")) {
                    d.allowed = m.allowed;
                    if (o.oneofs)
                        d._allowed = "allowed";
                }
                return d;
            };

            AndroidUnsupportedActions.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AndroidUnsupportedActions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.AndroidUnsupportedActions";
            };

            return AndroidUnsupportedActions;
        })();

        SyncActionValue.ArchiveChatAction = (function() {

            function ArchiveChatAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ArchiveChatAction.prototype.archived = null;
            ArchiveChatAction.prototype.messageRange = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ArchiveChatAction.prototype, "_archived", {
                get: $util.oneOfGetter($oneOfFields = ["archived"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ArchiveChatAction.prototype, "_messageRange", {
                get: $util.oneOfGetter($oneOfFields = ["messageRange"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ArchiveChatAction.create = function create(properties) {
                return new ArchiveChatAction(properties);
            };

            ArchiveChatAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.archived != null && Object.hasOwnProperty.call(m, "archived"))
                    w.uint32(8).bool(m.archived);
                if (m.messageRange != null && Object.hasOwnProperty.call(m, "messageRange"))
                    $root.proto.SyncActionValue.SyncActionMessageRange.encode(m.messageRange, w.uint32(18).fork()).ldelim();
                return w;
            };

            ArchiveChatAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.ArchiveChatAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.archived = r.bool();
                            break;
                        }
                    case 2: {
                            m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ArchiveChatAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.ArchiveChatAction)
                    return d;
                var m = new $root.proto.SyncActionValue.ArchiveChatAction();
                if (d.archived != null) {
                    m.archived = Boolean(d.archived);
                }
                if (d.messageRange != null) {
                    if (typeof d.messageRange !== "object")
                        throw TypeError(".proto.SyncActionValue.ArchiveChatAction.messageRange: object expected");
                    m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.fromObject(d.messageRange);
                }
                return m;
            };

            ArchiveChatAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.archived != null && m.hasOwnProperty("archived")) {
                    d.archived = m.archived;
                    if (o.oneofs)
                        d._archived = "archived";
                }
                if (m.messageRange != null && m.hasOwnProperty("messageRange")) {
                    d.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.toObject(m.messageRange, o);
                    if (o.oneofs)
                        d._messageRange = "messageRange";
                }
                return d;
            };

            ArchiveChatAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ArchiveChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.ArchiveChatAction";
            };

            return ArchiveChatAction;
        })();

        SyncActionValue.AvatarUpdatedAction = (function() {

            function AvatarUpdatedAction(p) {
                this.recentAvatarStickers = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            AvatarUpdatedAction.prototype.eventType = null;
            AvatarUpdatedAction.prototype.recentAvatarStickers = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(AvatarUpdatedAction.prototype, "_eventType", {
                get: $util.oneOfGetter($oneOfFields = ["eventType"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            AvatarUpdatedAction.create = function create(properties) {
                return new AvatarUpdatedAction(properties);
            };

            AvatarUpdatedAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.eventType != null && Object.hasOwnProperty.call(m, "eventType"))
                    w.uint32(8).int32(m.eventType);
                if (m.recentAvatarStickers != null && m.recentAvatarStickers.length) {
                    for (var i = 0; i < m.recentAvatarStickers.length; ++i)
                        $root.proto.SyncActionValue.StickerAction.encode(m.recentAvatarStickers[i], w.uint32(18).fork()).ldelim();
                }
                return w;
            };

            AvatarUpdatedAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.AvatarUpdatedAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.eventType = r.int32();
                            break;
                        }
                    case 2: {
                            if (!(m.recentAvatarStickers && m.recentAvatarStickers.length))
                                m.recentAvatarStickers = [];
                            m.recentAvatarStickers.push($root.proto.SyncActionValue.StickerAction.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            AvatarUpdatedAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.AvatarUpdatedAction)
                    return d;
                var m = new $root.proto.SyncActionValue.AvatarUpdatedAction();
                switch (d.eventType) {
                default:
                    if (typeof d.eventType === "number") {
                        m.eventType = d.eventType;
                        break;
                    }
                    break;
                case "UPDATED":
                case 0:
                    m.eventType = 0;
                    break;
                case "CREATED":
                case 1:
                    m.eventType = 1;
                    break;
                case "DELETED":
                case 2:
                    m.eventType = 2;
                    break;
                }
                if (d.recentAvatarStickers) {
                    if (!Array.isArray(d.recentAvatarStickers))
                        throw TypeError(".proto.SyncActionValue.AvatarUpdatedAction.recentAvatarStickers: array expected");
                    m.recentAvatarStickers = [];
                    for (var i = 0; i < d.recentAvatarStickers.length; ++i) {
                        if (typeof d.recentAvatarStickers[i] !== "object")
                            throw TypeError(".proto.SyncActionValue.AvatarUpdatedAction.recentAvatarStickers: object expected");
                        m.recentAvatarStickers[i] = $root.proto.SyncActionValue.StickerAction.fromObject(d.recentAvatarStickers[i]);
                    }
                }
                return m;
            };

            AvatarUpdatedAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.recentAvatarStickers = [];
                }
                if (m.eventType != null && m.hasOwnProperty("eventType")) {
                    d.eventType = o.enums === String ? $root.proto.SyncActionValue.AvatarUpdatedAction.AvatarEventType[m.eventType] === undefined ? m.eventType : $root.proto.SyncActionValue.AvatarUpdatedAction.AvatarEventType[m.eventType] : m.eventType;
                    if (o.oneofs)
                        d._eventType = "eventType";
                }
                if (m.recentAvatarStickers && m.recentAvatarStickers.length) {
                    d.recentAvatarStickers = [];
                    for (var j = 0; j < m.recentAvatarStickers.length; ++j) {
                        d.recentAvatarStickers[j] = $root.proto.SyncActionValue.StickerAction.toObject(m.recentAvatarStickers[j], o);
                    }
                }
                return d;
            };

            AvatarUpdatedAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            AvatarUpdatedAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.AvatarUpdatedAction";
            };

            AvatarUpdatedAction.AvatarEventType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UPDATED"] = 0;
                values[valuesById[1] = "CREATED"] = 1;
                values[valuesById[2] = "DELETED"] = 2;
                return values;
            })();

            return AvatarUpdatedAction;
        })();

        SyncActionValue.BotWelcomeRequestAction = (function() {

            function BotWelcomeRequestAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BotWelcomeRequestAction.prototype.isSent = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BotWelcomeRequestAction.prototype, "_isSent", {
                get: $util.oneOfGetter($oneOfFields = ["isSent"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BotWelcomeRequestAction.create = function create(properties) {
                return new BotWelcomeRequestAction(properties);
            };

            BotWelcomeRequestAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isSent != null && Object.hasOwnProperty.call(m, "isSent"))
                    w.uint32(8).bool(m.isSent);
                return w;
            };

            BotWelcomeRequestAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.BotWelcomeRequestAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isSent = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BotWelcomeRequestAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.BotWelcomeRequestAction)
                    return d;
                var m = new $root.proto.SyncActionValue.BotWelcomeRequestAction();
                if (d.isSent != null) {
                    m.isSent = Boolean(d.isSent);
                }
                return m;
            };

            BotWelcomeRequestAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isSent != null && m.hasOwnProperty("isSent")) {
                    d.isSent = m.isSent;
                    if (o.oneofs)
                        d._isSent = "isSent";
                }
                return d;
            };

            BotWelcomeRequestAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BotWelcomeRequestAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.BotWelcomeRequestAction";
            };

            return BotWelcomeRequestAction;
        })();

        SyncActionValue.BroadcastListParticipant = (function() {

            function BroadcastListParticipant(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BroadcastListParticipant.prototype.lidJid = "";
            BroadcastListParticipant.prototype.pnJid = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BroadcastListParticipant.prototype, "_pnJid", {
                get: $util.oneOfGetter($oneOfFields = ["pnJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BroadcastListParticipant.create = function create(properties) {
                return new BroadcastListParticipant(properties);
            };

            BroadcastListParticipant.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.lidJid != null && Object.hasOwnProperty.call(m, "lidJid"))
                    w.uint32(10).string(m.lidJid);
                if (m.pnJid != null && Object.hasOwnProperty.call(m, "pnJid"))
                    w.uint32(18).string(m.pnJid);
                return w;
            };

            BroadcastListParticipant.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.BroadcastListParticipant();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.lidJid = r.string();
                            break;
                        }
                    case 2: {
                            m.pnJid = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BroadcastListParticipant.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.BroadcastListParticipant)
                    return d;
                var m = new $root.proto.SyncActionValue.BroadcastListParticipant();
                if (d.lidJid != null) {
                    m.lidJid = String(d.lidJid);
                }
                if (d.pnJid != null) {
                    m.pnJid = String(d.pnJid);
                }
                return m;
            };

            BroadcastListParticipant.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.defaults) {
                    d.lidJid = "";
                }
                if (m.lidJid != null && m.hasOwnProperty("lidJid")) {
                    d.lidJid = m.lidJid;
                }
                if (m.pnJid != null && m.hasOwnProperty("pnJid")) {
                    d.pnJid = m.pnJid;
                    if (o.oneofs)
                        d._pnJid = "pnJid";
                }
                return d;
            };

            BroadcastListParticipant.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BroadcastListParticipant.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.BroadcastListParticipant";
            };

            return BroadcastListParticipant;
        })();

        SyncActionValue.BusinessBroadcastAssociationAction = (function() {

            function BusinessBroadcastAssociationAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BusinessBroadcastAssociationAction.prototype.deleted = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BusinessBroadcastAssociationAction.prototype, "_deleted", {
                get: $util.oneOfGetter($oneOfFields = ["deleted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BusinessBroadcastAssociationAction.create = function create(properties) {
                return new BusinessBroadcastAssociationAction(properties);
            };

            BusinessBroadcastAssociationAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.deleted != null && Object.hasOwnProperty.call(m, "deleted"))
                    w.uint32(8).bool(m.deleted);
                return w;
            };

            BusinessBroadcastAssociationAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.BusinessBroadcastAssociationAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.deleted = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BusinessBroadcastAssociationAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.BusinessBroadcastAssociationAction)
                    return d;
                var m = new $root.proto.SyncActionValue.BusinessBroadcastAssociationAction();
                if (d.deleted != null) {
                    m.deleted = Boolean(d.deleted);
                }
                return m;
            };

            BusinessBroadcastAssociationAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.deleted != null && m.hasOwnProperty("deleted")) {
                    d.deleted = m.deleted;
                    if (o.oneofs)
                        d._deleted = "deleted";
                }
                return d;
            };

            BusinessBroadcastAssociationAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BusinessBroadcastAssociationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.BusinessBroadcastAssociationAction";
            };

            return BusinessBroadcastAssociationAction;
        })();

        SyncActionValue.BusinessBroadcastListAction = (function() {

            function BusinessBroadcastListAction(p) {
                this.participants = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            BusinessBroadcastListAction.prototype.deleted = null;
            BusinessBroadcastListAction.prototype.participants = $util.emptyArray;
            BusinessBroadcastListAction.prototype.listName = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BusinessBroadcastListAction.prototype, "_deleted", {
                get: $util.oneOfGetter($oneOfFields = ["deleted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(BusinessBroadcastListAction.prototype, "_listName", {
                get: $util.oneOfGetter($oneOfFields = ["listName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            BusinessBroadcastListAction.create = function create(properties) {
                return new BusinessBroadcastListAction(properties);
            };

            BusinessBroadcastListAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.deleted != null && Object.hasOwnProperty.call(m, "deleted"))
                    w.uint32(8).bool(m.deleted);
                if (m.participants != null && m.participants.length) {
                    for (var i = 0; i < m.participants.length; ++i)
                        $root.proto.SyncActionValue.BroadcastListParticipant.encode(m.participants[i], w.uint32(18).fork()).ldelim();
                }
                if (m.listName != null && Object.hasOwnProperty.call(m, "listName"))
                    w.uint32(26).string(m.listName);
                return w;
            };

            BusinessBroadcastListAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.BusinessBroadcastListAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.deleted = r.bool();
                            break;
                        }
                    case 2: {
                            if (!(m.participants && m.participants.length))
                                m.participants = [];
                            m.participants.push($root.proto.SyncActionValue.BroadcastListParticipant.decode(r, r.uint32()));
                            break;
                        }
                    case 3: {
                            m.listName = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            BusinessBroadcastListAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.BusinessBroadcastListAction)
                    return d;
                var m = new $root.proto.SyncActionValue.BusinessBroadcastListAction();
                if (d.deleted != null) {
                    m.deleted = Boolean(d.deleted);
                }
                if (d.participants) {
                    if (!Array.isArray(d.participants))
                        throw TypeError(".proto.SyncActionValue.BusinessBroadcastListAction.participants: array expected");
                    m.participants = [];
                    for (var i = 0; i < d.participants.length; ++i) {
                        if (typeof d.participants[i] !== "object")
                            throw TypeError(".proto.SyncActionValue.BusinessBroadcastListAction.participants: object expected");
                        m.participants[i] = $root.proto.SyncActionValue.BroadcastListParticipant.fromObject(d.participants[i]);
                    }
                }
                if (d.listName != null) {
                    m.listName = String(d.listName);
                }
                return m;
            };

            BusinessBroadcastListAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.participants = [];
                }
                if (m.deleted != null && m.hasOwnProperty("deleted")) {
                    d.deleted = m.deleted;
                    if (o.oneofs)
                        d._deleted = "deleted";
                }
                if (m.participants && m.participants.length) {
                    d.participants = [];
                    for (var j = 0; j < m.participants.length; ++j) {
                        d.participants[j] = $root.proto.SyncActionValue.BroadcastListParticipant.toObject(m.participants[j], o);
                    }
                }
                if (m.listName != null && m.hasOwnProperty("listName")) {
                    d.listName = m.listName;
                    if (o.oneofs)
                        d._listName = "listName";
                }
                return d;
            };

            BusinessBroadcastListAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            BusinessBroadcastListAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.BusinessBroadcastListAction";
            };

            return BusinessBroadcastListAction;
        })();

        SyncActionValue.CallLogAction = (function() {

            function CallLogAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CallLogAction.prototype.callLogRecord = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CallLogAction.prototype, "_callLogRecord", {
                get: $util.oneOfGetter($oneOfFields = ["callLogRecord"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            CallLogAction.create = function create(properties) {
                return new CallLogAction(properties);
            };

            CallLogAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.callLogRecord != null && Object.hasOwnProperty.call(m, "callLogRecord"))
                    $root.proto.CallLogRecord.encode(m.callLogRecord, w.uint32(10).fork()).ldelim();
                return w;
            };

            CallLogAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.CallLogAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.callLogRecord = $root.proto.CallLogRecord.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CallLogAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.CallLogAction)
                    return d;
                var m = new $root.proto.SyncActionValue.CallLogAction();
                if (d.callLogRecord != null) {
                    if (typeof d.callLogRecord !== "object")
                        throw TypeError(".proto.SyncActionValue.CallLogAction.callLogRecord: object expected");
                    m.callLogRecord = $root.proto.CallLogRecord.fromObject(d.callLogRecord);
                }
                return m;
            };

            CallLogAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.callLogRecord != null && m.hasOwnProperty("callLogRecord")) {
                    d.callLogRecord = $root.proto.CallLogRecord.toObject(m.callLogRecord, o);
                    if (o.oneofs)
                        d._callLogRecord = "callLogRecord";
                }
                return d;
            };

            CallLogAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CallLogAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.CallLogAction";
            };

            return CallLogAction;
        })();

        SyncActionValue.ChatAssignmentAction = (function() {

            function ChatAssignmentAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ChatAssignmentAction.prototype.deviceAgentID = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ChatAssignmentAction.prototype, "_deviceAgentID", {
                get: $util.oneOfGetter($oneOfFields = ["deviceAgentID"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ChatAssignmentAction.create = function create(properties) {
                return new ChatAssignmentAction(properties);
            };

            ChatAssignmentAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.deviceAgentID != null && Object.hasOwnProperty.call(m, "deviceAgentID"))
                    w.uint32(10).string(m.deviceAgentID);
                return w;
            };

            ChatAssignmentAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.ChatAssignmentAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.deviceAgentID = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ChatAssignmentAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.ChatAssignmentAction)
                    return d;
                var m = new $root.proto.SyncActionValue.ChatAssignmentAction();
                if (d.deviceAgentID != null) {
                    m.deviceAgentID = String(d.deviceAgentID);
                }
                return m;
            };

            ChatAssignmentAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.deviceAgentID != null && m.hasOwnProperty("deviceAgentID")) {
                    d.deviceAgentID = m.deviceAgentID;
                    if (o.oneofs)
                        d._deviceAgentID = "deviceAgentID";
                }
                return d;
            };

            ChatAssignmentAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ChatAssignmentAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.ChatAssignmentAction";
            };

            return ChatAssignmentAction;
        })();

        SyncActionValue.ChatAssignmentOpenedStatusAction = (function() {

            function ChatAssignmentOpenedStatusAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ChatAssignmentOpenedStatusAction.prototype.chatOpened = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ChatAssignmentOpenedStatusAction.prototype, "_chatOpened", {
                get: $util.oneOfGetter($oneOfFields = ["chatOpened"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ChatAssignmentOpenedStatusAction.create = function create(properties) {
                return new ChatAssignmentOpenedStatusAction(properties);
            };

            ChatAssignmentOpenedStatusAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.chatOpened != null && Object.hasOwnProperty.call(m, "chatOpened"))
                    w.uint32(8).bool(m.chatOpened);
                return w;
            };

            ChatAssignmentOpenedStatusAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.chatOpened = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ChatAssignmentOpenedStatusAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction)
                    return d;
                var m = new $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction();
                if (d.chatOpened != null) {
                    m.chatOpened = Boolean(d.chatOpened);
                }
                return m;
            };

            ChatAssignmentOpenedStatusAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.chatOpened != null && m.hasOwnProperty("chatOpened")) {
                    d.chatOpened = m.chatOpened;
                    if (o.oneofs)
                        d._chatOpened = "chatOpened";
                }
                return d;
            };

            ChatAssignmentOpenedStatusAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ChatAssignmentOpenedStatusAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.ChatAssignmentOpenedStatusAction";
            };

            return ChatAssignmentOpenedStatusAction;
        })();

        SyncActionValue.ClearChatAction = (function() {

            function ClearChatAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ClearChatAction.prototype.messageRange = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ClearChatAction.prototype, "_messageRange", {
                get: $util.oneOfGetter($oneOfFields = ["messageRange"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ClearChatAction.create = function create(properties) {
                return new ClearChatAction(properties);
            };

            ClearChatAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.messageRange != null && Object.hasOwnProperty.call(m, "messageRange"))
                    $root.proto.SyncActionValue.SyncActionMessageRange.encode(m.messageRange, w.uint32(10).fork()).ldelim();
                return w;
            };

            ClearChatAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.ClearChatAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ClearChatAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.ClearChatAction)
                    return d;
                var m = new $root.proto.SyncActionValue.ClearChatAction();
                if (d.messageRange != null) {
                    if (typeof d.messageRange !== "object")
                        throw TypeError(".proto.SyncActionValue.ClearChatAction.messageRange: object expected");
                    m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.fromObject(d.messageRange);
                }
                return m;
            };

            ClearChatAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.messageRange != null && m.hasOwnProperty("messageRange")) {
                    d.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.toObject(m.messageRange, o);
                    if (o.oneofs)
                        d._messageRange = "messageRange";
                }
                return d;
            };

            ClearChatAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ClearChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.ClearChatAction";
            };

            return ClearChatAction;
        })();

        SyncActionValue.ContactAction = (function() {

            function ContactAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ContactAction.prototype.fullName = null;
            ContactAction.prototype.firstName = null;
            ContactAction.prototype.lidJid = null;
            ContactAction.prototype.saveOnPrimaryAddressbook = null;
            ContactAction.prototype.pnJid = null;
            ContactAction.prototype.username = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactAction.prototype, "_fullName", {
                get: $util.oneOfGetter($oneOfFields = ["fullName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactAction.prototype, "_firstName", {
                get: $util.oneOfGetter($oneOfFields = ["firstName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactAction.prototype, "_lidJid", {
                get: $util.oneOfGetter($oneOfFields = ["lidJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactAction.prototype, "_saveOnPrimaryAddressbook", {
                get: $util.oneOfGetter($oneOfFields = ["saveOnPrimaryAddressbook"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactAction.prototype, "_pnJid", {
                get: $util.oneOfGetter($oneOfFields = ["pnJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ContactAction.prototype, "_username", {
                get: $util.oneOfGetter($oneOfFields = ["username"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ContactAction.create = function create(properties) {
                return new ContactAction(properties);
            };

            ContactAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.fullName != null && Object.hasOwnProperty.call(m, "fullName"))
                    w.uint32(10).string(m.fullName);
                if (m.firstName != null && Object.hasOwnProperty.call(m, "firstName"))
                    w.uint32(18).string(m.firstName);
                if (m.lidJid != null && Object.hasOwnProperty.call(m, "lidJid"))
                    w.uint32(26).string(m.lidJid);
                if (m.saveOnPrimaryAddressbook != null && Object.hasOwnProperty.call(m, "saveOnPrimaryAddressbook"))
                    w.uint32(32).bool(m.saveOnPrimaryAddressbook);
                if (m.pnJid != null && Object.hasOwnProperty.call(m, "pnJid"))
                    w.uint32(42).string(m.pnJid);
                if (m.username != null && Object.hasOwnProperty.call(m, "username"))
                    w.uint32(50).string(m.username);
                return w;
            };

            ContactAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.ContactAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.fullName = r.string();
                            break;
                        }
                    case 2: {
                            m.firstName = r.string();
                            break;
                        }
                    case 3: {
                            m.lidJid = r.string();
                            break;
                        }
                    case 4: {
                            m.saveOnPrimaryAddressbook = r.bool();
                            break;
                        }
                    case 5: {
                            m.pnJid = r.string();
                            break;
                        }
                    case 6: {
                            m.username = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ContactAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.ContactAction)
                    return d;
                var m = new $root.proto.SyncActionValue.ContactAction();
                if (d.fullName != null) {
                    m.fullName = String(d.fullName);
                }
                if (d.firstName != null) {
                    m.firstName = String(d.firstName);
                }
                if (d.lidJid != null) {
                    m.lidJid = String(d.lidJid);
                }
                if (d.saveOnPrimaryAddressbook != null) {
                    m.saveOnPrimaryAddressbook = Boolean(d.saveOnPrimaryAddressbook);
                }
                if (d.pnJid != null) {
                    m.pnJid = String(d.pnJid);
                }
                if (d.username != null) {
                    m.username = String(d.username);
                }
                return m;
            };

            ContactAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.fullName != null && m.hasOwnProperty("fullName")) {
                    d.fullName = m.fullName;
                    if (o.oneofs)
                        d._fullName = "fullName";
                }
                if (m.firstName != null && m.hasOwnProperty("firstName")) {
                    d.firstName = m.firstName;
                    if (o.oneofs)
                        d._firstName = "firstName";
                }
                if (m.lidJid != null && m.hasOwnProperty("lidJid")) {
                    d.lidJid = m.lidJid;
                    if (o.oneofs)
                        d._lidJid = "lidJid";
                }
                if (m.saveOnPrimaryAddressbook != null && m.hasOwnProperty("saveOnPrimaryAddressbook")) {
                    d.saveOnPrimaryAddressbook = m.saveOnPrimaryAddressbook;
                    if (o.oneofs)
                        d._saveOnPrimaryAddressbook = "saveOnPrimaryAddressbook";
                }
                if (m.pnJid != null && m.hasOwnProperty("pnJid")) {
                    d.pnJid = m.pnJid;
                    if (o.oneofs)
                        d._pnJid = "pnJid";
                }
                if (m.username != null && m.hasOwnProperty("username")) {
                    d.username = m.username;
                    if (o.oneofs)
                        d._username = "username";
                }
                return d;
            };

            ContactAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ContactAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.ContactAction";
            };

            return ContactAction;
        })();

        SyncActionValue.CtwaPerCustomerDataSharingAction = (function() {

            function CtwaPerCustomerDataSharingAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CtwaPerCustomerDataSharingAction.prototype.isCtwaPerCustomerDataSharingEnabled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CtwaPerCustomerDataSharingAction.prototype, "_isCtwaPerCustomerDataSharingEnabled", {
                get: $util.oneOfGetter($oneOfFields = ["isCtwaPerCustomerDataSharingEnabled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            CtwaPerCustomerDataSharingAction.create = function create(properties) {
                return new CtwaPerCustomerDataSharingAction(properties);
            };

            CtwaPerCustomerDataSharingAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isCtwaPerCustomerDataSharingEnabled != null && Object.hasOwnProperty.call(m, "isCtwaPerCustomerDataSharingEnabled"))
                    w.uint32(8).bool(m.isCtwaPerCustomerDataSharingEnabled);
                return w;
            };

            CtwaPerCustomerDataSharingAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isCtwaPerCustomerDataSharingEnabled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CtwaPerCustomerDataSharingAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction)
                    return d;
                var m = new $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction();
                if (d.isCtwaPerCustomerDataSharingEnabled != null) {
                    m.isCtwaPerCustomerDataSharingEnabled = Boolean(d.isCtwaPerCustomerDataSharingEnabled);
                }
                return m;
            };

            CtwaPerCustomerDataSharingAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isCtwaPerCustomerDataSharingEnabled != null && m.hasOwnProperty("isCtwaPerCustomerDataSharingEnabled")) {
                    d.isCtwaPerCustomerDataSharingEnabled = m.isCtwaPerCustomerDataSharingEnabled;
                    if (o.oneofs)
                        d._isCtwaPerCustomerDataSharingEnabled = "isCtwaPerCustomerDataSharingEnabled";
                }
                return d;
            };

            CtwaPerCustomerDataSharingAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CtwaPerCustomerDataSharingAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.CtwaPerCustomerDataSharingAction";
            };

            return CtwaPerCustomerDataSharingAction;
        })();

        SyncActionValue.CustomPaymentMethod = (function() {

            function CustomPaymentMethod(p) {
                this.metadata = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CustomPaymentMethod.prototype.credentialId = "";
            CustomPaymentMethod.prototype.country = "";
            CustomPaymentMethod.prototype.type = "";
            CustomPaymentMethod.prototype.metadata = $util.emptyArray;

            CustomPaymentMethod.create = function create(properties) {
                return new CustomPaymentMethod(properties);
            };

            CustomPaymentMethod.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.credentialId != null && Object.hasOwnProperty.call(m, "credentialId"))
                    w.uint32(10).string(m.credentialId);
                if (m.country != null && Object.hasOwnProperty.call(m, "country"))
                    w.uint32(18).string(m.country);
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(26).string(m.type);
                if (m.metadata != null && m.metadata.length) {
                    for (var i = 0; i < m.metadata.length; ++i)
                        $root.proto.SyncActionValue.CustomPaymentMethodMetadata.encode(m.metadata[i], w.uint32(34).fork()).ldelim();
                }
                return w;
            };

            CustomPaymentMethod.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.CustomPaymentMethod();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.credentialId = r.string();
                            break;
                        }
                    case 2: {
                            m.country = r.string();
                            break;
                        }
                    case 3: {
                            m.type = r.string();
                            break;
                        }
                    case 4: {
                            if (!(m.metadata && m.metadata.length))
                                m.metadata = [];
                            m.metadata.push($root.proto.SyncActionValue.CustomPaymentMethodMetadata.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CustomPaymentMethod.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.CustomPaymentMethod)
                    return d;
                var m = new $root.proto.SyncActionValue.CustomPaymentMethod();
                if (d.credentialId != null) {
                    m.credentialId = String(d.credentialId);
                }
                if (d.country != null) {
                    m.country = String(d.country);
                }
                if (d.type != null) {
                    m.type = String(d.type);
                }
                if (d.metadata) {
                    if (!Array.isArray(d.metadata))
                        throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: array expected");
                    m.metadata = [];
                    for (var i = 0; i < d.metadata.length; ++i) {
                        if (typeof d.metadata[i] !== "object")
                            throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: object expected");
                        m.metadata[i] = $root.proto.SyncActionValue.CustomPaymentMethodMetadata.fromObject(d.metadata[i]);
                    }
                }
                return m;
            };

            CustomPaymentMethod.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.metadata = [];
                }
                if (o.defaults) {
                    d.credentialId = "";
                    d.country = "";
                    d.type = "";
                }
                if (m.credentialId != null && m.hasOwnProperty("credentialId")) {
                    d.credentialId = m.credentialId;
                }
                if (m.country != null && m.hasOwnProperty("country")) {
                    d.country = m.country;
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = m.type;
                }
                if (m.metadata && m.metadata.length) {
                    d.metadata = [];
                    for (var j = 0; j < m.metadata.length; ++j) {
                        d.metadata[j] = $root.proto.SyncActionValue.CustomPaymentMethodMetadata.toObject(m.metadata[j], o);
                    }
                }
                return d;
            };

            CustomPaymentMethod.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CustomPaymentMethod.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.CustomPaymentMethod";
            };

            return CustomPaymentMethod;
        })();

        SyncActionValue.CustomPaymentMethodMetadata = (function() {

            function CustomPaymentMethodMetadata(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CustomPaymentMethodMetadata.prototype.key = "";
            CustomPaymentMethodMetadata.prototype.value = "";

            CustomPaymentMethodMetadata.create = function create(properties) {
                return new CustomPaymentMethodMetadata(properties);
            };

            CustomPaymentMethodMetadata.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    w.uint32(10).string(m.key);
                if (m.value != null && Object.hasOwnProperty.call(m, "value"))
                    w.uint32(18).string(m.value);
                return w;
            };

            CustomPaymentMethodMetadata.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.CustomPaymentMethodMetadata();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = r.string();
                            break;
                        }
                    case 2: {
                            m.value = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CustomPaymentMethodMetadata.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.CustomPaymentMethodMetadata)
                    return d;
                var m = new $root.proto.SyncActionValue.CustomPaymentMethodMetadata();
                if (d.key != null) {
                    m.key = String(d.key);
                }
                if (d.value != null) {
                    m.value = String(d.value);
                }
                return m;
            };

            CustomPaymentMethodMetadata.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.defaults) {
                    d.key = "";
                    d.value = "";
                }
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = m.key;
                }
                if (m.value != null && m.hasOwnProperty("value")) {
                    d.value = m.value;
                }
                return d;
            };

            CustomPaymentMethodMetadata.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CustomPaymentMethodMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.CustomPaymentMethodMetadata";
            };

            return CustomPaymentMethodMetadata;
        })();

        SyncActionValue.CustomPaymentMethodsAction = (function() {

            function CustomPaymentMethodsAction(p) {
                this.customPaymentMethods = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CustomPaymentMethodsAction.prototype.customPaymentMethods = $util.emptyArray;

            CustomPaymentMethodsAction.create = function create(properties) {
                return new CustomPaymentMethodsAction(properties);
            };

            CustomPaymentMethodsAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.customPaymentMethods != null && m.customPaymentMethods.length) {
                    for (var i = 0; i < m.customPaymentMethods.length; ++i)
                        $root.proto.SyncActionValue.CustomPaymentMethod.encode(m.customPaymentMethods[i], w.uint32(10).fork()).ldelim();
                }
                return w;
            };

            CustomPaymentMethodsAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.CustomPaymentMethodsAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.customPaymentMethods && m.customPaymentMethods.length))
                                m.customPaymentMethods = [];
                            m.customPaymentMethods.push($root.proto.SyncActionValue.CustomPaymentMethod.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CustomPaymentMethodsAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.CustomPaymentMethodsAction)
                    return d;
                var m = new $root.proto.SyncActionValue.CustomPaymentMethodsAction();
                if (d.customPaymentMethods) {
                    if (!Array.isArray(d.customPaymentMethods))
                        throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: array expected");
                    m.customPaymentMethods = [];
                    for (var i = 0; i < d.customPaymentMethods.length; ++i) {
                        if (typeof d.customPaymentMethods[i] !== "object")
                            throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: object expected");
                        m.customPaymentMethods[i] = $root.proto.SyncActionValue.CustomPaymentMethod.fromObject(d.customPaymentMethods[i]);
                    }
                }
                return m;
            };

            CustomPaymentMethodsAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.customPaymentMethods = [];
                }
                if (m.customPaymentMethods && m.customPaymentMethods.length) {
                    d.customPaymentMethods = [];
                    for (var j = 0; j < m.customPaymentMethods.length; ++j) {
                        d.customPaymentMethods[j] = $root.proto.SyncActionValue.CustomPaymentMethod.toObject(m.customPaymentMethods[j], o);
                    }
                }
                return d;
            };

            CustomPaymentMethodsAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CustomPaymentMethodsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.CustomPaymentMethodsAction";
            };

            return CustomPaymentMethodsAction;
        })();

        SyncActionValue.DeleteChatAction = (function() {

            function DeleteChatAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DeleteChatAction.prototype.messageRange = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeleteChatAction.prototype, "_messageRange", {
                get: $util.oneOfGetter($oneOfFields = ["messageRange"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DeleteChatAction.create = function create(properties) {
                return new DeleteChatAction(properties);
            };

            DeleteChatAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.messageRange != null && Object.hasOwnProperty.call(m, "messageRange"))
                    $root.proto.SyncActionValue.SyncActionMessageRange.encode(m.messageRange, w.uint32(10).fork()).ldelim();
                return w;
            };

            DeleteChatAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.DeleteChatAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DeleteChatAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.DeleteChatAction)
                    return d;
                var m = new $root.proto.SyncActionValue.DeleteChatAction();
                if (d.messageRange != null) {
                    if (typeof d.messageRange !== "object")
                        throw TypeError(".proto.SyncActionValue.DeleteChatAction.messageRange: object expected");
                    m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.fromObject(d.messageRange);
                }
                return m;
            };

            DeleteChatAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.messageRange != null && m.hasOwnProperty("messageRange")) {
                    d.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.toObject(m.messageRange, o);
                    if (o.oneofs)
                        d._messageRange = "messageRange";
                }
                return d;
            };

            DeleteChatAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DeleteChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.DeleteChatAction";
            };

            return DeleteChatAction;
        })();

        SyncActionValue.DeleteIndividualCallLogAction = (function() {

            function DeleteIndividualCallLogAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DeleteIndividualCallLogAction.prototype.peerJid = null;
            DeleteIndividualCallLogAction.prototype.isIncoming = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeleteIndividualCallLogAction.prototype, "_peerJid", {
                get: $util.oneOfGetter($oneOfFields = ["peerJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeleteIndividualCallLogAction.prototype, "_isIncoming", {
                get: $util.oneOfGetter($oneOfFields = ["isIncoming"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DeleteIndividualCallLogAction.create = function create(properties) {
                return new DeleteIndividualCallLogAction(properties);
            };

            DeleteIndividualCallLogAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.peerJid != null && Object.hasOwnProperty.call(m, "peerJid"))
                    w.uint32(10).string(m.peerJid);
                if (m.isIncoming != null && Object.hasOwnProperty.call(m, "isIncoming"))
                    w.uint32(16).bool(m.isIncoming);
                return w;
            };

            DeleteIndividualCallLogAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.DeleteIndividualCallLogAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.peerJid = r.string();
                            break;
                        }
                    case 2: {
                            m.isIncoming = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DeleteIndividualCallLogAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.DeleteIndividualCallLogAction)
                    return d;
                var m = new $root.proto.SyncActionValue.DeleteIndividualCallLogAction();
                if (d.peerJid != null) {
                    m.peerJid = String(d.peerJid);
                }
                if (d.isIncoming != null) {
                    m.isIncoming = Boolean(d.isIncoming);
                }
                return m;
            };

            DeleteIndividualCallLogAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.peerJid != null && m.hasOwnProperty("peerJid")) {
                    d.peerJid = m.peerJid;
                    if (o.oneofs)
                        d._peerJid = "peerJid";
                }
                if (m.isIncoming != null && m.hasOwnProperty("isIncoming")) {
                    d.isIncoming = m.isIncoming;
                    if (o.oneofs)
                        d._isIncoming = "isIncoming";
                }
                return d;
            };

            DeleteIndividualCallLogAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DeleteIndividualCallLogAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.DeleteIndividualCallLogAction";
            };

            return DeleteIndividualCallLogAction;
        })();

        SyncActionValue.DeleteMessageForMeAction = (function() {

            function DeleteMessageForMeAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DeleteMessageForMeAction.prototype.deleteMedia = null;
            DeleteMessageForMeAction.prototype.messageTimestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeleteMessageForMeAction.prototype, "_deleteMedia", {
                get: $util.oneOfGetter($oneOfFields = ["deleteMedia"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DeleteMessageForMeAction.prototype, "_messageTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["messageTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DeleteMessageForMeAction.create = function create(properties) {
                return new DeleteMessageForMeAction(properties);
            };

            DeleteMessageForMeAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.deleteMedia != null && Object.hasOwnProperty.call(m, "deleteMedia"))
                    w.uint32(8).bool(m.deleteMedia);
                if (m.messageTimestamp != null && Object.hasOwnProperty.call(m, "messageTimestamp"))
                    w.uint32(16).int64(m.messageTimestamp);
                return w;
            };

            DeleteMessageForMeAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.DeleteMessageForMeAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.deleteMedia = r.bool();
                            break;
                        }
                    case 2: {
                            m.messageTimestamp = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DeleteMessageForMeAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.DeleteMessageForMeAction)
                    return d;
                var m = new $root.proto.SyncActionValue.DeleteMessageForMeAction();
                if (d.deleteMedia != null) {
                    m.deleteMedia = Boolean(d.deleteMedia);
                }
                if (d.messageTimestamp != null) {
                    if ($util.Long)
                        (m.messageTimestamp = $util.Long.fromValue(d.messageTimestamp)).unsigned = false;
                    else if (typeof d.messageTimestamp === "string")
                        m.messageTimestamp = parseInt(d.messageTimestamp, 10);
                    else if (typeof d.messageTimestamp === "number")
                        m.messageTimestamp = d.messageTimestamp;
                    else if (typeof d.messageTimestamp === "object")
                        m.messageTimestamp = new $util.LongBits(d.messageTimestamp.low >>> 0, d.messageTimestamp.high >>> 0).toNumber();
                }
                return m;
            };

            DeleteMessageForMeAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.deleteMedia != null && m.hasOwnProperty("deleteMedia")) {
                    d.deleteMedia = m.deleteMedia;
                    if (o.oneofs)
                        d._deleteMedia = "deleteMedia";
                }
                if (m.messageTimestamp != null && m.hasOwnProperty("messageTimestamp")) {
                    if (typeof m.messageTimestamp === "number")
                        d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp;
                    else
                        d.messageTimestamp = o.longs === String ? longToString(m.messageTimestamp) : o.longs === Number ? longToNumber(m.messageTimestamp) : m.messageTimestamp;
                    if (o.oneofs)
                        d._messageTimestamp = "messageTimestamp";
                }
                return d;
            };

            DeleteMessageForMeAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DeleteMessageForMeAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.DeleteMessageForMeAction";
            };

            return DeleteMessageForMeAction;
        })();

        SyncActionValue.DetectedOutcomesStatusAction = (function() {

            function DetectedOutcomesStatusAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            DetectedOutcomesStatusAction.prototype.isEnabled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(DetectedOutcomesStatusAction.prototype, "_isEnabled", {
                get: $util.oneOfGetter($oneOfFields = ["isEnabled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            DetectedOutcomesStatusAction.create = function create(properties) {
                return new DetectedOutcomesStatusAction(properties);
            };

            DetectedOutcomesStatusAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isEnabled != null && Object.hasOwnProperty.call(m, "isEnabled"))
                    w.uint32(8).bool(m.isEnabled);
                return w;
            };

            DetectedOutcomesStatusAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.DetectedOutcomesStatusAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isEnabled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            DetectedOutcomesStatusAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.DetectedOutcomesStatusAction)
                    return d;
                var m = new $root.proto.SyncActionValue.DetectedOutcomesStatusAction();
                if (d.isEnabled != null) {
                    m.isEnabled = Boolean(d.isEnabled);
                }
                return m;
            };

            DetectedOutcomesStatusAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isEnabled != null && m.hasOwnProperty("isEnabled")) {
                    d.isEnabled = m.isEnabled;
                    if (o.oneofs)
                        d._isEnabled = "isEnabled";
                }
                return d;
            };

            DetectedOutcomesStatusAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            DetectedOutcomesStatusAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.DetectedOutcomesStatusAction";
            };

            return DetectedOutcomesStatusAction;
        })();

        SyncActionValue.ExternalWebBetaAction = (function() {

            function ExternalWebBetaAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            ExternalWebBetaAction.prototype.isOptIn = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(ExternalWebBetaAction.prototype, "_isOptIn", {
                get: $util.oneOfGetter($oneOfFields = ["isOptIn"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            ExternalWebBetaAction.create = function create(properties) {
                return new ExternalWebBetaAction(properties);
            };

            ExternalWebBetaAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isOptIn != null && Object.hasOwnProperty.call(m, "isOptIn"))
                    w.uint32(8).bool(m.isOptIn);
                return w;
            };

            ExternalWebBetaAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.ExternalWebBetaAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isOptIn = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            ExternalWebBetaAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.ExternalWebBetaAction)
                    return d;
                var m = new $root.proto.SyncActionValue.ExternalWebBetaAction();
                if (d.isOptIn != null) {
                    m.isOptIn = Boolean(d.isOptIn);
                }
                return m;
            };

            ExternalWebBetaAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isOptIn != null && m.hasOwnProperty("isOptIn")) {
                    d.isOptIn = m.isOptIn;
                    if (o.oneofs)
                        d._isOptIn = "isOptIn";
                }
                return d;
            };

            ExternalWebBetaAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            ExternalWebBetaAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.ExternalWebBetaAction";
            };

            return ExternalWebBetaAction;
        })();

        SyncActionValue.FavoritesAction = (function() {

            function FavoritesAction(p) {
                this.favorites = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            FavoritesAction.prototype.favorites = $util.emptyArray;

            FavoritesAction.create = function create(properties) {
                return new FavoritesAction(properties);
            };

            FavoritesAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.favorites != null && m.favorites.length) {
                    for (var i = 0; i < m.favorites.length; ++i)
                        $root.proto.SyncActionValue.FavoritesAction.Favorite.encode(m.favorites[i], w.uint32(10).fork()).ldelim();
                }
                return w;
            };

            FavoritesAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.FavoritesAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.favorites && m.favorites.length))
                                m.favorites = [];
                            m.favorites.push($root.proto.SyncActionValue.FavoritesAction.Favorite.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            FavoritesAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.FavoritesAction)
                    return d;
                var m = new $root.proto.SyncActionValue.FavoritesAction();
                if (d.favorites) {
                    if (!Array.isArray(d.favorites))
                        throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: array expected");
                    m.favorites = [];
                    for (var i = 0; i < d.favorites.length; ++i) {
                        if (typeof d.favorites[i] !== "object")
                            throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: object expected");
                        m.favorites[i] = $root.proto.SyncActionValue.FavoritesAction.Favorite.fromObject(d.favorites[i]);
                    }
                }
                return m;
            };

            FavoritesAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.favorites = [];
                }
                if (m.favorites && m.favorites.length) {
                    d.favorites = [];
                    for (var j = 0; j < m.favorites.length; ++j) {
                        d.favorites[j] = $root.proto.SyncActionValue.FavoritesAction.Favorite.toObject(m.favorites[j], o);
                    }
                }
                return d;
            };

            FavoritesAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            FavoritesAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.FavoritesAction";
            };

            FavoritesAction.Favorite = (function() {

                function Favorite(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Favorite.prototype.id = null;

                let $oneOfFields;

                // Virtual OneOf for proto3 optional field
                Object.defineProperty(Favorite.prototype, "_id", {
                    get: $util.oneOfGetter($oneOfFields = ["id"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Favorite.create = function create(properties) {
                    return new Favorite(properties);
                };

                Favorite.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                        w.uint32(10).string(m.id);
                    return w;
                };

                Favorite.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.FavoritesAction.Favorite();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.id = r.string();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Favorite.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.SyncActionValue.FavoritesAction.Favorite)
                        return d;
                    var m = new $root.proto.SyncActionValue.FavoritesAction.Favorite();
                    if (d.id != null) {
                        m.id = String(d.id);
                    }
                    return m;
                };

                Favorite.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.id != null && m.hasOwnProperty("id")) {
                        d.id = m.id;
                        if (o.oneofs)
                            d._id = "id";
                    }
                    return d;
                };

                Favorite.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Favorite.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.SyncActionValue.FavoritesAction.Favorite";
                };

                return Favorite;
            })();

            return FavoritesAction;
        })();

        SyncActionValue.InteractiveMessageAction = (function() {

            function InteractiveMessageAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            InteractiveMessageAction.prototype.type = 1;

            InteractiveMessageAction.create = function create(properties) {
                return new InteractiveMessageAction(properties);
            };

            InteractiveMessageAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(8).int32(m.type);
                return w;
            };

            InteractiveMessageAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.InteractiveMessageAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.type = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            InteractiveMessageAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.InteractiveMessageAction)
                    return d;
                var m = new $root.proto.SyncActionValue.InteractiveMessageAction();
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "DISABLE_CTA":
                case 1:
                    m.type = 1;
                    break;
                }
                return m;
            };

            InteractiveMessageAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.defaults) {
                    d.type = o.enums === String ? "DISABLE_CTA" : 1;
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[m.type] === undefined ? m.type : $root.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[m.type] : m.type;
                }
                return d;
            };

            InteractiveMessageAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            InteractiveMessageAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.InteractiveMessageAction";
            };

            InteractiveMessageAction.InteractiveMessageActionMode = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "DISABLE_CTA"] = 1;
                return values;
            })();

            return InteractiveMessageAction;
        })();

        SyncActionValue.KeyExpiration = (function() {

            function KeyExpiration(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            KeyExpiration.prototype.expiredKeyEpoch = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(KeyExpiration.prototype, "_expiredKeyEpoch", {
                get: $util.oneOfGetter($oneOfFields = ["expiredKeyEpoch"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            KeyExpiration.create = function create(properties) {
                return new KeyExpiration(properties);
            };

            KeyExpiration.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.expiredKeyEpoch != null && Object.hasOwnProperty.call(m, "expiredKeyEpoch"))
                    w.uint32(8).int32(m.expiredKeyEpoch);
                return w;
            };

            KeyExpiration.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.KeyExpiration();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.expiredKeyEpoch = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            KeyExpiration.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.KeyExpiration)
                    return d;
                var m = new $root.proto.SyncActionValue.KeyExpiration();
                if (d.expiredKeyEpoch != null) {
                    m.expiredKeyEpoch = d.expiredKeyEpoch | 0;
                }
                return m;
            };

            KeyExpiration.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.expiredKeyEpoch != null && m.hasOwnProperty("expiredKeyEpoch")) {
                    d.expiredKeyEpoch = m.expiredKeyEpoch;
                    if (o.oneofs)
                        d._expiredKeyEpoch = "expiredKeyEpoch";
                }
                return d;
            };

            KeyExpiration.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            KeyExpiration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.KeyExpiration";
            };

            return KeyExpiration;
        })();

        SyncActionValue.LabelAssociationAction = (function() {

            function LabelAssociationAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LabelAssociationAction.prototype.labeled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelAssociationAction.prototype, "_labeled", {
                get: $util.oneOfGetter($oneOfFields = ["labeled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LabelAssociationAction.create = function create(properties) {
                return new LabelAssociationAction(properties);
            };

            LabelAssociationAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.labeled != null && Object.hasOwnProperty.call(m, "labeled"))
                    w.uint32(8).bool(m.labeled);
                return w;
            };

            LabelAssociationAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.LabelAssociationAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.labeled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LabelAssociationAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.LabelAssociationAction)
                    return d;
                var m = new $root.proto.SyncActionValue.LabelAssociationAction();
                if (d.labeled != null) {
                    m.labeled = Boolean(d.labeled);
                }
                return m;
            };

            LabelAssociationAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.labeled != null && m.hasOwnProperty("labeled")) {
                    d.labeled = m.labeled;
                    if (o.oneofs)
                        d._labeled = "labeled";
                }
                return d;
            };

            LabelAssociationAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LabelAssociationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.LabelAssociationAction";
            };

            return LabelAssociationAction;
        })();

        SyncActionValue.LabelEditAction = (function() {

            function LabelEditAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LabelEditAction.prototype.name = null;
            LabelEditAction.prototype.color = null;
            LabelEditAction.prototype.predefinedId = null;
            LabelEditAction.prototype.deleted = null;
            LabelEditAction.prototype.orderIndex = null;
            LabelEditAction.prototype.isActive = null;
            LabelEditAction.prototype.type = null;
            LabelEditAction.prototype.isImmutable = null;
            LabelEditAction.prototype.muteEndTimeMs = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_color", {
                get: $util.oneOfGetter($oneOfFields = ["color"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_predefinedId", {
                get: $util.oneOfGetter($oneOfFields = ["predefinedId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_deleted", {
                get: $util.oneOfGetter($oneOfFields = ["deleted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_orderIndex", {
                get: $util.oneOfGetter($oneOfFields = ["orderIndex"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_isActive", {
                get: $util.oneOfGetter($oneOfFields = ["isActive"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_isImmutable", {
                get: $util.oneOfGetter($oneOfFields = ["isImmutable"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LabelEditAction.prototype, "_muteEndTimeMs", {
                get: $util.oneOfGetter($oneOfFields = ["muteEndTimeMs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LabelEditAction.create = function create(properties) {
                return new LabelEditAction(properties);
            };

            LabelEditAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(10).string(m.name);
                if (m.color != null && Object.hasOwnProperty.call(m, "color"))
                    w.uint32(16).int32(m.color);
                if (m.predefinedId != null && Object.hasOwnProperty.call(m, "predefinedId"))
                    w.uint32(24).int32(m.predefinedId);
                if (m.deleted != null && Object.hasOwnProperty.call(m, "deleted"))
                    w.uint32(32).bool(m.deleted);
                if (m.orderIndex != null && Object.hasOwnProperty.call(m, "orderIndex"))
                    w.uint32(40).int32(m.orderIndex);
                if (m.isActive != null && Object.hasOwnProperty.call(m, "isActive"))
                    w.uint32(48).bool(m.isActive);
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(56).int32(m.type);
                if (m.isImmutable != null && Object.hasOwnProperty.call(m, "isImmutable"))
                    w.uint32(64).bool(m.isImmutable);
                if (m.muteEndTimeMs != null && Object.hasOwnProperty.call(m, "muteEndTimeMs"))
                    w.uint32(72).int64(m.muteEndTimeMs);
                return w;
            };

            LabelEditAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.LabelEditAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.name = r.string();
                            break;
                        }
                    case 2: {
                            m.color = r.int32();
                            break;
                        }
                    case 3: {
                            m.predefinedId = r.int32();
                            break;
                        }
                    case 4: {
                            m.deleted = r.bool();
                            break;
                        }
                    case 5: {
                            m.orderIndex = r.int32();
                            break;
                        }
                    case 6: {
                            m.isActive = r.bool();
                            break;
                        }
                    case 7: {
                            m.type = r.int32();
                            break;
                        }
                    case 8: {
                            m.isImmutable = r.bool();
                            break;
                        }
                    case 9: {
                            m.muteEndTimeMs = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LabelEditAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.LabelEditAction)
                    return d;
                var m = new $root.proto.SyncActionValue.LabelEditAction();
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.color != null) {
                    m.color = d.color | 0;
                }
                if (d.predefinedId != null) {
                    m.predefinedId = d.predefinedId | 0;
                }
                if (d.deleted != null) {
                    m.deleted = Boolean(d.deleted);
                }
                if (d.orderIndex != null) {
                    m.orderIndex = d.orderIndex | 0;
                }
                if (d.isActive != null) {
                    m.isActive = Boolean(d.isActive);
                }
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "NONE":
                case 0:
                    m.type = 0;
                    break;
                case "UNREAD":
                case 1:
                    m.type = 1;
                    break;
                case "GROUPS":
                case 2:
                    m.type = 2;
                    break;
                case "FAVORITES":
                case 3:
                    m.type = 3;
                    break;
                case "PREDEFINED":
                case 4:
                    m.type = 4;
                    break;
                case "CUSTOM":
                case 5:
                    m.type = 5;
                    break;
                case "COMMUNITY":
                case 6:
                    m.type = 6;
                    break;
                case "SERVER_ASSIGNED":
                case 7:
                    m.type = 7;
                    break;
                case "DRAFTED":
                case 8:
                    m.type = 8;
                    break;
                case "AI_HANDOFF":
                case 9:
                    m.type = 9;
                    break;
                }
                if (d.isImmutable != null) {
                    m.isImmutable = Boolean(d.isImmutable);
                }
                if (d.muteEndTimeMs != null) {
                    if ($util.Long)
                        (m.muteEndTimeMs = $util.Long.fromValue(d.muteEndTimeMs)).unsigned = false;
                    else if (typeof d.muteEndTimeMs === "string")
                        m.muteEndTimeMs = parseInt(d.muteEndTimeMs, 10);
                    else if (typeof d.muteEndTimeMs === "number")
                        m.muteEndTimeMs = d.muteEndTimeMs;
                    else if (typeof d.muteEndTimeMs === "object")
                        m.muteEndTimeMs = new $util.LongBits(d.muteEndTimeMs.low >>> 0, d.muteEndTimeMs.high >>> 0).toNumber();
                }
                return m;
            };

            LabelEditAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.color != null && m.hasOwnProperty("color")) {
                    d.color = m.color;
                    if (o.oneofs)
                        d._color = "color";
                }
                if (m.predefinedId != null && m.hasOwnProperty("predefinedId")) {
                    d.predefinedId = m.predefinedId;
                    if (o.oneofs)
                        d._predefinedId = "predefinedId";
                }
                if (m.deleted != null && m.hasOwnProperty("deleted")) {
                    d.deleted = m.deleted;
                    if (o.oneofs)
                        d._deleted = "deleted";
                }
                if (m.orderIndex != null && m.hasOwnProperty("orderIndex")) {
                    d.orderIndex = m.orderIndex;
                    if (o.oneofs)
                        d._orderIndex = "orderIndex";
                }
                if (m.isActive != null && m.hasOwnProperty("isActive")) {
                    d.isActive = m.isActive;
                    if (o.oneofs)
                        d._isActive = "isActive";
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.SyncActionValue.LabelEditAction.ListType[m.type] === undefined ? m.type : $root.proto.SyncActionValue.LabelEditAction.ListType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                if (m.isImmutable != null && m.hasOwnProperty("isImmutable")) {
                    d.isImmutable = m.isImmutable;
                    if (o.oneofs)
                        d._isImmutable = "isImmutable";
                }
                if (m.muteEndTimeMs != null && m.hasOwnProperty("muteEndTimeMs")) {
                    if (typeof m.muteEndTimeMs === "number")
                        d.muteEndTimeMs = o.longs === String ? String(m.muteEndTimeMs) : m.muteEndTimeMs;
                    else
                        d.muteEndTimeMs = o.longs === String ? longToString(m.muteEndTimeMs) : o.longs === Number ? longToNumber(m.muteEndTimeMs) : m.muteEndTimeMs;
                    if (o.oneofs)
                        d._muteEndTimeMs = "muteEndTimeMs";
                }
                return d;
            };

            LabelEditAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LabelEditAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.LabelEditAction";
            };

            LabelEditAction.ListType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "NONE"] = 0;
                values[valuesById[1] = "UNREAD"] = 1;
                values[valuesById[2] = "GROUPS"] = 2;
                values[valuesById[3] = "FAVORITES"] = 3;
                values[valuesById[4] = "PREDEFINED"] = 4;
                values[valuesById[5] = "CUSTOM"] = 5;
                values[valuesById[6] = "COMMUNITY"] = 6;
                values[valuesById[7] = "SERVER_ASSIGNED"] = 7;
                values[valuesById[8] = "DRAFTED"] = 8;
                values[valuesById[9] = "AI_HANDOFF"] = 9;
                return values;
            })();

            return LabelEditAction;
        })();

        SyncActionValue.LabelReorderingAction = (function() {

            function LabelReorderingAction(p) {
                this.sortedLabelIds = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LabelReorderingAction.prototype.sortedLabelIds = $util.emptyArray;

            LabelReorderingAction.create = function create(properties) {
                return new LabelReorderingAction(properties);
            };

            LabelReorderingAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.sortedLabelIds != null && m.sortedLabelIds.length) {
                    w.uint32(10).fork();
                    for (var i = 0; i < m.sortedLabelIds.length; ++i)
                        w.int32(m.sortedLabelIds[i]);
                    w.ldelim();
                }
                return w;
            };

            LabelReorderingAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.LabelReorderingAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.sortedLabelIds && m.sortedLabelIds.length))
                                m.sortedLabelIds = [];
                            if ((t & 7) === 2) {
                                var c2 = r.uint32() + r.pos;
                                while (r.pos < c2)
                                    m.sortedLabelIds.push(r.int32());
                            } else
                                m.sortedLabelIds.push(r.int32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LabelReorderingAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.LabelReorderingAction)
                    return d;
                var m = new $root.proto.SyncActionValue.LabelReorderingAction();
                if (d.sortedLabelIds) {
                    if (!Array.isArray(d.sortedLabelIds))
                        throw TypeError(".proto.SyncActionValue.LabelReorderingAction.sortedLabelIds: array expected");
                    m.sortedLabelIds = [];
                    for (var i = 0; i < d.sortedLabelIds.length; ++i) {
                        m.sortedLabelIds[i] = d.sortedLabelIds[i] | 0;
                    }
                }
                return m;
            };

            LabelReorderingAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.sortedLabelIds = [];
                }
                if (m.sortedLabelIds && m.sortedLabelIds.length) {
                    d.sortedLabelIds = [];
                    for (var j = 0; j < m.sortedLabelIds.length; ++j) {
                        d.sortedLabelIds[j] = m.sortedLabelIds[j];
                    }
                }
                return d;
            };

            LabelReorderingAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LabelReorderingAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.LabelReorderingAction";
            };

            return LabelReorderingAction;
        })();

        SyncActionValue.LidContactAction = (function() {

            function LidContactAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LidContactAction.prototype.fullName = null;
            LidContactAction.prototype.firstName = null;
            LidContactAction.prototype.username = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LidContactAction.prototype, "_fullName", {
                get: $util.oneOfGetter($oneOfFields = ["fullName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LidContactAction.prototype, "_firstName", {
                get: $util.oneOfGetter($oneOfFields = ["firstName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LidContactAction.prototype, "_username", {
                get: $util.oneOfGetter($oneOfFields = ["username"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LidContactAction.create = function create(properties) {
                return new LidContactAction(properties);
            };

            LidContactAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.fullName != null && Object.hasOwnProperty.call(m, "fullName"))
                    w.uint32(10).string(m.fullName);
                if (m.firstName != null && Object.hasOwnProperty.call(m, "firstName"))
                    w.uint32(18).string(m.firstName);
                if (m.username != null && Object.hasOwnProperty.call(m, "username"))
                    w.uint32(26).string(m.username);
                return w;
            };

            LidContactAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.LidContactAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.fullName = r.string();
                            break;
                        }
                    case 2: {
                            m.firstName = r.string();
                            break;
                        }
                    case 3: {
                            m.username = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LidContactAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.LidContactAction)
                    return d;
                var m = new $root.proto.SyncActionValue.LidContactAction();
                if (d.fullName != null) {
                    m.fullName = String(d.fullName);
                }
                if (d.firstName != null) {
                    m.firstName = String(d.firstName);
                }
                if (d.username != null) {
                    m.username = String(d.username);
                }
                return m;
            };

            LidContactAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.fullName != null && m.hasOwnProperty("fullName")) {
                    d.fullName = m.fullName;
                    if (o.oneofs)
                        d._fullName = "fullName";
                }
                if (m.firstName != null && m.hasOwnProperty("firstName")) {
                    d.firstName = m.firstName;
                    if (o.oneofs)
                        d._firstName = "firstName";
                }
                if (m.username != null && m.hasOwnProperty("username")) {
                    d.username = m.username;
                    if (o.oneofs)
                        d._username = "username";
                }
                return d;
            };

            LidContactAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LidContactAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.LidContactAction";
            };

            return LidContactAction;
        })();

        SyncActionValue.LocaleSetting = (function() {

            function LocaleSetting(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LocaleSetting.prototype.locale = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LocaleSetting.prototype, "_locale", {
                get: $util.oneOfGetter($oneOfFields = ["locale"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LocaleSetting.create = function create(properties) {
                return new LocaleSetting(properties);
            };

            LocaleSetting.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.locale != null && Object.hasOwnProperty.call(m, "locale"))
                    w.uint32(10).string(m.locale);
                return w;
            };

            LocaleSetting.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.LocaleSetting();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.locale = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LocaleSetting.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.LocaleSetting)
                    return d;
                var m = new $root.proto.SyncActionValue.LocaleSetting();
                if (d.locale != null) {
                    m.locale = String(d.locale);
                }
                return m;
            };

            LocaleSetting.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.locale != null && m.hasOwnProperty("locale")) {
                    d.locale = m.locale;
                    if (o.oneofs)
                        d._locale = "locale";
                }
                return d;
            };

            LocaleSetting.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LocaleSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.LocaleSetting";
            };

            return LocaleSetting;
        })();

        SyncActionValue.LockChatAction = (function() {

            function LockChatAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            LockChatAction.prototype.locked = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(LockChatAction.prototype, "_locked", {
                get: $util.oneOfGetter($oneOfFields = ["locked"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            LockChatAction.create = function create(properties) {
                return new LockChatAction(properties);
            };

            LockChatAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.locked != null && Object.hasOwnProperty.call(m, "locked"))
                    w.uint32(8).bool(m.locked);
                return w;
            };

            LockChatAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.LockChatAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.locked = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            LockChatAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.LockChatAction)
                    return d;
                var m = new $root.proto.SyncActionValue.LockChatAction();
                if (d.locked != null) {
                    m.locked = Boolean(d.locked);
                }
                return m;
            };

            LockChatAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.locked != null && m.hasOwnProperty("locked")) {
                    d.locked = m.locked;
                    if (o.oneofs)
                        d._locked = "locked";
                }
                return d;
            };

            LockChatAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            LockChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.LockChatAction";
            };

            return LockChatAction;
        })();

        SyncActionValue.MaibaAIFeaturesControlAction = (function() {

            function MaibaAIFeaturesControlAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MaibaAIFeaturesControlAction.prototype.aiFeatureStatus = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MaibaAIFeaturesControlAction.prototype, "_aiFeatureStatus", {
                get: $util.oneOfGetter($oneOfFields = ["aiFeatureStatus"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MaibaAIFeaturesControlAction.create = function create(properties) {
                return new MaibaAIFeaturesControlAction(properties);
            };

            MaibaAIFeaturesControlAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.aiFeatureStatus != null && Object.hasOwnProperty.call(m, "aiFeatureStatus"))
                    w.uint32(8).int32(m.aiFeatureStatus);
                return w;
            };

            MaibaAIFeaturesControlAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.MaibaAIFeaturesControlAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.aiFeatureStatus = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MaibaAIFeaturesControlAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.MaibaAIFeaturesControlAction)
                    return d;
                var m = new $root.proto.SyncActionValue.MaibaAIFeaturesControlAction();
                switch (d.aiFeatureStatus) {
                default:
                    if (typeof d.aiFeatureStatus === "number") {
                        m.aiFeatureStatus = d.aiFeatureStatus;
                        break;
                    }
                    break;
                case "ENABLED":
                case 0:
                    m.aiFeatureStatus = 0;
                    break;
                case "ENABLED_HAS_LEARNING":
                case 1:
                    m.aiFeatureStatus = 1;
                    break;
                case "DISABLED":
                case 2:
                    m.aiFeatureStatus = 2;
                    break;
                }
                return m;
            };

            MaibaAIFeaturesControlAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.aiFeatureStatus != null && m.hasOwnProperty("aiFeatureStatus")) {
                    d.aiFeatureStatus = o.enums === String ? $root.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[m.aiFeatureStatus] === undefined ? m.aiFeatureStatus : $root.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[m.aiFeatureStatus] : m.aiFeatureStatus;
                    if (o.oneofs)
                        d._aiFeatureStatus = "aiFeatureStatus";
                }
                return d;
            };

            MaibaAIFeaturesControlAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MaibaAIFeaturesControlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.MaibaAIFeaturesControlAction";
            };

            MaibaAIFeaturesControlAction.MaibaAIFeatureStatus = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "ENABLED"] = 0;
                values[valuesById[1] = "ENABLED_HAS_LEARNING"] = 1;
                values[valuesById[2] = "DISABLED"] = 2;
                return values;
            })();

            return MaibaAIFeaturesControlAction;
        })();

        SyncActionValue.MarkChatAsReadAction = (function() {

            function MarkChatAsReadAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MarkChatAsReadAction.prototype.read = null;
            MarkChatAsReadAction.prototype.messageRange = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarkChatAsReadAction.prototype, "_read", {
                get: $util.oneOfGetter($oneOfFields = ["read"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarkChatAsReadAction.prototype, "_messageRange", {
                get: $util.oneOfGetter($oneOfFields = ["messageRange"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MarkChatAsReadAction.create = function create(properties) {
                return new MarkChatAsReadAction(properties);
            };

            MarkChatAsReadAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.read != null && Object.hasOwnProperty.call(m, "read"))
                    w.uint32(8).bool(m.read);
                if (m.messageRange != null && Object.hasOwnProperty.call(m, "messageRange"))
                    $root.proto.SyncActionValue.SyncActionMessageRange.encode(m.messageRange, w.uint32(18).fork()).ldelim();
                return w;
            };

            MarkChatAsReadAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.MarkChatAsReadAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.read = r.bool();
                            break;
                        }
                    case 2: {
                            m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MarkChatAsReadAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.MarkChatAsReadAction)
                    return d;
                var m = new $root.proto.SyncActionValue.MarkChatAsReadAction();
                if (d.read != null) {
                    m.read = Boolean(d.read);
                }
                if (d.messageRange != null) {
                    if (typeof d.messageRange !== "object")
                        throw TypeError(".proto.SyncActionValue.MarkChatAsReadAction.messageRange: object expected");
                    m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.fromObject(d.messageRange);
                }
                return m;
            };

            MarkChatAsReadAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.read != null && m.hasOwnProperty("read")) {
                    d.read = m.read;
                    if (o.oneofs)
                        d._read = "read";
                }
                if (m.messageRange != null && m.hasOwnProperty("messageRange")) {
                    d.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.toObject(m.messageRange, o);
                    if (o.oneofs)
                        d._messageRange = "messageRange";
                }
                return d;
            };

            MarkChatAsReadAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MarkChatAsReadAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.MarkChatAsReadAction";
            };

            return MarkChatAsReadAction;
        })();

        SyncActionValue.MarketingMessageAction = (function() {

            function MarketingMessageAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MarketingMessageAction.prototype.name = null;
            MarketingMessageAction.prototype.message = null;
            MarketingMessageAction.prototype.type = null;
            MarketingMessageAction.prototype.createdAt = null;
            MarketingMessageAction.prototype.lastSentAt = null;
            MarketingMessageAction.prototype.isDeleted = null;
            MarketingMessageAction.prototype.mediaId = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarketingMessageAction.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarketingMessageAction.prototype, "_message", {
                get: $util.oneOfGetter($oneOfFields = ["message"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarketingMessageAction.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarketingMessageAction.prototype, "_createdAt", {
                get: $util.oneOfGetter($oneOfFields = ["createdAt"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarketingMessageAction.prototype, "_lastSentAt", {
                get: $util.oneOfGetter($oneOfFields = ["lastSentAt"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarketingMessageAction.prototype, "_isDeleted", {
                get: $util.oneOfGetter($oneOfFields = ["isDeleted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarketingMessageAction.prototype, "_mediaId", {
                get: $util.oneOfGetter($oneOfFields = ["mediaId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MarketingMessageAction.create = function create(properties) {
                return new MarketingMessageAction(properties);
            };

            MarketingMessageAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(10).string(m.name);
                if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                    w.uint32(18).string(m.message);
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(24).int32(m.type);
                if (m.createdAt != null && Object.hasOwnProperty.call(m, "createdAt"))
                    w.uint32(32).int64(m.createdAt);
                if (m.lastSentAt != null && Object.hasOwnProperty.call(m, "lastSentAt"))
                    w.uint32(40).int64(m.lastSentAt);
                if (m.isDeleted != null && Object.hasOwnProperty.call(m, "isDeleted"))
                    w.uint32(48).bool(m.isDeleted);
                if (m.mediaId != null && Object.hasOwnProperty.call(m, "mediaId"))
                    w.uint32(58).string(m.mediaId);
                return w;
            };

            MarketingMessageAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.MarketingMessageAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.name = r.string();
                            break;
                        }
                    case 2: {
                            m.message = r.string();
                            break;
                        }
                    case 3: {
                            m.type = r.int32();
                            break;
                        }
                    case 4: {
                            m.createdAt = r.int64();
                            break;
                        }
                    case 5: {
                            m.lastSentAt = r.int64();
                            break;
                        }
                    case 6: {
                            m.isDeleted = r.bool();
                            break;
                        }
                    case 7: {
                            m.mediaId = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MarketingMessageAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.MarketingMessageAction)
                    return d;
                var m = new $root.proto.SyncActionValue.MarketingMessageAction();
                if (d.name != null) {
                    m.name = String(d.name);
                }
                if (d.message != null) {
                    m.message = String(d.message);
                }
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "PERSONALIZED":
                case 0:
                    m.type = 0;
                    break;
                }
                if (d.createdAt != null) {
                    if ($util.Long)
                        (m.createdAt = $util.Long.fromValue(d.createdAt)).unsigned = false;
                    else if (typeof d.createdAt === "string")
                        m.createdAt = parseInt(d.createdAt, 10);
                    else if (typeof d.createdAt === "number")
                        m.createdAt = d.createdAt;
                    else if (typeof d.createdAt === "object")
                        m.createdAt = new $util.LongBits(d.createdAt.low >>> 0, d.createdAt.high >>> 0).toNumber();
                }
                if (d.lastSentAt != null) {
                    if ($util.Long)
                        (m.lastSentAt = $util.Long.fromValue(d.lastSentAt)).unsigned = false;
                    else if (typeof d.lastSentAt === "string")
                        m.lastSentAt = parseInt(d.lastSentAt, 10);
                    else if (typeof d.lastSentAt === "number")
                        m.lastSentAt = d.lastSentAt;
                    else if (typeof d.lastSentAt === "object")
                        m.lastSentAt = new $util.LongBits(d.lastSentAt.low >>> 0, d.lastSentAt.high >>> 0).toNumber();
                }
                if (d.isDeleted != null) {
                    m.isDeleted = Boolean(d.isDeleted);
                }
                if (d.mediaId != null) {
                    m.mediaId = String(d.mediaId);
                }
                return m;
            };

            MarketingMessageAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                if (m.message != null && m.hasOwnProperty("message")) {
                    d.message = m.message;
                    if (o.oneofs)
                        d._message = "message";
                }
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[m.type] === undefined ? m.type : $root.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                if (m.createdAt != null && m.hasOwnProperty("createdAt")) {
                    if (typeof m.createdAt === "number")
                        d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt;
                    else
                        d.createdAt = o.longs === String ? longToString(m.createdAt) : o.longs === Number ? longToNumber(m.createdAt) : m.createdAt;
                    if (o.oneofs)
                        d._createdAt = "createdAt";
                }
                if (m.lastSentAt != null && m.hasOwnProperty("lastSentAt")) {
                    if (typeof m.lastSentAt === "number")
                        d.lastSentAt = o.longs === String ? String(m.lastSentAt) : m.lastSentAt;
                    else
                        d.lastSentAt = o.longs === String ? longToString(m.lastSentAt) : o.longs === Number ? longToNumber(m.lastSentAt) : m.lastSentAt;
                    if (o.oneofs)
                        d._lastSentAt = "lastSentAt";
                }
                if (m.isDeleted != null && m.hasOwnProperty("isDeleted")) {
                    d.isDeleted = m.isDeleted;
                    if (o.oneofs)
                        d._isDeleted = "isDeleted";
                }
                if (m.mediaId != null && m.hasOwnProperty("mediaId")) {
                    d.mediaId = m.mediaId;
                    if (o.oneofs)
                        d._mediaId = "mediaId";
                }
                return d;
            };

            MarketingMessageAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MarketingMessageAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.MarketingMessageAction";
            };

            MarketingMessageAction.MarketingMessagePrototypeType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "PERSONALIZED"] = 0;
                return values;
            })();

            return MarketingMessageAction;
        })();

        SyncActionValue.MarketingMessageBroadcastAction = (function() {

            function MarketingMessageBroadcastAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MarketingMessageBroadcastAction.prototype.repliedCount = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MarketingMessageBroadcastAction.prototype, "_repliedCount", {
                get: $util.oneOfGetter($oneOfFields = ["repliedCount"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MarketingMessageBroadcastAction.create = function create(properties) {
                return new MarketingMessageBroadcastAction(properties);
            };

            MarketingMessageBroadcastAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.repliedCount != null && Object.hasOwnProperty.call(m, "repliedCount"))
                    w.uint32(8).int32(m.repliedCount);
                return w;
            };

            MarketingMessageBroadcastAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.MarketingMessageBroadcastAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.repliedCount = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MarketingMessageBroadcastAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.MarketingMessageBroadcastAction)
                    return d;
                var m = new $root.proto.SyncActionValue.MarketingMessageBroadcastAction();
                if (d.repliedCount != null) {
                    m.repliedCount = d.repliedCount | 0;
                }
                return m;
            };

            MarketingMessageBroadcastAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.repliedCount != null && m.hasOwnProperty("repliedCount")) {
                    d.repliedCount = m.repliedCount;
                    if (o.oneofs)
                        d._repliedCount = "repliedCount";
                }
                return d;
            };

            MarketingMessageBroadcastAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MarketingMessageBroadcastAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.MarketingMessageBroadcastAction";
            };

            return MarketingMessageBroadcastAction;
        })();

        SyncActionValue.MerchantPaymentPartnerAction = (function() {

            function MerchantPaymentPartnerAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MerchantPaymentPartnerAction.prototype.status = 0;
            MerchantPaymentPartnerAction.prototype.country = "";
            MerchantPaymentPartnerAction.prototype.gatewayName = null;
            MerchantPaymentPartnerAction.prototype.credentialId = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_gatewayName", {
                get: $util.oneOfGetter($oneOfFields = ["gatewayName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_credentialId", {
                get: $util.oneOfGetter($oneOfFields = ["credentialId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MerchantPaymentPartnerAction.create = function create(properties) {
                return new MerchantPaymentPartnerAction(properties);
            };

            MerchantPaymentPartnerAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.status != null && Object.hasOwnProperty.call(m, "status"))
                    w.uint32(8).int32(m.status);
                if (m.country != null && Object.hasOwnProperty.call(m, "country"))
                    w.uint32(18).string(m.country);
                if (m.gatewayName != null && Object.hasOwnProperty.call(m, "gatewayName"))
                    w.uint32(26).string(m.gatewayName);
                if (m.credentialId != null && Object.hasOwnProperty.call(m, "credentialId"))
                    w.uint32(34).string(m.credentialId);
                return w;
            };

            MerchantPaymentPartnerAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.MerchantPaymentPartnerAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.status = r.int32();
                            break;
                        }
                    case 2: {
                            m.country = r.string();
                            break;
                        }
                    case 3: {
                            m.gatewayName = r.string();
                            break;
                        }
                    case 4: {
                            m.credentialId = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MerchantPaymentPartnerAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.MerchantPaymentPartnerAction)
                    return d;
                var m = new $root.proto.SyncActionValue.MerchantPaymentPartnerAction();
                switch (d.status) {
                default:
                    if (typeof d.status === "number") {
                        m.status = d.status;
                        break;
                    }
                    break;
                case "ACTIVE":
                case 0:
                    m.status = 0;
                    break;
                case "INACTIVE":
                case 1:
                    m.status = 1;
                    break;
                }
                if (d.country != null) {
                    m.country = String(d.country);
                }
                if (d.gatewayName != null) {
                    m.gatewayName = String(d.gatewayName);
                }
                if (d.credentialId != null) {
                    m.credentialId = String(d.credentialId);
                }
                return m;
            };

            MerchantPaymentPartnerAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.defaults) {
                    d.status = o.enums === String ? "ACTIVE" : 0;
                    d.country = "";
                }
                if (m.status != null && m.hasOwnProperty("status")) {
                    d.status = o.enums === String ? $root.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[m.status] === undefined ? m.status : $root.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[m.status] : m.status;
                }
                if (m.country != null && m.hasOwnProperty("country")) {
                    d.country = m.country;
                }
                if (m.gatewayName != null && m.hasOwnProperty("gatewayName")) {
                    d.gatewayName = m.gatewayName;
                    if (o.oneofs)
                        d._gatewayName = "gatewayName";
                }
                if (m.credentialId != null && m.hasOwnProperty("credentialId")) {
                    d.credentialId = m.credentialId;
                    if (o.oneofs)
                        d._credentialId = "credentialId";
                }
                return d;
            };

            MerchantPaymentPartnerAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MerchantPaymentPartnerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.MerchantPaymentPartnerAction";
            };

            MerchantPaymentPartnerAction.Status = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "ACTIVE"] = 0;
                values[valuesById[1] = "INACTIVE"] = 1;
                return values;
            })();

            return MerchantPaymentPartnerAction;
        })();

        SyncActionValue.MusicUserIdAction = (function() {

            function MusicUserIdAction(p) {
                this.musicUserIdMap = {};
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MusicUserIdAction.prototype.musicUserId = null;
            MusicUserIdAction.prototype.musicUserIdMap = $util.emptyObject;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MusicUserIdAction.prototype, "_musicUserId", {
                get: $util.oneOfGetter($oneOfFields = ["musicUserId"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MusicUserIdAction.create = function create(properties) {
                return new MusicUserIdAction(properties);
            };

            MusicUserIdAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.musicUserId != null && Object.hasOwnProperty.call(m, "musicUserId"))
                    w.uint32(10).string(m.musicUserId);
                if (m.musicUserIdMap != null && Object.hasOwnProperty.call(m, "musicUserIdMap")) {
                    for (var ks = Object.keys(m.musicUserIdMap), i = 0; i < ks.length; ++i) {
                        w.uint32(18).fork().uint32(10).string(ks[i]).uint32(18).string(m.musicUserIdMap[ks[i]]).ldelim();
                    }
                }
                return w;
            };

            MusicUserIdAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.MusicUserIdAction(), k, value;
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.musicUserId = r.string();
                            break;
                        }
                    case 2: {
                            if (m.musicUserIdMap === $util.emptyObject)
                                m.musicUserIdMap = {};
                            var c2 = r.uint32() + r.pos;
                            k = "";
                            value = "";
                            while (r.pos < c2) {
                                var tag2 = r.uint32();
                                switch (tag2 >>> 3) {
                                case 1:
                                    k = r.string();
                                    break;
                                case 2:
                                    value = r.string();
                                    break;
                                default:
                                    r.skipType(tag2 & 7);
                                    break;
                                }
                            }
                            m.musicUserIdMap[k] = value;
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MusicUserIdAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.MusicUserIdAction)
                    return d;
                var m = new $root.proto.SyncActionValue.MusicUserIdAction();
                if (d.musicUserId != null) {
                    m.musicUserId = String(d.musicUserId);
                }
                if (d.musicUserIdMap) {
                    if (typeof d.musicUserIdMap !== "object")
                        throw TypeError(".proto.SyncActionValue.MusicUserIdAction.musicUserIdMap: object expected");
                    m.musicUserIdMap = {};
                    for (var ks = Object.keys(d.musicUserIdMap), i = 0; i < ks.length; ++i) {
                        m.musicUserIdMap[ks[i]] = String(d.musicUserIdMap[ks[i]]);
                    }
                }
                return m;
            };

            MusicUserIdAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.objects || o.defaults) {
                    d.musicUserIdMap = {};
                }
                if (m.musicUserId != null && m.hasOwnProperty("musicUserId")) {
                    d.musicUserId = m.musicUserId;
                    if (o.oneofs)
                        d._musicUserId = "musicUserId";
                }
                var ks2;
                if (m.musicUserIdMap && (ks2 = Object.keys(m.musicUserIdMap)).length) {
                    d.musicUserIdMap = {};
                    for (var j = 0; j < ks2.length; ++j) {
                        d.musicUserIdMap[ks2[j]] = m.musicUserIdMap[ks2[j]];
                    }
                }
                return d;
            };

            MusicUserIdAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MusicUserIdAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.MusicUserIdAction";
            };

            return MusicUserIdAction;
        })();

        SyncActionValue.MuteAction = (function() {

            function MuteAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            MuteAction.prototype.muted = null;
            MuteAction.prototype.muteEndTimestamp = null;
            MuteAction.prototype.autoMuted = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MuteAction.prototype, "_muted", {
                get: $util.oneOfGetter($oneOfFields = ["muted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MuteAction.prototype, "_muteEndTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["muteEndTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(MuteAction.prototype, "_autoMuted", {
                get: $util.oneOfGetter($oneOfFields = ["autoMuted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            MuteAction.create = function create(properties) {
                return new MuteAction(properties);
            };

            MuteAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.muted != null && Object.hasOwnProperty.call(m, "muted"))
                    w.uint32(8).bool(m.muted);
                if (m.muteEndTimestamp != null && Object.hasOwnProperty.call(m, "muteEndTimestamp"))
                    w.uint32(16).int64(m.muteEndTimestamp);
                if (m.autoMuted != null && Object.hasOwnProperty.call(m, "autoMuted"))
                    w.uint32(24).bool(m.autoMuted);
                return w;
            };

            MuteAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.MuteAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.muted = r.bool();
                            break;
                        }
                    case 2: {
                            m.muteEndTimestamp = r.int64();
                            break;
                        }
                    case 3: {
                            m.autoMuted = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            MuteAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.MuteAction)
                    return d;
                var m = new $root.proto.SyncActionValue.MuteAction();
                if (d.muted != null) {
                    m.muted = Boolean(d.muted);
                }
                if (d.muteEndTimestamp != null) {
                    if ($util.Long)
                        (m.muteEndTimestamp = $util.Long.fromValue(d.muteEndTimestamp)).unsigned = false;
                    else if (typeof d.muteEndTimestamp === "string")
                        m.muteEndTimestamp = parseInt(d.muteEndTimestamp, 10);
                    else if (typeof d.muteEndTimestamp === "number")
                        m.muteEndTimestamp = d.muteEndTimestamp;
                    else if (typeof d.muteEndTimestamp === "object")
                        m.muteEndTimestamp = new $util.LongBits(d.muteEndTimestamp.low >>> 0, d.muteEndTimestamp.high >>> 0).toNumber();
                }
                if (d.autoMuted != null) {
                    m.autoMuted = Boolean(d.autoMuted);
                }
                return m;
            };

            MuteAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.muted != null && m.hasOwnProperty("muted")) {
                    d.muted = m.muted;
                    if (o.oneofs)
                        d._muted = "muted";
                }
                if (m.muteEndTimestamp != null && m.hasOwnProperty("muteEndTimestamp")) {
                    if (typeof m.muteEndTimestamp === "number")
                        d.muteEndTimestamp = o.longs === String ? String(m.muteEndTimestamp) : m.muteEndTimestamp;
                    else
                        d.muteEndTimestamp = o.longs === String ? longToString(m.muteEndTimestamp) : o.longs === Number ? longToNumber(m.muteEndTimestamp) : m.muteEndTimestamp;
                    if (o.oneofs)
                        d._muteEndTimestamp = "muteEndTimestamp";
                }
                if (m.autoMuted != null && m.hasOwnProperty("autoMuted")) {
                    d.autoMuted = m.autoMuted;
                    if (o.oneofs)
                        d._autoMuted = "autoMuted";
                }
                return d;
            };

            MuteAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            MuteAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.MuteAction";
            };

            return MuteAction;
        })();

        SyncActionValue.NewsletterSavedInterestsAction = (function() {

            function NewsletterSavedInterestsAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            NewsletterSavedInterestsAction.prototype.newsletterSavedInterests = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NewsletterSavedInterestsAction.prototype, "_newsletterSavedInterests", {
                get: $util.oneOfGetter($oneOfFields = ["newsletterSavedInterests"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            NewsletterSavedInterestsAction.create = function create(properties) {
                return new NewsletterSavedInterestsAction(properties);
            };

            NewsletterSavedInterestsAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.newsletterSavedInterests != null && Object.hasOwnProperty.call(m, "newsletterSavedInterests"))
                    w.uint32(10).string(m.newsletterSavedInterests);
                return w;
            };

            NewsletterSavedInterestsAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.NewsletterSavedInterestsAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.newsletterSavedInterests = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            NewsletterSavedInterestsAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.NewsletterSavedInterestsAction)
                    return d;
                var m = new $root.proto.SyncActionValue.NewsletterSavedInterestsAction();
                if (d.newsletterSavedInterests != null) {
                    m.newsletterSavedInterests = String(d.newsletterSavedInterests);
                }
                return m;
            };

            NewsletterSavedInterestsAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.newsletterSavedInterests != null && m.hasOwnProperty("newsletterSavedInterests")) {
                    d.newsletterSavedInterests = m.newsletterSavedInterests;
                    if (o.oneofs)
                        d._newsletterSavedInterests = "newsletterSavedInterests";
                }
                return d;
            };

            NewsletterSavedInterestsAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            NewsletterSavedInterestsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.NewsletterSavedInterestsAction";
            };

            return NewsletterSavedInterestsAction;
        })();

        SyncActionValue.NoteEditAction = (function() {

            function NoteEditAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            NoteEditAction.prototype.type = null;
            NoteEditAction.prototype.chatJid = null;
            NoteEditAction.prototype.createdAt = null;
            NoteEditAction.prototype.deleted = null;
            NoteEditAction.prototype.unstructuredContent = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NoteEditAction.prototype, "_type", {
                get: $util.oneOfGetter($oneOfFields = ["type"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NoteEditAction.prototype, "_chatJid", {
                get: $util.oneOfGetter($oneOfFields = ["chatJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NoteEditAction.prototype, "_createdAt", {
                get: $util.oneOfGetter($oneOfFields = ["createdAt"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NoteEditAction.prototype, "_deleted", {
                get: $util.oneOfGetter($oneOfFields = ["deleted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NoteEditAction.prototype, "_unstructuredContent", {
                get: $util.oneOfGetter($oneOfFields = ["unstructuredContent"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            NoteEditAction.create = function create(properties) {
                return new NoteEditAction(properties);
            };

            NoteEditAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.type != null && Object.hasOwnProperty.call(m, "type"))
                    w.uint32(8).int32(m.type);
                if (m.chatJid != null && Object.hasOwnProperty.call(m, "chatJid"))
                    w.uint32(18).string(m.chatJid);
                if (m.createdAt != null && Object.hasOwnProperty.call(m, "createdAt"))
                    w.uint32(24).int64(m.createdAt);
                if (m.deleted != null && Object.hasOwnProperty.call(m, "deleted"))
                    w.uint32(32).bool(m.deleted);
                if (m.unstructuredContent != null && Object.hasOwnProperty.call(m, "unstructuredContent"))
                    w.uint32(42).string(m.unstructuredContent);
                return w;
            };

            NoteEditAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.NoteEditAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.type = r.int32();
                            break;
                        }
                    case 2: {
                            m.chatJid = r.string();
                            break;
                        }
                    case 3: {
                            m.createdAt = r.int64();
                            break;
                        }
                    case 4: {
                            m.deleted = r.bool();
                            break;
                        }
                    case 5: {
                            m.unstructuredContent = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            NoteEditAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.NoteEditAction)
                    return d;
                var m = new $root.proto.SyncActionValue.NoteEditAction();
                switch (d.type) {
                default:
                    if (typeof d.type === "number") {
                        m.type = d.type;
                        break;
                    }
                    break;
                case "UNSTRUCTURED":
                case 1:
                    m.type = 1;
                    break;
                case "STRUCTURED":
                case 2:
                    m.type = 2;
                    break;
                }
                if (d.chatJid != null) {
                    m.chatJid = String(d.chatJid);
                }
                if (d.createdAt != null) {
                    if ($util.Long)
                        (m.createdAt = $util.Long.fromValue(d.createdAt)).unsigned = false;
                    else if (typeof d.createdAt === "string")
                        m.createdAt = parseInt(d.createdAt, 10);
                    else if (typeof d.createdAt === "number")
                        m.createdAt = d.createdAt;
                    else if (typeof d.createdAt === "object")
                        m.createdAt = new $util.LongBits(d.createdAt.low >>> 0, d.createdAt.high >>> 0).toNumber();
                }
                if (d.deleted != null) {
                    m.deleted = Boolean(d.deleted);
                }
                if (d.unstructuredContent != null) {
                    m.unstructuredContent = String(d.unstructuredContent);
                }
                return m;
            };

            NoteEditAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.type != null && m.hasOwnProperty("type")) {
                    d.type = o.enums === String ? $root.proto.SyncActionValue.NoteEditAction.NoteType[m.type] === undefined ? m.type : $root.proto.SyncActionValue.NoteEditAction.NoteType[m.type] : m.type;
                    if (o.oneofs)
                        d._type = "type";
                }
                if (m.chatJid != null && m.hasOwnProperty("chatJid")) {
                    d.chatJid = m.chatJid;
                    if (o.oneofs)
                        d._chatJid = "chatJid";
                }
                if (m.createdAt != null && m.hasOwnProperty("createdAt")) {
                    if (typeof m.createdAt === "number")
                        d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt;
                    else
                        d.createdAt = o.longs === String ? longToString(m.createdAt) : o.longs === Number ? longToNumber(m.createdAt) : m.createdAt;
                    if (o.oneofs)
                        d._createdAt = "createdAt";
                }
                if (m.deleted != null && m.hasOwnProperty("deleted")) {
                    d.deleted = m.deleted;
                    if (o.oneofs)
                        d._deleted = "deleted";
                }
                if (m.unstructuredContent != null && m.hasOwnProperty("unstructuredContent")) {
                    d.unstructuredContent = m.unstructuredContent;
                    if (o.oneofs)
                        d._unstructuredContent = "unstructuredContent";
                }
                return d;
            };

            NoteEditAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            NoteEditAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.NoteEditAction";
            };

            NoteEditAction.NoteType = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "UNSTRUCTURED"] = 1;
                values[valuesById[2] = "STRUCTURED"] = 2;
                return values;
            })();

            return NoteEditAction;
        })();

        SyncActionValue.NotificationActivitySettingAction = (function() {

            function NotificationActivitySettingAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            NotificationActivitySettingAction.prototype.notificationActivitySetting = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NotificationActivitySettingAction.prototype, "_notificationActivitySetting", {
                get: $util.oneOfGetter($oneOfFields = ["notificationActivitySetting"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            NotificationActivitySettingAction.create = function create(properties) {
                return new NotificationActivitySettingAction(properties);
            };

            NotificationActivitySettingAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.notificationActivitySetting != null && Object.hasOwnProperty.call(m, "notificationActivitySetting"))
                    w.uint32(8).int32(m.notificationActivitySetting);
                return w;
            };

            NotificationActivitySettingAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.NotificationActivitySettingAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.notificationActivitySetting = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            NotificationActivitySettingAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.NotificationActivitySettingAction)
                    return d;
                var m = new $root.proto.SyncActionValue.NotificationActivitySettingAction();
                switch (d.notificationActivitySetting) {
                default:
                    if (typeof d.notificationActivitySetting === "number") {
                        m.notificationActivitySetting = d.notificationActivitySetting;
                        break;
                    }
                    break;
                case "DEFAULT_ALL_MESSAGES":
                case 0:
                    m.notificationActivitySetting = 0;
                    break;
                case "ALL_MESSAGES":
                case 1:
                    m.notificationActivitySetting = 1;
                    break;
                case "HIGHLIGHTS":
                case 2:
                    m.notificationActivitySetting = 2;
                    break;
                case "DEFAULT_HIGHLIGHTS":
                case 3:
                    m.notificationActivitySetting = 3;
                    break;
                }
                return m;
            };

            NotificationActivitySettingAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.notificationActivitySetting != null && m.hasOwnProperty("notificationActivitySetting")) {
                    d.notificationActivitySetting = o.enums === String ? $root.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[m.notificationActivitySetting] === undefined ? m.notificationActivitySetting : $root.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[m.notificationActivitySetting] : m.notificationActivitySetting;
                    if (o.oneofs)
                        d._notificationActivitySetting = "notificationActivitySetting";
                }
                return d;
            };

            NotificationActivitySettingAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            NotificationActivitySettingAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.NotificationActivitySettingAction";
            };

            NotificationActivitySettingAction.NotificationActivitySetting = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "DEFAULT_ALL_MESSAGES"] = 0;
                values[valuesById[1] = "ALL_MESSAGES"] = 1;
                values[valuesById[2] = "HIGHLIGHTS"] = 2;
                values[valuesById[3] = "DEFAULT_HIGHLIGHTS"] = 3;
                return values;
            })();

            return NotificationActivitySettingAction;
        })();

        SyncActionValue.NuxAction = (function() {

            function NuxAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            NuxAction.prototype.acknowledged = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(NuxAction.prototype, "_acknowledged", {
                get: $util.oneOfGetter($oneOfFields = ["acknowledged"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            NuxAction.create = function create(properties) {
                return new NuxAction(properties);
            };

            NuxAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.acknowledged != null && Object.hasOwnProperty.call(m, "acknowledged"))
                    w.uint32(8).bool(m.acknowledged);
                return w;
            };

            NuxAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.NuxAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.acknowledged = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            NuxAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.NuxAction)
                    return d;
                var m = new $root.proto.SyncActionValue.NuxAction();
                if (d.acknowledged != null) {
                    m.acknowledged = Boolean(d.acknowledged);
                }
                return m;
            };

            NuxAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.acknowledged != null && m.hasOwnProperty("acknowledged")) {
                    d.acknowledged = m.acknowledged;
                    if (o.oneofs)
                        d._acknowledged = "acknowledged";
                }
                return d;
            };

            NuxAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            NuxAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.NuxAction";
            };

            return NuxAction;
        })();

        SyncActionValue.PaymentInfoAction = (function() {

            function PaymentInfoAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PaymentInfoAction.prototype.cpi = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PaymentInfoAction.prototype, "_cpi", {
                get: $util.oneOfGetter($oneOfFields = ["cpi"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PaymentInfoAction.create = function create(properties) {
                return new PaymentInfoAction(properties);
            };

            PaymentInfoAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.cpi != null && Object.hasOwnProperty.call(m, "cpi"))
                    w.uint32(10).string(m.cpi);
                return w;
            };

            PaymentInfoAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PaymentInfoAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.cpi = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PaymentInfoAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PaymentInfoAction)
                    return d;
                var m = new $root.proto.SyncActionValue.PaymentInfoAction();
                if (d.cpi != null) {
                    m.cpi = String(d.cpi);
                }
                return m;
            };

            PaymentInfoAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.cpi != null && m.hasOwnProperty("cpi")) {
                    d.cpi = m.cpi;
                    if (o.oneofs)
                        d._cpi = "cpi";
                }
                return d;
            };

            PaymentInfoAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PaymentInfoAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PaymentInfoAction";
            };

            return PaymentInfoAction;
        })();

        SyncActionValue.PaymentTosAction = (function() {

            function PaymentTosAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PaymentTosAction.prototype.paymentNotice = 0;
            PaymentTosAction.prototype.accepted = false;

            PaymentTosAction.create = function create(properties) {
                return new PaymentTosAction(properties);
            };

            PaymentTosAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.paymentNotice != null && Object.hasOwnProperty.call(m, "paymentNotice"))
                    w.uint32(8).int32(m.paymentNotice);
                if (m.accepted != null && Object.hasOwnProperty.call(m, "accepted"))
                    w.uint32(16).bool(m.accepted);
                return w;
            };

            PaymentTosAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PaymentTosAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.paymentNotice = r.int32();
                            break;
                        }
                    case 2: {
                            m.accepted = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PaymentTosAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PaymentTosAction)
                    return d;
                var m = new $root.proto.SyncActionValue.PaymentTosAction();
                switch (d.paymentNotice) {
                default:
                    if (typeof d.paymentNotice === "number") {
                        m.paymentNotice = d.paymentNotice;
                        break;
                    }
                    break;
                case "BR_PAY_PRIVACY_POLICY":
                case 0:
                    m.paymentNotice = 0;
                    break;
                }
                if (d.accepted != null) {
                    m.accepted = Boolean(d.accepted);
                }
                return m;
            };

            PaymentTosAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.defaults) {
                    d.paymentNotice = o.enums === String ? "BR_PAY_PRIVACY_POLICY" : 0;
                    d.accepted = false;
                }
                if (m.paymentNotice != null && m.hasOwnProperty("paymentNotice")) {
                    d.paymentNotice = o.enums === String ? $root.proto.SyncActionValue.PaymentTosAction.PaymentNotice[m.paymentNotice] === undefined ? m.paymentNotice : $root.proto.SyncActionValue.PaymentTosAction.PaymentNotice[m.paymentNotice] : m.paymentNotice;
                }
                if (m.accepted != null && m.hasOwnProperty("accepted")) {
                    d.accepted = m.accepted;
                }
                return d;
            };

            PaymentTosAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PaymentTosAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PaymentTosAction";
            };

            PaymentTosAction.PaymentNotice = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "BR_PAY_PRIVACY_POLICY"] = 0;
                return values;
            })();

            return PaymentTosAction;
        })();

        SyncActionValue.PinAction = (function() {

            function PinAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PinAction.prototype.pinned = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PinAction.prototype, "_pinned", {
                get: $util.oneOfGetter($oneOfFields = ["pinned"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PinAction.create = function create(properties) {
                return new PinAction(properties);
            };

            PinAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.pinned != null && Object.hasOwnProperty.call(m, "pinned"))
                    w.uint32(8).bool(m.pinned);
                return w;
            };

            PinAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PinAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.pinned = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PinAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PinAction)
                    return d;
                var m = new $root.proto.SyncActionValue.PinAction();
                if (d.pinned != null) {
                    m.pinned = Boolean(d.pinned);
                }
                return m;
            };

            PinAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.pinned != null && m.hasOwnProperty("pinned")) {
                    d.pinned = m.pinned;
                    if (o.oneofs)
                        d._pinned = "pinned";
                }
                return d;
            };

            PinAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PinAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PinAction";
            };

            return PinAction;
        })();

        SyncActionValue.PnForLidChatAction = (function() {

            function PnForLidChatAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PnForLidChatAction.prototype.pnJid = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PnForLidChatAction.prototype, "_pnJid", {
                get: $util.oneOfGetter($oneOfFields = ["pnJid"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PnForLidChatAction.create = function create(properties) {
                return new PnForLidChatAction(properties);
            };

            PnForLidChatAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.pnJid != null && Object.hasOwnProperty.call(m, "pnJid"))
                    w.uint32(10).string(m.pnJid);
                return w;
            };

            PnForLidChatAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PnForLidChatAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.pnJid = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PnForLidChatAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PnForLidChatAction)
                    return d;
                var m = new $root.proto.SyncActionValue.PnForLidChatAction();
                if (d.pnJid != null) {
                    m.pnJid = String(d.pnJid);
                }
                return m;
            };

            PnForLidChatAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.pnJid != null && m.hasOwnProperty("pnJid")) {
                    d.pnJid = m.pnJid;
                    if (o.oneofs)
                        d._pnJid = "pnJid";
                }
                return d;
            };

            PnForLidChatAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PnForLidChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PnForLidChatAction";
            };

            return PnForLidChatAction;
        })();

        SyncActionValue.PrimaryFeature = (function() {

            function PrimaryFeature(p) {
                this.flags = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PrimaryFeature.prototype.flags = $util.emptyArray;

            PrimaryFeature.create = function create(properties) {
                return new PrimaryFeature(properties);
            };

            PrimaryFeature.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.flags != null && m.flags.length) {
                    for (var i = 0; i < m.flags.length; ++i)
                        w.uint32(10).string(m.flags[i]);
                }
                return w;
            };

            PrimaryFeature.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PrimaryFeature();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.flags && m.flags.length))
                                m.flags = [];
                            m.flags.push(r.string());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PrimaryFeature.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PrimaryFeature)
                    return d;
                var m = new $root.proto.SyncActionValue.PrimaryFeature();
                if (d.flags) {
                    if (!Array.isArray(d.flags))
                        throw TypeError(".proto.SyncActionValue.PrimaryFeature.flags: array expected");
                    m.flags = [];
                    for (var i = 0; i < d.flags.length; ++i) {
                        m.flags[i] = String(d.flags[i]);
                    }
                }
                return m;
            };

            PrimaryFeature.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.flags = [];
                }
                if (m.flags && m.flags.length) {
                    d.flags = [];
                    for (var j = 0; j < m.flags.length; ++j) {
                        d.flags[j] = m.flags[j];
                    }
                }
                return d;
            };

            PrimaryFeature.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PrimaryFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PrimaryFeature";
            };

            return PrimaryFeature;
        })();

        SyncActionValue.PrimaryVersionAction = (function() {

            function PrimaryVersionAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PrimaryVersionAction.prototype.version = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PrimaryVersionAction.prototype, "_version", {
                get: $util.oneOfGetter($oneOfFields = ["version"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PrimaryVersionAction.create = function create(properties) {
                return new PrimaryVersionAction(properties);
            };

            PrimaryVersionAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                    w.uint32(10).string(m.version);
                return w;
            };

            PrimaryVersionAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PrimaryVersionAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.version = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PrimaryVersionAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PrimaryVersionAction)
                    return d;
                var m = new $root.proto.SyncActionValue.PrimaryVersionAction();
                if (d.version != null) {
                    m.version = String(d.version);
                }
                return m;
            };

            PrimaryVersionAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.version != null && m.hasOwnProperty("version")) {
                    d.version = m.version;
                    if (o.oneofs)
                        d._version = "version";
                }
                return d;
            };

            PrimaryVersionAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PrimaryVersionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PrimaryVersionAction";
            };

            return PrimaryVersionAction;
        })();

        SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction = (function() {

            function PrivacySettingChannelsPersonalisedRecommendationAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PrivacySettingChannelsPersonalisedRecommendationAction.prototype.isUserOptedOut = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PrivacySettingChannelsPersonalisedRecommendationAction.prototype, "_isUserOptedOut", {
                get: $util.oneOfGetter($oneOfFields = ["isUserOptedOut"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PrivacySettingChannelsPersonalisedRecommendationAction.create = function create(properties) {
                return new PrivacySettingChannelsPersonalisedRecommendationAction(properties);
            };

            PrivacySettingChannelsPersonalisedRecommendationAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isUserOptedOut != null && Object.hasOwnProperty.call(m, "isUserOptedOut"))
                    w.uint32(8).bool(m.isUserOptedOut);
                return w;
            };

            PrivacySettingChannelsPersonalisedRecommendationAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isUserOptedOut = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PrivacySettingChannelsPersonalisedRecommendationAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction)
                    return d;
                var m = new $root.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction();
                if (d.isUserOptedOut != null) {
                    m.isUserOptedOut = Boolean(d.isUserOptedOut);
                }
                return m;
            };

            PrivacySettingChannelsPersonalisedRecommendationAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isUserOptedOut != null && m.hasOwnProperty("isUserOptedOut")) {
                    d.isUserOptedOut = m.isUserOptedOut;
                    if (o.oneofs)
                        d._isUserOptedOut = "isUserOptedOut";
                }
                return d;
            };

            PrivacySettingChannelsPersonalisedRecommendationAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PrivacySettingChannelsPersonalisedRecommendationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction";
            };

            return PrivacySettingChannelsPersonalisedRecommendationAction;
        })();

        SyncActionValue.PrivacySettingDisableLinkPreviewsAction = (function() {

            function PrivacySettingDisableLinkPreviewsAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PrivacySettingDisableLinkPreviewsAction.prototype.isPreviewsDisabled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PrivacySettingDisableLinkPreviewsAction.prototype, "_isPreviewsDisabled", {
                get: $util.oneOfGetter($oneOfFields = ["isPreviewsDisabled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PrivacySettingDisableLinkPreviewsAction.create = function create(properties) {
                return new PrivacySettingDisableLinkPreviewsAction(properties);
            };

            PrivacySettingDisableLinkPreviewsAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isPreviewsDisabled != null && Object.hasOwnProperty.call(m, "isPreviewsDisabled"))
                    w.uint32(8).bool(m.isPreviewsDisabled);
                return w;
            };

            PrivacySettingDisableLinkPreviewsAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isPreviewsDisabled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PrivacySettingDisableLinkPreviewsAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction)
                    return d;
                var m = new $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction();
                if (d.isPreviewsDisabled != null) {
                    m.isPreviewsDisabled = Boolean(d.isPreviewsDisabled);
                }
                return m;
            };

            PrivacySettingDisableLinkPreviewsAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isPreviewsDisabled != null && m.hasOwnProperty("isPreviewsDisabled")) {
                    d.isPreviewsDisabled = m.isPreviewsDisabled;
                    if (o.oneofs)
                        d._isPreviewsDisabled = "isPreviewsDisabled";
                }
                return d;
            };

            PrivacySettingDisableLinkPreviewsAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PrivacySettingDisableLinkPreviewsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction";
            };

            return PrivacySettingDisableLinkPreviewsAction;
        })();

        SyncActionValue.PrivacySettingRelayAllCalls = (function() {

            function PrivacySettingRelayAllCalls(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PrivacySettingRelayAllCalls.prototype.isEnabled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PrivacySettingRelayAllCalls.prototype, "_isEnabled", {
                get: $util.oneOfGetter($oneOfFields = ["isEnabled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PrivacySettingRelayAllCalls.create = function create(properties) {
                return new PrivacySettingRelayAllCalls(properties);
            };

            PrivacySettingRelayAllCalls.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isEnabled != null && Object.hasOwnProperty.call(m, "isEnabled"))
                    w.uint32(8).bool(m.isEnabled);
                return w;
            };

            PrivacySettingRelayAllCalls.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PrivacySettingRelayAllCalls();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isEnabled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PrivacySettingRelayAllCalls.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PrivacySettingRelayAllCalls)
                    return d;
                var m = new $root.proto.SyncActionValue.PrivacySettingRelayAllCalls();
                if (d.isEnabled != null) {
                    m.isEnabled = Boolean(d.isEnabled);
                }
                return m;
            };

            PrivacySettingRelayAllCalls.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isEnabled != null && m.hasOwnProperty("isEnabled")) {
                    d.isEnabled = m.isEnabled;
                    if (o.oneofs)
                        d._isEnabled = "isEnabled";
                }
                return d;
            };

            PrivacySettingRelayAllCalls.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PrivacySettingRelayAllCalls.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PrivacySettingRelayAllCalls";
            };

            return PrivacySettingRelayAllCalls;
        })();

        SyncActionValue.PrivateProcessingSettingAction = (function() {

            function PrivateProcessingSettingAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PrivateProcessingSettingAction.prototype.privateProcessingStatus = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PrivateProcessingSettingAction.prototype, "_privateProcessingStatus", {
                get: $util.oneOfGetter($oneOfFields = ["privateProcessingStatus"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PrivateProcessingSettingAction.create = function create(properties) {
                return new PrivateProcessingSettingAction(properties);
            };

            PrivateProcessingSettingAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.privateProcessingStatus != null && Object.hasOwnProperty.call(m, "privateProcessingStatus"))
                    w.uint32(8).int32(m.privateProcessingStatus);
                return w;
            };

            PrivateProcessingSettingAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PrivateProcessingSettingAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.privateProcessingStatus = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PrivateProcessingSettingAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PrivateProcessingSettingAction)
                    return d;
                var m = new $root.proto.SyncActionValue.PrivateProcessingSettingAction();
                switch (d.privateProcessingStatus) {
                default:
                    if (typeof d.privateProcessingStatus === "number") {
                        m.privateProcessingStatus = d.privateProcessingStatus;
                        break;
                    }
                    break;
                case "UNDEFINED":
                case 0:
                    m.privateProcessingStatus = 0;
                    break;
                case "ENABLED":
                case 1:
                    m.privateProcessingStatus = 1;
                    break;
                case "DISABLED":
                case 2:
                    m.privateProcessingStatus = 2;
                    break;
                }
                return m;
            };

            PrivateProcessingSettingAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.privateProcessingStatus != null && m.hasOwnProperty("privateProcessingStatus")) {
                    d.privateProcessingStatus = o.enums === String ? $root.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[m.privateProcessingStatus] === undefined ? m.privateProcessingStatus : $root.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[m.privateProcessingStatus] : m.privateProcessingStatus;
                    if (o.oneofs)
                        d._privateProcessingStatus = "privateProcessingStatus";
                }
                return d;
            };

            PrivateProcessingSettingAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PrivateProcessingSettingAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PrivateProcessingSettingAction";
            };

            PrivateProcessingSettingAction.PrivateProcessingStatus = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "UNDEFINED"] = 0;
                values[valuesById[1] = "ENABLED"] = 1;
                values[valuesById[2] = "DISABLED"] = 2;
                return values;
            })();

            return PrivateProcessingSettingAction;
        })();

        SyncActionValue.PushNameSetting = (function() {

            function PushNameSetting(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            PushNameSetting.prototype.name = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(PushNameSetting.prototype, "_name", {
                get: $util.oneOfGetter($oneOfFields = ["name"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            PushNameSetting.create = function create(properties) {
                return new PushNameSetting(properties);
            };

            PushNameSetting.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                    w.uint32(10).string(m.name);
                return w;
            };

            PushNameSetting.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.PushNameSetting();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.name = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            PushNameSetting.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.PushNameSetting)
                    return d;
                var m = new $root.proto.SyncActionValue.PushNameSetting();
                if (d.name != null) {
                    m.name = String(d.name);
                }
                return m;
            };

            PushNameSetting.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.name != null && m.hasOwnProperty("name")) {
                    d.name = m.name;
                    if (o.oneofs)
                        d._name = "name";
                }
                return d;
            };

            PushNameSetting.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            PushNameSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.PushNameSetting";
            };

            return PushNameSetting;
        })();

        SyncActionValue.QuickReplyAction = (function() {

            function QuickReplyAction(p) {
                this.keywords = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            QuickReplyAction.prototype.shortcut = null;
            QuickReplyAction.prototype.message = null;
            QuickReplyAction.prototype.keywords = $util.emptyArray;
            QuickReplyAction.prototype.count = null;
            QuickReplyAction.prototype.deleted = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuickReplyAction.prototype, "_shortcut", {
                get: $util.oneOfGetter($oneOfFields = ["shortcut"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuickReplyAction.prototype, "_message", {
                get: $util.oneOfGetter($oneOfFields = ["message"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuickReplyAction.prototype, "_count", {
                get: $util.oneOfGetter($oneOfFields = ["count"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuickReplyAction.prototype, "_deleted", {
                get: $util.oneOfGetter($oneOfFields = ["deleted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            QuickReplyAction.create = function create(properties) {
                return new QuickReplyAction(properties);
            };

            QuickReplyAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.shortcut != null && Object.hasOwnProperty.call(m, "shortcut"))
                    w.uint32(10).string(m.shortcut);
                if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                    w.uint32(18).string(m.message);
                if (m.keywords != null && m.keywords.length) {
                    for (var i = 0; i < m.keywords.length; ++i)
                        w.uint32(26).string(m.keywords[i]);
                }
                if (m.count != null && Object.hasOwnProperty.call(m, "count"))
                    w.uint32(32).int32(m.count);
                if (m.deleted != null && Object.hasOwnProperty.call(m, "deleted"))
                    w.uint32(40).bool(m.deleted);
                return w;
            };

            QuickReplyAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.QuickReplyAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.shortcut = r.string();
                            break;
                        }
                    case 2: {
                            m.message = r.string();
                            break;
                        }
                    case 3: {
                            if (!(m.keywords && m.keywords.length))
                                m.keywords = [];
                            m.keywords.push(r.string());
                            break;
                        }
                    case 4: {
                            m.count = r.int32();
                            break;
                        }
                    case 5: {
                            m.deleted = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            QuickReplyAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.QuickReplyAction)
                    return d;
                var m = new $root.proto.SyncActionValue.QuickReplyAction();
                if (d.shortcut != null) {
                    m.shortcut = String(d.shortcut);
                }
                if (d.message != null) {
                    m.message = String(d.message);
                }
                if (d.keywords) {
                    if (!Array.isArray(d.keywords))
                        throw TypeError(".proto.SyncActionValue.QuickReplyAction.keywords: array expected");
                    m.keywords = [];
                    for (var i = 0; i < d.keywords.length; ++i) {
                        m.keywords[i] = String(d.keywords[i]);
                    }
                }
                if (d.count != null) {
                    m.count = d.count | 0;
                }
                if (d.deleted != null) {
                    m.deleted = Boolean(d.deleted);
                }
                return m;
            };

            QuickReplyAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.keywords = [];
                }
                if (m.shortcut != null && m.hasOwnProperty("shortcut")) {
                    d.shortcut = m.shortcut;
                    if (o.oneofs)
                        d._shortcut = "shortcut";
                }
                if (m.message != null && m.hasOwnProperty("message")) {
                    d.message = m.message;
                    if (o.oneofs)
                        d._message = "message";
                }
                if (m.keywords && m.keywords.length) {
                    d.keywords = [];
                    for (var j = 0; j < m.keywords.length; ++j) {
                        d.keywords[j] = m.keywords[j];
                    }
                }
                if (m.count != null && m.hasOwnProperty("count")) {
                    d.count = m.count;
                    if (o.oneofs)
                        d._count = "count";
                }
                if (m.deleted != null && m.hasOwnProperty("deleted")) {
                    d.deleted = m.deleted;
                    if (o.oneofs)
                        d._deleted = "deleted";
                }
                return d;
            };

            QuickReplyAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            QuickReplyAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.QuickReplyAction";
            };

            return QuickReplyAction;
        })();

        SyncActionValue.RecentEmojiWeightsAction = (function() {

            function RecentEmojiWeightsAction(p) {
                this.weights = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            RecentEmojiWeightsAction.prototype.weights = $util.emptyArray;

            RecentEmojiWeightsAction.create = function create(properties) {
                return new RecentEmojiWeightsAction(properties);
            };

            RecentEmojiWeightsAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.weights != null && m.weights.length) {
                    for (var i = 0; i < m.weights.length; ++i)
                        $root.proto.RecentEmojiWeight.encode(m.weights[i], w.uint32(10).fork()).ldelim();
                }
                return w;
            };

            RecentEmojiWeightsAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.RecentEmojiWeightsAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            if (!(m.weights && m.weights.length))
                                m.weights = [];
                            m.weights.push($root.proto.RecentEmojiWeight.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            RecentEmojiWeightsAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.RecentEmojiWeightsAction)
                    return d;
                var m = new $root.proto.SyncActionValue.RecentEmojiWeightsAction();
                if (d.weights) {
                    if (!Array.isArray(d.weights))
                        throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: array expected");
                    m.weights = [];
                    for (var i = 0; i < d.weights.length; ++i) {
                        if (typeof d.weights[i] !== "object")
                            throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: object expected");
                        m.weights[i] = $root.proto.RecentEmojiWeight.fromObject(d.weights[i]);
                    }
                }
                return m;
            };

            RecentEmojiWeightsAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.weights = [];
                }
                if (m.weights && m.weights.length) {
                    d.weights = [];
                    for (var j = 0; j < m.weights.length; ++j) {
                        d.weights[j] = $root.proto.RecentEmojiWeight.toObject(m.weights[j], o);
                    }
                }
                return d;
            };

            RecentEmojiWeightsAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            RecentEmojiWeightsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.RecentEmojiWeightsAction";
            };

            return RecentEmojiWeightsAction;
        })();

        SyncActionValue.RemoveRecentStickerAction = (function() {

            function RemoveRecentStickerAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            RemoveRecentStickerAction.prototype.lastStickerSentTs = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(RemoveRecentStickerAction.prototype, "_lastStickerSentTs", {
                get: $util.oneOfGetter($oneOfFields = ["lastStickerSentTs"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            RemoveRecentStickerAction.create = function create(properties) {
                return new RemoveRecentStickerAction(properties);
            };

            RemoveRecentStickerAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.lastStickerSentTs != null && Object.hasOwnProperty.call(m, "lastStickerSentTs"))
                    w.uint32(8).int64(m.lastStickerSentTs);
                return w;
            };

            RemoveRecentStickerAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.RemoveRecentStickerAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.lastStickerSentTs = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            RemoveRecentStickerAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.RemoveRecentStickerAction)
                    return d;
                var m = new $root.proto.SyncActionValue.RemoveRecentStickerAction();
                if (d.lastStickerSentTs != null) {
                    if ($util.Long)
                        (m.lastStickerSentTs = $util.Long.fromValue(d.lastStickerSentTs)).unsigned = false;
                    else if (typeof d.lastStickerSentTs === "string")
                        m.lastStickerSentTs = parseInt(d.lastStickerSentTs, 10);
                    else if (typeof d.lastStickerSentTs === "number")
                        m.lastStickerSentTs = d.lastStickerSentTs;
                    else if (typeof d.lastStickerSentTs === "object")
                        m.lastStickerSentTs = new $util.LongBits(d.lastStickerSentTs.low >>> 0, d.lastStickerSentTs.high >>> 0).toNumber();
                }
                return m;
            };

            RemoveRecentStickerAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.lastStickerSentTs != null && m.hasOwnProperty("lastStickerSentTs")) {
                    if (typeof m.lastStickerSentTs === "number")
                        d.lastStickerSentTs = o.longs === String ? String(m.lastStickerSentTs) : m.lastStickerSentTs;
                    else
                        d.lastStickerSentTs = o.longs === String ? longToString(m.lastStickerSentTs) : o.longs === Number ? longToNumber(m.lastStickerSentTs) : m.lastStickerSentTs;
                    if (o.oneofs)
                        d._lastStickerSentTs = "lastStickerSentTs";
                }
                return d;
            };

            RemoveRecentStickerAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            RemoveRecentStickerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.RemoveRecentStickerAction";
            };

            return RemoveRecentStickerAction;
        })();

        SyncActionValue.StarAction = (function() {

            function StarAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StarAction.prototype.starred = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StarAction.prototype, "_starred", {
                get: $util.oneOfGetter($oneOfFields = ["starred"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StarAction.create = function create(properties) {
                return new StarAction(properties);
            };

            StarAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.starred != null && Object.hasOwnProperty.call(m, "starred"))
                    w.uint32(8).bool(m.starred);
                return w;
            };

            StarAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.StarAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.starred = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StarAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.StarAction)
                    return d;
                var m = new $root.proto.SyncActionValue.StarAction();
                if (d.starred != null) {
                    m.starred = Boolean(d.starred);
                }
                return m;
            };

            StarAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.starred != null && m.hasOwnProperty("starred")) {
                    d.starred = m.starred;
                    if (o.oneofs)
                        d._starred = "starred";
                }
                return d;
            };

            StarAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StarAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.StarAction";
            };

            return StarAction;
        })();

        SyncActionValue.StatusPostOptInNotificationPreferencesAction = (function() {

            function StatusPostOptInNotificationPreferencesAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StatusPostOptInNotificationPreferencesAction.prototype.enabled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusPostOptInNotificationPreferencesAction.prototype, "_enabled", {
                get: $util.oneOfGetter($oneOfFields = ["enabled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StatusPostOptInNotificationPreferencesAction.create = function create(properties) {
                return new StatusPostOptInNotificationPreferencesAction(properties);
            };

            StatusPostOptInNotificationPreferencesAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.enabled != null && Object.hasOwnProperty.call(m, "enabled"))
                    w.uint32(8).bool(m.enabled);
                return w;
            };

            StatusPostOptInNotificationPreferencesAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.enabled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StatusPostOptInNotificationPreferencesAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction)
                    return d;
                var m = new $root.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction();
                if (d.enabled != null) {
                    m.enabled = Boolean(d.enabled);
                }
                return m;
            };

            StatusPostOptInNotificationPreferencesAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.enabled != null && m.hasOwnProperty("enabled")) {
                    d.enabled = m.enabled;
                    if (o.oneofs)
                        d._enabled = "enabled";
                }
                return d;
            };

            StatusPostOptInNotificationPreferencesAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StatusPostOptInNotificationPreferencesAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction";
            };

            return StatusPostOptInNotificationPreferencesAction;
        })();

        SyncActionValue.StatusPrivacyAction = (function() {

            function StatusPrivacyAction(p) {
                this.userJid = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StatusPrivacyAction.prototype.mode = null;
            StatusPrivacyAction.prototype.userJid = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StatusPrivacyAction.prototype, "_mode", {
                get: $util.oneOfGetter($oneOfFields = ["mode"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StatusPrivacyAction.create = function create(properties) {
                return new StatusPrivacyAction(properties);
            };

            StatusPrivacyAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.mode != null && Object.hasOwnProperty.call(m, "mode"))
                    w.uint32(8).int32(m.mode);
                if (m.userJid != null && m.userJid.length) {
                    for (var i = 0; i < m.userJid.length; ++i)
                        w.uint32(18).string(m.userJid[i]);
                }
                return w;
            };

            StatusPrivacyAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.StatusPrivacyAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.mode = r.int32();
                            break;
                        }
                    case 2: {
                            if (!(m.userJid && m.userJid.length))
                                m.userJid = [];
                            m.userJid.push(r.string());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StatusPrivacyAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.StatusPrivacyAction)
                    return d;
                var m = new $root.proto.SyncActionValue.StatusPrivacyAction();
                switch (d.mode) {
                default:
                    if (typeof d.mode === "number") {
                        m.mode = d.mode;
                        break;
                    }
                    break;
                case "ALLOW_LIST":
                case 0:
                    m.mode = 0;
                    break;
                case "DENY_LIST":
                case 1:
                    m.mode = 1;
                    break;
                case "CONTACTS":
                case 2:
                    m.mode = 2;
                    break;
                case "CLOSE_FRIENDS":
                case 3:
                    m.mode = 3;
                    break;
                }
                if (d.userJid) {
                    if (!Array.isArray(d.userJid))
                        throw TypeError(".proto.SyncActionValue.StatusPrivacyAction.userJid: array expected");
                    m.userJid = [];
                    for (var i = 0; i < d.userJid.length; ++i) {
                        m.userJid[i] = String(d.userJid[i]);
                    }
                }
                return m;
            };

            StatusPrivacyAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.userJid = [];
                }
                if (m.mode != null && m.hasOwnProperty("mode")) {
                    d.mode = o.enums === String ? $root.proto.SyncActionValue.StatusPrivacyAction.StatusDistributionMode[m.mode] === undefined ? m.mode : $root.proto.SyncActionValue.StatusPrivacyAction.StatusDistributionMode[m.mode] : m.mode;
                    if (o.oneofs)
                        d._mode = "mode";
                }
                if (m.userJid && m.userJid.length) {
                    d.userJid = [];
                    for (var j = 0; j < m.userJid.length; ++j) {
                        d.userJid[j] = m.userJid[j];
                    }
                }
                return d;
            };

            StatusPrivacyAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StatusPrivacyAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.StatusPrivacyAction";
            };

            StatusPrivacyAction.StatusDistributionMode = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "ALLOW_LIST"] = 0;
                values[valuesById[1] = "DENY_LIST"] = 1;
                values[valuesById[2] = "CONTACTS"] = 2;
                values[valuesById[3] = "CLOSE_FRIENDS"] = 3;
                return values;
            })();

            return StatusPrivacyAction;
        })();

        SyncActionValue.StickerAction = (function() {

            function StickerAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            StickerAction.prototype.url = null;
            StickerAction.prototype.fileEncSha256 = null;
            StickerAction.prototype.mediaKey = null;
            StickerAction.prototype.mimetype = null;
            StickerAction.prototype.height = null;
            StickerAction.prototype.width = null;
            StickerAction.prototype.directPath = null;
            StickerAction.prototype.fileLength = null;
            StickerAction.prototype.isFavorite = null;
            StickerAction.prototype.deviceIdHint = null;
            StickerAction.prototype.isLottie = null;
            StickerAction.prototype.imageHash = null;
            StickerAction.prototype.isAvatarSticker = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_fileEncSha256", {
                get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_mediaKey", {
                get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_mimetype", {
                get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_height", {
                get: $util.oneOfGetter($oneOfFields = ["height"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_width", {
                get: $util.oneOfGetter($oneOfFields = ["width"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_directPath", {
                get: $util.oneOfGetter($oneOfFields = ["directPath"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_fileLength", {
                get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_isFavorite", {
                get: $util.oneOfGetter($oneOfFields = ["isFavorite"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_deviceIdHint", {
                get: $util.oneOfGetter($oneOfFields = ["deviceIdHint"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_isLottie", {
                get: $util.oneOfGetter($oneOfFields = ["isLottie"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_imageHash", {
                get: $util.oneOfGetter($oneOfFields = ["imageHash"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(StickerAction.prototype, "_isAvatarSticker", {
                get: $util.oneOfGetter($oneOfFields = ["isAvatarSticker"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            StickerAction.create = function create(properties) {
                return new StickerAction(properties);
            };

            StickerAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    w.uint32(10).string(m.url);
                if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
                    w.uint32(18).bytes(m.fileEncSha256);
                if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
                    w.uint32(26).bytes(m.mediaKey);
                if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
                    w.uint32(34).string(m.mimetype);
                if (m.height != null && Object.hasOwnProperty.call(m, "height"))
                    w.uint32(40).uint32(m.height);
                if (m.width != null && Object.hasOwnProperty.call(m, "width"))
                    w.uint32(48).uint32(m.width);
                if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
                    w.uint32(58).string(m.directPath);
                if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
                    w.uint32(64).uint64(m.fileLength);
                if (m.isFavorite != null && Object.hasOwnProperty.call(m, "isFavorite"))
                    w.uint32(72).bool(m.isFavorite);
                if (m.deviceIdHint != null && Object.hasOwnProperty.call(m, "deviceIdHint"))
                    w.uint32(80).uint32(m.deviceIdHint);
                if (m.isLottie != null && Object.hasOwnProperty.call(m, "isLottie"))
                    w.uint32(88).bool(m.isLottie);
                if (m.imageHash != null && Object.hasOwnProperty.call(m, "imageHash"))
                    w.uint32(98).string(m.imageHash);
                if (m.isAvatarSticker != null && Object.hasOwnProperty.call(m, "isAvatarSticker"))
                    w.uint32(104).bool(m.isAvatarSticker);
                return w;
            };

            StickerAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.StickerAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.url = r.string();
                            break;
                        }
                    case 2: {
                            m.fileEncSha256 = r.bytes();
                            break;
                        }
                    case 3: {
                            m.mediaKey = r.bytes();
                            break;
                        }
                    case 4: {
                            m.mimetype = r.string();
                            break;
                        }
                    case 5: {
                            m.height = r.uint32();
                            break;
                        }
                    case 6: {
                            m.width = r.uint32();
                            break;
                        }
                    case 7: {
                            m.directPath = r.string();
                            break;
                        }
                    case 8: {
                            m.fileLength = r.uint64();
                            break;
                        }
                    case 9: {
                            m.isFavorite = r.bool();
                            break;
                        }
                    case 10: {
                            m.deviceIdHint = r.uint32();
                            break;
                        }
                    case 11: {
                            m.isLottie = r.bool();
                            break;
                        }
                    case 12: {
                            m.imageHash = r.string();
                            break;
                        }
                    case 13: {
                            m.isAvatarSticker = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            StickerAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.StickerAction)
                    return d;
                var m = new $root.proto.SyncActionValue.StickerAction();
                if (d.url != null) {
                    m.url = String(d.url);
                }
                if (d.fileEncSha256 != null) {
                    if (typeof d.fileEncSha256 === "string")
                        $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
                    else if (d.fileEncSha256.length >= 0)
                        m.fileEncSha256 = d.fileEncSha256;
                }
                if (d.mediaKey != null) {
                    if (typeof d.mediaKey === "string")
                        $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
                    else if (d.mediaKey.length >= 0)
                        m.mediaKey = d.mediaKey;
                }
                if (d.mimetype != null) {
                    m.mimetype = String(d.mimetype);
                }
                if (d.height != null) {
                    m.height = d.height >>> 0;
                }
                if (d.width != null) {
                    m.width = d.width >>> 0;
                }
                if (d.directPath != null) {
                    m.directPath = String(d.directPath);
                }
                if (d.fileLength != null) {
                    if ($util.Long)
                        (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
                    else if (typeof d.fileLength === "string")
                        m.fileLength = parseInt(d.fileLength, 10);
                    else if (typeof d.fileLength === "number")
                        m.fileLength = d.fileLength;
                    else if (typeof d.fileLength === "object")
                        m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
                }
                if (d.isFavorite != null) {
                    m.isFavorite = Boolean(d.isFavorite);
                }
                if (d.deviceIdHint != null) {
                    m.deviceIdHint = d.deviceIdHint >>> 0;
                }
                if (d.isLottie != null) {
                    m.isLottie = Boolean(d.isLottie);
                }
                if (d.imageHash != null) {
                    m.imageHash = String(d.imageHash);
                }
                if (d.isAvatarSticker != null) {
                    m.isAvatarSticker = Boolean(d.isAvatarSticker);
                }
                return m;
            };

            StickerAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = m.url;
                    if (o.oneofs)
                        d._url = "url";
                }
                if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
                    d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
                    if (o.oneofs)
                        d._fileEncSha256 = "fileEncSha256";
                }
                if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
                    d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
                    if (o.oneofs)
                        d._mediaKey = "mediaKey";
                }
                if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
                    d.mimetype = m.mimetype;
                    if (o.oneofs)
                        d._mimetype = "mimetype";
                }
                if (m.height != null && m.hasOwnProperty("height")) {
                    d.height = m.height;
                    if (o.oneofs)
                        d._height = "height";
                }
                if (m.width != null && m.hasOwnProperty("width")) {
                    d.width = m.width;
                    if (o.oneofs)
                        d._width = "width";
                }
                if (m.directPath != null && m.hasOwnProperty("directPath")) {
                    d.directPath = m.directPath;
                    if (o.oneofs)
                        d._directPath = "directPath";
                }
                if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
                    if (typeof m.fileLength === "number")
                        d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
                    else
                        d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
                    if (o.oneofs)
                        d._fileLength = "fileLength";
                }
                if (m.isFavorite != null && m.hasOwnProperty("isFavorite")) {
                    d.isFavorite = m.isFavorite;
                    if (o.oneofs)
                        d._isFavorite = "isFavorite";
                }
                if (m.deviceIdHint != null && m.hasOwnProperty("deviceIdHint")) {
                    d.deviceIdHint = m.deviceIdHint;
                    if (o.oneofs)
                        d._deviceIdHint = "deviceIdHint";
                }
                if (m.isLottie != null && m.hasOwnProperty("isLottie")) {
                    d.isLottie = m.isLottie;
                    if (o.oneofs)
                        d._isLottie = "isLottie";
                }
                if (m.imageHash != null && m.hasOwnProperty("imageHash")) {
                    d.imageHash = m.imageHash;
                    if (o.oneofs)
                        d._imageHash = "imageHash";
                }
                if (m.isAvatarSticker != null && m.hasOwnProperty("isAvatarSticker")) {
                    d.isAvatarSticker = m.isAvatarSticker;
                    if (o.oneofs)
                        d._isAvatarSticker = "isAvatarSticker";
                }
                return d;
            };

            StickerAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            StickerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.StickerAction";
            };

            return StickerAction;
        })();

        SyncActionValue.SubscriptionAction = (function() {

            function SubscriptionAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SubscriptionAction.prototype.isDeactivated = null;
            SubscriptionAction.prototype.isAutoRenewing = null;
            SubscriptionAction.prototype.expirationDate = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SubscriptionAction.prototype, "_isDeactivated", {
                get: $util.oneOfGetter($oneOfFields = ["isDeactivated"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SubscriptionAction.prototype, "_isAutoRenewing", {
                get: $util.oneOfGetter($oneOfFields = ["isAutoRenewing"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SubscriptionAction.prototype, "_expirationDate", {
                get: $util.oneOfGetter($oneOfFields = ["expirationDate"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SubscriptionAction.create = function create(properties) {
                return new SubscriptionAction(properties);
            };

            SubscriptionAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isDeactivated != null && Object.hasOwnProperty.call(m, "isDeactivated"))
                    w.uint32(8).bool(m.isDeactivated);
                if (m.isAutoRenewing != null && Object.hasOwnProperty.call(m, "isAutoRenewing"))
                    w.uint32(16).bool(m.isAutoRenewing);
                if (m.expirationDate != null && Object.hasOwnProperty.call(m, "expirationDate"))
                    w.uint32(24).int64(m.expirationDate);
                return w;
            };

            SubscriptionAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.SubscriptionAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isDeactivated = r.bool();
                            break;
                        }
                    case 2: {
                            m.isAutoRenewing = r.bool();
                            break;
                        }
                    case 3: {
                            m.expirationDate = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SubscriptionAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.SubscriptionAction)
                    return d;
                var m = new $root.proto.SyncActionValue.SubscriptionAction();
                if (d.isDeactivated != null) {
                    m.isDeactivated = Boolean(d.isDeactivated);
                }
                if (d.isAutoRenewing != null) {
                    m.isAutoRenewing = Boolean(d.isAutoRenewing);
                }
                if (d.expirationDate != null) {
                    if ($util.Long)
                        (m.expirationDate = $util.Long.fromValue(d.expirationDate)).unsigned = false;
                    else if (typeof d.expirationDate === "string")
                        m.expirationDate = parseInt(d.expirationDate, 10);
                    else if (typeof d.expirationDate === "number")
                        m.expirationDate = d.expirationDate;
                    else if (typeof d.expirationDate === "object")
                        m.expirationDate = new $util.LongBits(d.expirationDate.low >>> 0, d.expirationDate.high >>> 0).toNumber();
                }
                return m;
            };

            SubscriptionAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isDeactivated != null && m.hasOwnProperty("isDeactivated")) {
                    d.isDeactivated = m.isDeactivated;
                    if (o.oneofs)
                        d._isDeactivated = "isDeactivated";
                }
                if (m.isAutoRenewing != null && m.hasOwnProperty("isAutoRenewing")) {
                    d.isAutoRenewing = m.isAutoRenewing;
                    if (o.oneofs)
                        d._isAutoRenewing = "isAutoRenewing";
                }
                if (m.expirationDate != null && m.hasOwnProperty("expirationDate")) {
                    if (typeof m.expirationDate === "number")
                        d.expirationDate = o.longs === String ? String(m.expirationDate) : m.expirationDate;
                    else
                        d.expirationDate = o.longs === String ? longToString(m.expirationDate) : o.longs === Number ? longToNumber(m.expirationDate) : m.expirationDate;
                    if (o.oneofs)
                        d._expirationDate = "expirationDate";
                }
                return d;
            };

            SubscriptionAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SubscriptionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.SubscriptionAction";
            };

            return SubscriptionAction;
        })();

        SyncActionValue.SyncActionMessage = (function() {

            function SyncActionMessage(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SyncActionMessage.prototype.key = null;
            SyncActionMessage.prototype.timestamp = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SyncActionMessage.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SyncActionMessage.prototype, "_timestamp", {
                get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SyncActionMessage.create = function create(properties) {
                return new SyncActionMessage(properties);
            };

            SyncActionMessage.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
                if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                    w.uint32(16).int64(m.timestamp);
                return w;
            };

            SyncActionMessage.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.SyncActionMessage();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = $root.proto.MessageKey.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.timestamp = r.int64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SyncActionMessage.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.SyncActionMessage)
                    return d;
                var m = new $root.proto.SyncActionValue.SyncActionMessage();
                if (d.key != null) {
                    if (typeof d.key !== "object")
                        throw TypeError(".proto.SyncActionValue.SyncActionMessage.key: object expected");
                    m.key = $root.proto.MessageKey.fromObject(d.key);
                }
                if (d.timestamp != null) {
                    if ($util.Long)
                        (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false;
                    else if (typeof d.timestamp === "string")
                        m.timestamp = parseInt(d.timestamp, 10);
                    else if (typeof d.timestamp === "number")
                        m.timestamp = d.timestamp;
                    else if (typeof d.timestamp === "object")
                        m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber();
                }
                return m;
            };

            SyncActionMessage.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = $root.proto.MessageKey.toObject(m.key, o);
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                    if (typeof m.timestamp === "number")
                        d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                    else
                        d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp;
                    if (o.oneofs)
                        d._timestamp = "timestamp";
                }
                return d;
            };

            SyncActionMessage.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SyncActionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.SyncActionMessage";
            };

            return SyncActionMessage;
        })();

        SyncActionValue.SyncActionMessageRange = (function() {

            function SyncActionMessageRange(p) {
                this.messages = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            SyncActionMessageRange.prototype.lastMessageTimestamp = null;
            SyncActionMessageRange.prototype.lastSystemMessageTimestamp = null;
            SyncActionMessageRange.prototype.messages = $util.emptyArray;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SyncActionMessageRange.prototype, "_lastMessageTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["lastMessageTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(SyncActionMessageRange.prototype, "_lastSystemMessageTimestamp", {
                get: $util.oneOfGetter($oneOfFields = ["lastSystemMessageTimestamp"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            SyncActionMessageRange.create = function create(properties) {
                return new SyncActionMessageRange(properties);
            };

            SyncActionMessageRange.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.lastMessageTimestamp != null && Object.hasOwnProperty.call(m, "lastMessageTimestamp"))
                    w.uint32(8).int64(m.lastMessageTimestamp);
                if (m.lastSystemMessageTimestamp != null && Object.hasOwnProperty.call(m, "lastSystemMessageTimestamp"))
                    w.uint32(16).int64(m.lastSystemMessageTimestamp);
                if (m.messages != null && m.messages.length) {
                    for (var i = 0; i < m.messages.length; ++i)
                        $root.proto.SyncActionValue.SyncActionMessage.encode(m.messages[i], w.uint32(26).fork()).ldelim();
                }
                return w;
            };

            SyncActionMessageRange.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.SyncActionMessageRange();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.lastMessageTimestamp = r.int64();
                            break;
                        }
                    case 2: {
                            m.lastSystemMessageTimestamp = r.int64();
                            break;
                        }
                    case 3: {
                            if (!(m.messages && m.messages.length))
                                m.messages = [];
                            m.messages.push($root.proto.SyncActionValue.SyncActionMessage.decode(r, r.uint32()));
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            SyncActionMessageRange.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.SyncActionMessageRange)
                    return d;
                var m = new $root.proto.SyncActionValue.SyncActionMessageRange();
                if (d.lastMessageTimestamp != null) {
                    if ($util.Long)
                        (m.lastMessageTimestamp = $util.Long.fromValue(d.lastMessageTimestamp)).unsigned = false;
                    else if (typeof d.lastMessageTimestamp === "string")
                        m.lastMessageTimestamp = parseInt(d.lastMessageTimestamp, 10);
                    else if (typeof d.lastMessageTimestamp === "number")
                        m.lastMessageTimestamp = d.lastMessageTimestamp;
                    else if (typeof d.lastMessageTimestamp === "object")
                        m.lastMessageTimestamp = new $util.LongBits(d.lastMessageTimestamp.low >>> 0, d.lastMessageTimestamp.high >>> 0).toNumber();
                }
                if (d.lastSystemMessageTimestamp != null) {
                    if ($util.Long)
                        (m.lastSystemMessageTimestamp = $util.Long.fromValue(d.lastSystemMessageTimestamp)).unsigned = false;
                    else if (typeof d.lastSystemMessageTimestamp === "string")
                        m.lastSystemMessageTimestamp = parseInt(d.lastSystemMessageTimestamp, 10);
                    else if (typeof d.lastSystemMessageTimestamp === "number")
                        m.lastSystemMessageTimestamp = d.lastSystemMessageTimestamp;
                    else if (typeof d.lastSystemMessageTimestamp === "object")
                        m.lastSystemMessageTimestamp = new $util.LongBits(d.lastSystemMessageTimestamp.low >>> 0, d.lastSystemMessageTimestamp.high >>> 0).toNumber();
                }
                if (d.messages) {
                    if (!Array.isArray(d.messages))
                        throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: array expected");
                    m.messages = [];
                    for (var i = 0; i < d.messages.length; ++i) {
                        if (typeof d.messages[i] !== "object")
                            throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: object expected");
                        m.messages[i] = $root.proto.SyncActionValue.SyncActionMessage.fromObject(d.messages[i]);
                    }
                }
                return m;
            };

            SyncActionMessageRange.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.messages = [];
                }
                if (m.lastMessageTimestamp != null && m.hasOwnProperty("lastMessageTimestamp")) {
                    if (typeof m.lastMessageTimestamp === "number")
                        d.lastMessageTimestamp = o.longs === String ? String(m.lastMessageTimestamp) : m.lastMessageTimestamp;
                    else
                        d.lastMessageTimestamp = o.longs === String ? longToString(m.lastMessageTimestamp) : o.longs === Number ? longToNumber(m.lastMessageTimestamp) : m.lastMessageTimestamp;
                    if (o.oneofs)
                        d._lastMessageTimestamp = "lastMessageTimestamp";
                }
                if (m.lastSystemMessageTimestamp != null && m.hasOwnProperty("lastSystemMessageTimestamp")) {
                    if (typeof m.lastSystemMessageTimestamp === "number")
                        d.lastSystemMessageTimestamp = o.longs === String ? String(m.lastSystemMessageTimestamp) : m.lastSystemMessageTimestamp;
                    else
                        d.lastSystemMessageTimestamp = o.longs === String ? longToString(m.lastSystemMessageTimestamp) : o.longs === Number ? longToNumber(m.lastSystemMessageTimestamp) : m.lastSystemMessageTimestamp;
                    if (o.oneofs)
                        d._lastSystemMessageTimestamp = "lastSystemMessageTimestamp";
                }
                if (m.messages && m.messages.length) {
                    d.messages = [];
                    for (var j = 0; j < m.messages.length; ++j) {
                        d.messages[j] = $root.proto.SyncActionValue.SyncActionMessage.toObject(m.messages[j], o);
                    }
                }
                return d;
            };

            SyncActionMessageRange.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            SyncActionMessageRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.SyncActionMessageRange";
            };

            return SyncActionMessageRange;
        })();

        SyncActionValue.TimeFormatAction = (function() {

            function TimeFormatAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            TimeFormatAction.prototype.isTwentyFourHourFormatEnabled = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TimeFormatAction.prototype, "_isTwentyFourHourFormatEnabled", {
                get: $util.oneOfGetter($oneOfFields = ["isTwentyFourHourFormatEnabled"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            TimeFormatAction.create = function create(properties) {
                return new TimeFormatAction(properties);
            };

            TimeFormatAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.isTwentyFourHourFormatEnabled != null && Object.hasOwnProperty.call(m, "isTwentyFourHourFormatEnabled"))
                    w.uint32(8).bool(m.isTwentyFourHourFormatEnabled);
                return w;
            };

            TimeFormatAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.TimeFormatAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.isTwentyFourHourFormatEnabled = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            TimeFormatAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.TimeFormatAction)
                    return d;
                var m = new $root.proto.SyncActionValue.TimeFormatAction();
                if (d.isTwentyFourHourFormatEnabled != null) {
                    m.isTwentyFourHourFormatEnabled = Boolean(d.isTwentyFourHourFormatEnabled);
                }
                return m;
            };

            TimeFormatAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.isTwentyFourHourFormatEnabled != null && m.hasOwnProperty("isTwentyFourHourFormatEnabled")) {
                    d.isTwentyFourHourFormatEnabled = m.isTwentyFourHourFormatEnabled;
                    if (o.oneofs)
                        d._isTwentyFourHourFormatEnabled = "isTwentyFourHourFormatEnabled";
                }
                return d;
            };

            TimeFormatAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            TimeFormatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.TimeFormatAction";
            };

            return TimeFormatAction;
        })();

        SyncActionValue.UGCBot = (function() {

            function UGCBot(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            UGCBot.prototype.definition = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UGCBot.prototype, "_definition", {
                get: $util.oneOfGetter($oneOfFields = ["definition"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            UGCBot.create = function create(properties) {
                return new UGCBot(properties);
            };

            UGCBot.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.definition != null && Object.hasOwnProperty.call(m, "definition"))
                    w.uint32(10).bytes(m.definition);
                return w;
            };

            UGCBot.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.UGCBot();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.definition = r.bytes();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            UGCBot.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.UGCBot)
                    return d;
                var m = new $root.proto.SyncActionValue.UGCBot();
                if (d.definition != null) {
                    if (typeof d.definition === "string")
                        $util.base64.decode(d.definition, m.definition = $util.newBuffer($util.base64.length(d.definition)), 0);
                    else if (d.definition.length >= 0)
                        m.definition = d.definition;
                }
                return m;
            };

            UGCBot.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.definition != null && m.hasOwnProperty("definition")) {
                    d.definition = o.bytes === String ? $util.base64.encode(m.definition, 0, m.definition.length) : o.bytes === Array ? Array.prototype.slice.call(m.definition) : m.definition;
                    if (o.oneofs)
                        d._definition = "definition";
                }
                return d;
            };

            UGCBot.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            UGCBot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.UGCBot";
            };

            return UGCBot;
        })();

        SyncActionValue.UnarchiveChatsSetting = (function() {

            function UnarchiveChatsSetting(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            UnarchiveChatsSetting.prototype.unarchiveChats = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UnarchiveChatsSetting.prototype, "_unarchiveChats", {
                get: $util.oneOfGetter($oneOfFields = ["unarchiveChats"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            UnarchiveChatsSetting.create = function create(properties) {
                return new UnarchiveChatsSetting(properties);
            };

            UnarchiveChatsSetting.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.unarchiveChats != null && Object.hasOwnProperty.call(m, "unarchiveChats"))
                    w.uint32(8).bool(m.unarchiveChats);
                return w;
            };

            UnarchiveChatsSetting.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.UnarchiveChatsSetting();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.unarchiveChats = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            UnarchiveChatsSetting.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.UnarchiveChatsSetting)
                    return d;
                var m = new $root.proto.SyncActionValue.UnarchiveChatsSetting();
                if (d.unarchiveChats != null) {
                    m.unarchiveChats = Boolean(d.unarchiveChats);
                }
                return m;
            };

            UnarchiveChatsSetting.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.unarchiveChats != null && m.hasOwnProperty("unarchiveChats")) {
                    d.unarchiveChats = m.unarchiveChats;
                    if (o.oneofs)
                        d._unarchiveChats = "unarchiveChats";
                }
                return d;
            };

            UnarchiveChatsSetting.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            UnarchiveChatsSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.UnarchiveChatsSetting";
            };

            return UnarchiveChatsSetting;
        })();

        SyncActionValue.UserStatusMuteAction = (function() {

            function UserStatusMuteAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            UserStatusMuteAction.prototype.muted = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UserStatusMuteAction.prototype, "_muted", {
                get: $util.oneOfGetter($oneOfFields = ["muted"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            UserStatusMuteAction.create = function create(properties) {
                return new UserStatusMuteAction(properties);
            };

            UserStatusMuteAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.muted != null && Object.hasOwnProperty.call(m, "muted"))
                    w.uint32(8).bool(m.muted);
                return w;
            };

            UserStatusMuteAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.UserStatusMuteAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.muted = r.bool();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            UserStatusMuteAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.UserStatusMuteAction)
                    return d;
                var m = new $root.proto.SyncActionValue.UserStatusMuteAction();
                if (d.muted != null) {
                    m.muted = Boolean(d.muted);
                }
                return m;
            };

            UserStatusMuteAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.muted != null && m.hasOwnProperty("muted")) {
                    d.muted = m.muted;
                    if (o.oneofs)
                        d._muted = "muted";
                }
                return d;
            };

            UserStatusMuteAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            UserStatusMuteAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.UserStatusMuteAction";
            };

            return UserStatusMuteAction;
        })();

        SyncActionValue.UsernameChatStartModeAction = (function() {

            function UsernameChatStartModeAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            UsernameChatStartModeAction.prototype.chatStartMode = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UsernameChatStartModeAction.prototype, "_chatStartMode", {
                get: $util.oneOfGetter($oneOfFields = ["chatStartMode"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            UsernameChatStartModeAction.create = function create(properties) {
                return new UsernameChatStartModeAction(properties);
            };

            UsernameChatStartModeAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.chatStartMode != null && Object.hasOwnProperty.call(m, "chatStartMode"))
                    w.uint32(8).int32(m.chatStartMode);
                return w;
            };

            UsernameChatStartModeAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.UsernameChatStartModeAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.chatStartMode = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            UsernameChatStartModeAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.UsernameChatStartModeAction)
                    return d;
                var m = new $root.proto.SyncActionValue.UsernameChatStartModeAction();
                switch (d.chatStartMode) {
                default:
                    if (typeof d.chatStartMode === "number") {
                        m.chatStartMode = d.chatStartMode;
                        break;
                    }
                    break;
                case "LID":
                case 1:
                    m.chatStartMode = 1;
                    break;
                case "PN":
                case 2:
                    m.chatStartMode = 2;
                    break;
                }
                return m;
            };

            UsernameChatStartModeAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.chatStartMode != null && m.hasOwnProperty("chatStartMode")) {
                    d.chatStartMode = o.enums === String ? $root.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[m.chatStartMode] === undefined ? m.chatStartMode : $root.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[m.chatStartMode] : m.chatStartMode;
                    if (o.oneofs)
                        d._chatStartMode = "chatStartMode";
                }
                return d;
            };

            UsernameChatStartModeAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            UsernameChatStartModeAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.UsernameChatStartModeAction";
            };

            UsernameChatStartModeAction.ChatStartMode = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[1] = "LID"] = 1;
                values[valuesById[2] = "PN"] = 2;
                return values;
            })();

            return UsernameChatStartModeAction;
        })();

        SyncActionValue.WaffleAccountLinkStateAction = (function() {

            function WaffleAccountLinkStateAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            WaffleAccountLinkStateAction.prototype.linkState = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(WaffleAccountLinkStateAction.prototype, "_linkState", {
                get: $util.oneOfGetter($oneOfFields = ["linkState"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            WaffleAccountLinkStateAction.create = function create(properties) {
                return new WaffleAccountLinkStateAction(properties);
            };

            WaffleAccountLinkStateAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.linkState != null && Object.hasOwnProperty.call(m, "linkState"))
                    w.uint32(16).int32(m.linkState);
                return w;
            };

            WaffleAccountLinkStateAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.WaffleAccountLinkStateAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 2: {
                            m.linkState = r.int32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            WaffleAccountLinkStateAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.WaffleAccountLinkStateAction)
                    return d;
                var m = new $root.proto.SyncActionValue.WaffleAccountLinkStateAction();
                switch (d.linkState) {
                default:
                    if (typeof d.linkState === "number") {
                        m.linkState = d.linkState;
                        break;
                    }
                    break;
                case "ACTIVE":
                case 0:
                    m.linkState = 0;
                    break;
                case "PAUSED":
                case 1:
                    m.linkState = 1;
                    break;
                case "UNLINKED":
                case 2:
                    m.linkState = 2;
                    break;
                }
                return m;
            };

            WaffleAccountLinkStateAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.linkState != null && m.hasOwnProperty("linkState")) {
                    d.linkState = o.enums === String ? $root.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[m.linkState] === undefined ? m.linkState : $root.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[m.linkState] : m.linkState;
                    if (o.oneofs)
                        d._linkState = "linkState";
                }
                return d;
            };

            WaffleAccountLinkStateAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            WaffleAccountLinkStateAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.WaffleAccountLinkStateAction";
            };

            WaffleAccountLinkStateAction.AccountLinkState = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "ACTIVE"] = 0;
                values[valuesById[1] = "PAUSED"] = 1;
                values[valuesById[2] = "UNLINKED"] = 2;
                return values;
            })();

            return WaffleAccountLinkStateAction;
        })();

        SyncActionValue.WamoUserIdentifierAction = (function() {

            function WamoUserIdentifierAction(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            WamoUserIdentifierAction.prototype.identifier = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(WamoUserIdentifierAction.prototype, "_identifier", {
                get: $util.oneOfGetter($oneOfFields = ["identifier"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            WamoUserIdentifierAction.create = function create(properties) {
                return new WamoUserIdentifierAction(properties);
            };

            WamoUserIdentifierAction.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.identifier != null && Object.hasOwnProperty.call(m, "identifier"))
                    w.uint32(10).string(m.identifier);
                return w;
            };

            WamoUserIdentifierAction.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.WamoUserIdentifierAction();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.identifier = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            WamoUserIdentifierAction.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.SyncActionValue.WamoUserIdentifierAction)
                    return d;
                var m = new $root.proto.SyncActionValue.WamoUserIdentifierAction();
                if (d.identifier != null) {
                    m.identifier = String(d.identifier);
                }
                return m;
            };

            WamoUserIdentifierAction.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.identifier != null && m.hasOwnProperty("identifier")) {
                    d.identifier = m.identifier;
                    if (o.oneofs)
                        d._identifier = "identifier";
                }
                return d;
            };

            WamoUserIdentifierAction.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            WamoUserIdentifierAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.SyncActionValue.WamoUserIdentifierAction";
            };

            return WamoUserIdentifierAction;
        })();

        return SyncActionValue;
    })();

    proto.SyncdIndex = (function() {

        function SyncdIndex(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncdIndex.prototype.blob = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdIndex.prototype, "_blob", {
            get: $util.oneOfGetter($oneOfFields = ["blob"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncdIndex.create = function create(properties) {
            return new SyncdIndex(properties);
        };

        SyncdIndex.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.blob != null && Object.hasOwnProperty.call(m, "blob"))
                w.uint32(10).bytes(m.blob);
            return w;
        };

        SyncdIndex.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncdIndex();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.blob = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncdIndex.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncdIndex)
                return d;
            var m = new $root.proto.SyncdIndex();
            if (d.blob != null) {
                if (typeof d.blob === "string")
                    $util.base64.decode(d.blob, m.blob = $util.newBuffer($util.base64.length(d.blob)), 0);
                else if (d.blob.length >= 0)
                    m.blob = d.blob;
            }
            return m;
        };

        SyncdIndex.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.blob != null && m.hasOwnProperty("blob")) {
                d.blob = o.bytes === String ? $util.base64.encode(m.blob, 0, m.blob.length) : o.bytes === Array ? Array.prototype.slice.call(m.blob) : m.blob;
                if (o.oneofs)
                    d._blob = "blob";
            }
            return d;
        };

        SyncdIndex.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncdIndex.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncdIndex";
        };

        return SyncdIndex;
    })();

    proto.SyncdMutation = (function() {

        function SyncdMutation(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncdMutation.prototype.operation = null;
        SyncdMutation.prototype.record = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdMutation.prototype, "_operation", {
            get: $util.oneOfGetter($oneOfFields = ["operation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdMutation.prototype, "_record", {
            get: $util.oneOfGetter($oneOfFields = ["record"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncdMutation.create = function create(properties) {
            return new SyncdMutation(properties);
        };

        SyncdMutation.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.operation != null && Object.hasOwnProperty.call(m, "operation"))
                w.uint32(8).int32(m.operation);
            if (m.record != null && Object.hasOwnProperty.call(m, "record"))
                $root.proto.SyncdRecord.encode(m.record, w.uint32(18).fork()).ldelim();
            return w;
        };

        SyncdMutation.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncdMutation();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.operation = r.int32();
                        break;
                    }
                case 2: {
                        m.record = $root.proto.SyncdRecord.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncdMutation.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncdMutation)
                return d;
            var m = new $root.proto.SyncdMutation();
            switch (d.operation) {
            default:
                if (typeof d.operation === "number") {
                    m.operation = d.operation;
                    break;
                }
                break;
            case "SET":
            case 0:
                m.operation = 0;
                break;
            case "REMOVE":
            case 1:
                m.operation = 1;
                break;
            }
            if (d.record != null) {
                if (typeof d.record !== "object")
                    throw TypeError(".proto.SyncdMutation.record: object expected");
                m.record = $root.proto.SyncdRecord.fromObject(d.record);
            }
            return m;
        };

        SyncdMutation.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.operation != null && m.hasOwnProperty("operation")) {
                d.operation = o.enums === String ? $root.proto.SyncdMutation.SyncdOperation[m.operation] === undefined ? m.operation : $root.proto.SyncdMutation.SyncdOperation[m.operation] : m.operation;
                if (o.oneofs)
                    d._operation = "operation";
            }
            if (m.record != null && m.hasOwnProperty("record")) {
                d.record = $root.proto.SyncdRecord.toObject(m.record, o);
                if (o.oneofs)
                    d._record = "record";
            }
            return d;
        };

        SyncdMutation.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncdMutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncdMutation";
        };

        SyncdMutation.SyncdOperation = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "SET"] = 0;
            values[valuesById[1] = "REMOVE"] = 1;
            return values;
        })();

        return SyncdMutation;
    })();

    proto.SyncdMutations = (function() {

        function SyncdMutations(p) {
            this.mutations = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncdMutations.prototype.mutations = $util.emptyArray;

        SyncdMutations.create = function create(properties) {
            return new SyncdMutations(properties);
        };

        SyncdMutations.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.mutations != null && m.mutations.length) {
                for (var i = 0; i < m.mutations.length; ++i)
                    $root.proto.SyncdMutation.encode(m.mutations[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        SyncdMutations.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncdMutations();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.mutations && m.mutations.length))
                            m.mutations = [];
                        m.mutations.push($root.proto.SyncdMutation.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncdMutations.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncdMutations)
                return d;
            var m = new $root.proto.SyncdMutations();
            if (d.mutations) {
                if (!Array.isArray(d.mutations))
                    throw TypeError(".proto.SyncdMutations.mutations: array expected");
                m.mutations = [];
                for (var i = 0; i < d.mutations.length; ++i) {
                    if (typeof d.mutations[i] !== "object")
                        throw TypeError(".proto.SyncdMutations.mutations: object expected");
                    m.mutations[i] = $root.proto.SyncdMutation.fromObject(d.mutations[i]);
                }
            }
            return m;
        };

        SyncdMutations.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.mutations = [];
            }
            if (m.mutations && m.mutations.length) {
                d.mutations = [];
                for (var j = 0; j < m.mutations.length; ++j) {
                    d.mutations[j] = $root.proto.SyncdMutation.toObject(m.mutations[j], o);
                }
            }
            return d;
        };

        SyncdMutations.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncdMutations.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncdMutations";
        };

        return SyncdMutations;
    })();

    proto.SyncdPatch = (function() {

        function SyncdPatch(p) {
            this.mutations = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncdPatch.prototype.version = null;
        SyncdPatch.prototype.mutations = $util.emptyArray;
        SyncdPatch.prototype.externalMutations = null;
        SyncdPatch.prototype.snapshotMac = null;
        SyncdPatch.prototype.patchMac = null;
        SyncdPatch.prototype.keyId = null;
        SyncdPatch.prototype.exitCode = null;
        SyncdPatch.prototype.deviceIndex = null;
        SyncdPatch.prototype.clientDebugData = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdPatch.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdPatch.prototype, "_externalMutations", {
            get: $util.oneOfGetter($oneOfFields = ["externalMutations"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdPatch.prototype, "_snapshotMac", {
            get: $util.oneOfGetter($oneOfFields = ["snapshotMac"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdPatch.prototype, "_patchMac", {
            get: $util.oneOfGetter($oneOfFields = ["patchMac"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdPatch.prototype, "_keyId", {
            get: $util.oneOfGetter($oneOfFields = ["keyId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdPatch.prototype, "_exitCode", {
            get: $util.oneOfGetter($oneOfFields = ["exitCode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdPatch.prototype, "_deviceIndex", {
            get: $util.oneOfGetter($oneOfFields = ["deviceIndex"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdPatch.prototype, "_clientDebugData", {
            get: $util.oneOfGetter($oneOfFields = ["clientDebugData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncdPatch.create = function create(properties) {
            return new SyncdPatch(properties);
        };

        SyncdPatch.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                $root.proto.SyncdVersion.encode(m.version, w.uint32(10).fork()).ldelim();
            if (m.mutations != null && m.mutations.length) {
                for (var i = 0; i < m.mutations.length; ++i)
                    $root.proto.SyncdMutation.encode(m.mutations[i], w.uint32(18).fork()).ldelim();
            }
            if (m.externalMutations != null && Object.hasOwnProperty.call(m, "externalMutations"))
                $root.proto.ExternalBlobReference.encode(m.externalMutations, w.uint32(26).fork()).ldelim();
            if (m.snapshotMac != null && Object.hasOwnProperty.call(m, "snapshotMac"))
                w.uint32(34).bytes(m.snapshotMac);
            if (m.patchMac != null && Object.hasOwnProperty.call(m, "patchMac"))
                w.uint32(42).bytes(m.patchMac);
            if (m.keyId != null && Object.hasOwnProperty.call(m, "keyId"))
                $root.proto.KeyId.encode(m.keyId, w.uint32(50).fork()).ldelim();
            if (m.exitCode != null && Object.hasOwnProperty.call(m, "exitCode"))
                $root.proto.ExitCode.encode(m.exitCode, w.uint32(58).fork()).ldelim();
            if (m.deviceIndex != null && Object.hasOwnProperty.call(m, "deviceIndex"))
                w.uint32(64).uint32(m.deviceIndex);
            if (m.clientDebugData != null && Object.hasOwnProperty.call(m, "clientDebugData"))
                w.uint32(74).bytes(m.clientDebugData);
            return w;
        };

        SyncdPatch.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncdPatch();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.version = $root.proto.SyncdVersion.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        if (!(m.mutations && m.mutations.length))
                            m.mutations = [];
                        m.mutations.push($root.proto.SyncdMutation.decode(r, r.uint32()));
                        break;
                    }
                case 3: {
                        m.externalMutations = $root.proto.ExternalBlobReference.decode(r, r.uint32());
                        break;
                    }
                case 4: {
                        m.snapshotMac = r.bytes();
                        break;
                    }
                case 5: {
                        m.patchMac = r.bytes();
                        break;
                    }
                case 6: {
                        m.keyId = $root.proto.KeyId.decode(r, r.uint32());
                        break;
                    }
                case 7: {
                        m.exitCode = $root.proto.ExitCode.decode(r, r.uint32());
                        break;
                    }
                case 8: {
                        m.deviceIndex = r.uint32();
                        break;
                    }
                case 9: {
                        m.clientDebugData = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncdPatch.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncdPatch)
                return d;
            var m = new $root.proto.SyncdPatch();
            if (d.version != null) {
                if (typeof d.version !== "object")
                    throw TypeError(".proto.SyncdPatch.version: object expected");
                m.version = $root.proto.SyncdVersion.fromObject(d.version);
            }
            if (d.mutations) {
                if (!Array.isArray(d.mutations))
                    throw TypeError(".proto.SyncdPatch.mutations: array expected");
                m.mutations = [];
                for (var i = 0; i < d.mutations.length; ++i) {
                    if (typeof d.mutations[i] !== "object")
                        throw TypeError(".proto.SyncdPatch.mutations: object expected");
                    m.mutations[i] = $root.proto.SyncdMutation.fromObject(d.mutations[i]);
                }
            }
            if (d.externalMutations != null) {
                if (typeof d.externalMutations !== "object")
                    throw TypeError(".proto.SyncdPatch.externalMutations: object expected");
                m.externalMutations = $root.proto.ExternalBlobReference.fromObject(d.externalMutations);
            }
            if (d.snapshotMac != null) {
                if (typeof d.snapshotMac === "string")
                    $util.base64.decode(d.snapshotMac, m.snapshotMac = $util.newBuffer($util.base64.length(d.snapshotMac)), 0);
                else if (d.snapshotMac.length >= 0)
                    m.snapshotMac = d.snapshotMac;
            }
            if (d.patchMac != null) {
                if (typeof d.patchMac === "string")
                    $util.base64.decode(d.patchMac, m.patchMac = $util.newBuffer($util.base64.length(d.patchMac)), 0);
                else if (d.patchMac.length >= 0)
                    m.patchMac = d.patchMac;
            }
            if (d.keyId != null) {
                if (typeof d.keyId !== "object")
                    throw TypeError(".proto.SyncdPatch.keyId: object expected");
                m.keyId = $root.proto.KeyId.fromObject(d.keyId);
            }
            if (d.exitCode != null) {
                if (typeof d.exitCode !== "object")
                    throw TypeError(".proto.SyncdPatch.exitCode: object expected");
                m.exitCode = $root.proto.ExitCode.fromObject(d.exitCode);
            }
            if (d.deviceIndex != null) {
                m.deviceIndex = d.deviceIndex >>> 0;
            }
            if (d.clientDebugData != null) {
                if (typeof d.clientDebugData === "string")
                    $util.base64.decode(d.clientDebugData, m.clientDebugData = $util.newBuffer($util.base64.length(d.clientDebugData)), 0);
                else if (d.clientDebugData.length >= 0)
                    m.clientDebugData = d.clientDebugData;
            }
            return m;
        };

        SyncdPatch.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.mutations = [];
            }
            if (m.version != null && m.hasOwnProperty("version")) {
                d.version = $root.proto.SyncdVersion.toObject(m.version, o);
                if (o.oneofs)
                    d._version = "version";
            }
            if (m.mutations && m.mutations.length) {
                d.mutations = [];
                for (var j = 0; j < m.mutations.length; ++j) {
                    d.mutations[j] = $root.proto.SyncdMutation.toObject(m.mutations[j], o);
                }
            }
            if (m.externalMutations != null && m.hasOwnProperty("externalMutations")) {
                d.externalMutations = $root.proto.ExternalBlobReference.toObject(m.externalMutations, o);
                if (o.oneofs)
                    d._externalMutations = "externalMutations";
            }
            if (m.snapshotMac != null && m.hasOwnProperty("snapshotMac")) {
                d.snapshotMac = o.bytes === String ? $util.base64.encode(m.snapshotMac, 0, m.snapshotMac.length) : o.bytes === Array ? Array.prototype.slice.call(m.snapshotMac) : m.snapshotMac;
                if (o.oneofs)
                    d._snapshotMac = "snapshotMac";
            }
            if (m.patchMac != null && m.hasOwnProperty("patchMac")) {
                d.patchMac = o.bytes === String ? $util.base64.encode(m.patchMac, 0, m.patchMac.length) : o.bytes === Array ? Array.prototype.slice.call(m.patchMac) : m.patchMac;
                if (o.oneofs)
                    d._patchMac = "patchMac";
            }
            if (m.keyId != null && m.hasOwnProperty("keyId")) {
                d.keyId = $root.proto.KeyId.toObject(m.keyId, o);
                if (o.oneofs)
                    d._keyId = "keyId";
            }
            if (m.exitCode != null && m.hasOwnProperty("exitCode")) {
                d.exitCode = $root.proto.ExitCode.toObject(m.exitCode, o);
                if (o.oneofs)
                    d._exitCode = "exitCode";
            }
            if (m.deviceIndex != null && m.hasOwnProperty("deviceIndex")) {
                d.deviceIndex = m.deviceIndex;
                if (o.oneofs)
                    d._deviceIndex = "deviceIndex";
            }
            if (m.clientDebugData != null && m.hasOwnProperty("clientDebugData")) {
                d.clientDebugData = o.bytes === String ? $util.base64.encode(m.clientDebugData, 0, m.clientDebugData.length) : o.bytes === Array ? Array.prototype.slice.call(m.clientDebugData) : m.clientDebugData;
                if (o.oneofs)
                    d._clientDebugData = "clientDebugData";
            }
            return d;
        };

        SyncdPatch.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncdPatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncdPatch";
        };

        return SyncdPatch;
    })();

    proto.SyncdRecord = (function() {

        function SyncdRecord(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncdRecord.prototype.index = null;
        SyncdRecord.prototype.value = null;
        SyncdRecord.prototype.keyId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdRecord.prototype, "_index", {
            get: $util.oneOfGetter($oneOfFields = ["index"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdRecord.prototype, "_value", {
            get: $util.oneOfGetter($oneOfFields = ["value"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdRecord.prototype, "_keyId", {
            get: $util.oneOfGetter($oneOfFields = ["keyId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncdRecord.create = function create(properties) {
            return new SyncdRecord(properties);
        };

        SyncdRecord.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.index != null && Object.hasOwnProperty.call(m, "index"))
                $root.proto.SyncdIndex.encode(m.index, w.uint32(10).fork()).ldelim();
            if (m.value != null && Object.hasOwnProperty.call(m, "value"))
                $root.proto.SyncdValue.encode(m.value, w.uint32(18).fork()).ldelim();
            if (m.keyId != null && Object.hasOwnProperty.call(m, "keyId"))
                $root.proto.KeyId.encode(m.keyId, w.uint32(26).fork()).ldelim();
            return w;
        };

        SyncdRecord.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncdRecord();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.index = $root.proto.SyncdIndex.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.value = $root.proto.SyncdValue.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.keyId = $root.proto.KeyId.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncdRecord.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncdRecord)
                return d;
            var m = new $root.proto.SyncdRecord();
            if (d.index != null) {
                if (typeof d.index !== "object")
                    throw TypeError(".proto.SyncdRecord.index: object expected");
                m.index = $root.proto.SyncdIndex.fromObject(d.index);
            }
            if (d.value != null) {
                if (typeof d.value !== "object")
                    throw TypeError(".proto.SyncdRecord.value: object expected");
                m.value = $root.proto.SyncdValue.fromObject(d.value);
            }
            if (d.keyId != null) {
                if (typeof d.keyId !== "object")
                    throw TypeError(".proto.SyncdRecord.keyId: object expected");
                m.keyId = $root.proto.KeyId.fromObject(d.keyId);
            }
            return m;
        };

        SyncdRecord.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.index != null && m.hasOwnProperty("index")) {
                d.index = $root.proto.SyncdIndex.toObject(m.index, o);
                if (o.oneofs)
                    d._index = "index";
            }
            if (m.value != null && m.hasOwnProperty("value")) {
                d.value = $root.proto.SyncdValue.toObject(m.value, o);
                if (o.oneofs)
                    d._value = "value";
            }
            if (m.keyId != null && m.hasOwnProperty("keyId")) {
                d.keyId = $root.proto.KeyId.toObject(m.keyId, o);
                if (o.oneofs)
                    d._keyId = "keyId";
            }
            return d;
        };

        SyncdRecord.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncdRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncdRecord";
        };

        return SyncdRecord;
    })();

    proto.SyncdSnapshot = (function() {

        function SyncdSnapshot(p) {
            this.records = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncdSnapshot.prototype.version = null;
        SyncdSnapshot.prototype.records = $util.emptyArray;
        SyncdSnapshot.prototype.mac = null;
        SyncdSnapshot.prototype.keyId = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdSnapshot.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdSnapshot.prototype, "_mac", {
            get: $util.oneOfGetter($oneOfFields = ["mac"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdSnapshot.prototype, "_keyId", {
            get: $util.oneOfGetter($oneOfFields = ["keyId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncdSnapshot.create = function create(properties) {
            return new SyncdSnapshot(properties);
        };

        SyncdSnapshot.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                $root.proto.SyncdVersion.encode(m.version, w.uint32(10).fork()).ldelim();
            if (m.records != null && m.records.length) {
                for (var i = 0; i < m.records.length; ++i)
                    $root.proto.SyncdRecord.encode(m.records[i], w.uint32(18).fork()).ldelim();
            }
            if (m.mac != null && Object.hasOwnProperty.call(m, "mac"))
                w.uint32(26).bytes(m.mac);
            if (m.keyId != null && Object.hasOwnProperty.call(m, "keyId"))
                $root.proto.KeyId.encode(m.keyId, w.uint32(34).fork()).ldelim();
            return w;
        };

        SyncdSnapshot.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncdSnapshot();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.version = $root.proto.SyncdVersion.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        if (!(m.records && m.records.length))
                            m.records = [];
                        m.records.push($root.proto.SyncdRecord.decode(r, r.uint32()));
                        break;
                    }
                case 3: {
                        m.mac = r.bytes();
                        break;
                    }
                case 4: {
                        m.keyId = $root.proto.KeyId.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncdSnapshot.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncdSnapshot)
                return d;
            var m = new $root.proto.SyncdSnapshot();
            if (d.version != null) {
                if (typeof d.version !== "object")
                    throw TypeError(".proto.SyncdSnapshot.version: object expected");
                m.version = $root.proto.SyncdVersion.fromObject(d.version);
            }
            if (d.records) {
                if (!Array.isArray(d.records))
                    throw TypeError(".proto.SyncdSnapshot.records: array expected");
                m.records = [];
                for (var i = 0; i < d.records.length; ++i) {
                    if (typeof d.records[i] !== "object")
                        throw TypeError(".proto.SyncdSnapshot.records: object expected");
                    m.records[i] = $root.proto.SyncdRecord.fromObject(d.records[i]);
                }
            }
            if (d.mac != null) {
                if (typeof d.mac === "string")
                    $util.base64.decode(d.mac, m.mac = $util.newBuffer($util.base64.length(d.mac)), 0);
                else if (d.mac.length >= 0)
                    m.mac = d.mac;
            }
            if (d.keyId != null) {
                if (typeof d.keyId !== "object")
                    throw TypeError(".proto.SyncdSnapshot.keyId: object expected");
                m.keyId = $root.proto.KeyId.fromObject(d.keyId);
            }
            return m;
        };

        SyncdSnapshot.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.records = [];
            }
            if (m.version != null && m.hasOwnProperty("version")) {
                d.version = $root.proto.SyncdVersion.toObject(m.version, o);
                if (o.oneofs)
                    d._version = "version";
            }
            if (m.records && m.records.length) {
                d.records = [];
                for (var j = 0; j < m.records.length; ++j) {
                    d.records[j] = $root.proto.SyncdRecord.toObject(m.records[j], o);
                }
            }
            if (m.mac != null && m.hasOwnProperty("mac")) {
                d.mac = o.bytes === String ? $util.base64.encode(m.mac, 0, m.mac.length) : o.bytes === Array ? Array.prototype.slice.call(m.mac) : m.mac;
                if (o.oneofs)
                    d._mac = "mac";
            }
            if (m.keyId != null && m.hasOwnProperty("keyId")) {
                d.keyId = $root.proto.KeyId.toObject(m.keyId, o);
                if (o.oneofs)
                    d._keyId = "keyId";
            }
            return d;
        };

        SyncdSnapshot.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncdSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncdSnapshot";
        };

        return SyncdSnapshot;
    })();

    proto.SyncdValue = (function() {

        function SyncdValue(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncdValue.prototype.blob = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdValue.prototype, "_blob", {
            get: $util.oneOfGetter($oneOfFields = ["blob"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncdValue.create = function create(properties) {
            return new SyncdValue(properties);
        };

        SyncdValue.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.blob != null && Object.hasOwnProperty.call(m, "blob"))
                w.uint32(10).bytes(m.blob);
            return w;
        };

        SyncdValue.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncdValue();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.blob = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncdValue.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncdValue)
                return d;
            var m = new $root.proto.SyncdValue();
            if (d.blob != null) {
                if (typeof d.blob === "string")
                    $util.base64.decode(d.blob, m.blob = $util.newBuffer($util.base64.length(d.blob)), 0);
                else if (d.blob.length >= 0)
                    m.blob = d.blob;
            }
            return m;
        };

        SyncdValue.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.blob != null && m.hasOwnProperty("blob")) {
                d.blob = o.bytes === String ? $util.base64.encode(m.blob, 0, m.blob.length) : o.bytes === Array ? Array.prototype.slice.call(m.blob) : m.blob;
                if (o.oneofs)
                    d._blob = "blob";
            }
            return d;
        };

        SyncdValue.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncdValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncdValue";
        };

        return SyncdValue;
    })();

    proto.SyncdVersion = (function() {

        function SyncdVersion(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        SyncdVersion.prototype.version = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(SyncdVersion.prototype, "_version", {
            get: $util.oneOfGetter($oneOfFields = ["version"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        SyncdVersion.create = function create(properties) {
            return new SyncdVersion(properties);
        };

        SyncdVersion.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.version != null && Object.hasOwnProperty.call(m, "version"))
                w.uint32(8).uint64(m.version);
            return w;
        };

        SyncdVersion.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncdVersion();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.version = r.uint64();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        SyncdVersion.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.SyncdVersion)
                return d;
            var m = new $root.proto.SyncdVersion();
            if (d.version != null) {
                if ($util.Long)
                    (m.version = $util.Long.fromValue(d.version)).unsigned = true;
                else if (typeof d.version === "string")
                    m.version = parseInt(d.version, 10);
                else if (typeof d.version === "number")
                    m.version = d.version;
                else if (typeof d.version === "object")
                    m.version = new $util.LongBits(d.version.low >>> 0, d.version.high >>> 0).toNumber(true);
            }
            return m;
        };

        SyncdVersion.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.version != null && m.hasOwnProperty("version")) {
                if (typeof m.version === "number")
                    d.version = o.longs === String ? String(m.version) : m.version;
                else
                    d.version = o.longs === String ? longToString(m.version, true) : o.longs === Number ? longToNumber(m.version, true) : m.version;
                if (o.oneofs)
                    d._version = "version";
            }
            return d;
        };

        SyncdVersion.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        SyncdVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.SyncdVersion";
        };

        return SyncdVersion;
    })();

    proto.TapLinkAction = (function() {

        function TapLinkAction(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        TapLinkAction.prototype.title = null;
        TapLinkAction.prototype.tapUrl = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(TapLinkAction.prototype, "_title", {
            get: $util.oneOfGetter($oneOfFields = ["title"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(TapLinkAction.prototype, "_tapUrl", {
            get: $util.oneOfGetter($oneOfFields = ["tapUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        TapLinkAction.create = function create(properties) {
            return new TapLinkAction(properties);
        };

        TapLinkAction.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.title != null && Object.hasOwnProperty.call(m, "title"))
                w.uint32(10).string(m.title);
            if (m.tapUrl != null && Object.hasOwnProperty.call(m, "tapUrl"))
                w.uint32(18).string(m.tapUrl);
            return w;
        };

        TapLinkAction.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TapLinkAction();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.title = r.string();
                        break;
                    }
                case 2: {
                        m.tapUrl = r.string();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        TapLinkAction.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.TapLinkAction)
                return d;
            var m = new $root.proto.TapLinkAction();
            if (d.title != null) {
                m.title = String(d.title);
            }
            if (d.tapUrl != null) {
                m.tapUrl = String(d.tapUrl);
            }
            return m;
        };

        TapLinkAction.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.title != null && m.hasOwnProperty("title")) {
                d.title = m.title;
                if (o.oneofs)
                    d._title = "title";
            }
            if (m.tapUrl != null && m.hasOwnProperty("tapUrl")) {
                d.tapUrl = m.tapUrl;
                if (o.oneofs)
                    d._tapUrl = "tapUrl";
            }
            return d;
        };

        TapLinkAction.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        TapLinkAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.TapLinkAction";
        };

        return TapLinkAction;
    })();

    proto.TemplateButton = (function() {

        function TemplateButton(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        TemplateButton.prototype.index = null;
        TemplateButton.prototype.quickReplyButton = null;
        TemplateButton.prototype.urlButton = null;
        TemplateButton.prototype.callButton = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(TemplateButton.prototype, "_index", {
            get: $util.oneOfGetter($oneOfFields = ["index"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        Object.defineProperty(TemplateButton.prototype, "button", {
            get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        TemplateButton.create = function create(properties) {
            return new TemplateButton(properties);
        };

        TemplateButton.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.quickReplyButton != null && Object.hasOwnProperty.call(m, "quickReplyButton"))
                $root.proto.TemplateButton.QuickReplyButton.encode(m.quickReplyButton, w.uint32(10).fork()).ldelim();
            if (m.urlButton != null && Object.hasOwnProperty.call(m, "urlButton"))
                $root.proto.TemplateButton.URLButton.encode(m.urlButton, w.uint32(18).fork()).ldelim();
            if (m.callButton != null && Object.hasOwnProperty.call(m, "callButton"))
                $root.proto.TemplateButton.CallButton.encode(m.callButton, w.uint32(26).fork()).ldelim();
            if (m.index != null && Object.hasOwnProperty.call(m, "index"))
                w.uint32(32).uint32(m.index);
            return w;
        };

        TemplateButton.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TemplateButton();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 4: {
                        m.index = r.uint32();
                        break;
                    }
                case 1: {
                        m.quickReplyButton = $root.proto.TemplateButton.QuickReplyButton.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.urlButton = $root.proto.TemplateButton.URLButton.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.callButton = $root.proto.TemplateButton.CallButton.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        TemplateButton.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.TemplateButton)
                return d;
            var m = new $root.proto.TemplateButton();
            if (d.index != null) {
                m.index = d.index >>> 0;
            }
            if (d.quickReplyButton != null) {
                if (typeof d.quickReplyButton !== "object")
                    throw TypeError(".proto.TemplateButton.quickReplyButton: object expected");
                m.quickReplyButton = $root.proto.TemplateButton.QuickReplyButton.fromObject(d.quickReplyButton);
            }
            if (d.urlButton != null) {
                if (typeof d.urlButton !== "object")
                    throw TypeError(".proto.TemplateButton.urlButton: object expected");
                m.urlButton = $root.proto.TemplateButton.URLButton.fromObject(d.urlButton);
            }
            if (d.callButton != null) {
                if (typeof d.callButton !== "object")
                    throw TypeError(".proto.TemplateButton.callButton: object expected");
                m.callButton = $root.proto.TemplateButton.CallButton.fromObject(d.callButton);
            }
            return m;
        };

        TemplateButton.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.quickReplyButton != null && m.hasOwnProperty("quickReplyButton")) {
                d.quickReplyButton = $root.proto.TemplateButton.QuickReplyButton.toObject(m.quickReplyButton, o);
                if (o.oneofs)
                    d.button = "quickReplyButton";
            }
            if (m.urlButton != null && m.hasOwnProperty("urlButton")) {
                d.urlButton = $root.proto.TemplateButton.URLButton.toObject(m.urlButton, o);
                if (o.oneofs)
                    d.button = "urlButton";
            }
            if (m.callButton != null && m.hasOwnProperty("callButton")) {
                d.callButton = $root.proto.TemplateButton.CallButton.toObject(m.callButton, o);
                if (o.oneofs)
                    d.button = "callButton";
            }
            if (m.index != null && m.hasOwnProperty("index")) {
                d.index = m.index;
                if (o.oneofs)
                    d._index = "index";
            }
            return d;
        };

        TemplateButton.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        TemplateButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.TemplateButton";
        };

        TemplateButton.CallButton = (function() {

            function CallButton(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            CallButton.prototype.displayText = null;
            CallButton.prototype.phoneNumber = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CallButton.prototype, "_displayText", {
                get: $util.oneOfGetter($oneOfFields = ["displayText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(CallButton.prototype, "_phoneNumber", {
                get: $util.oneOfGetter($oneOfFields = ["phoneNumber"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            CallButton.create = function create(properties) {
                return new CallButton(properties);
            };

            CallButton.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayText != null && Object.hasOwnProperty.call(m, "displayText"))
                    $root.proto.Message.HighlyStructuredMessage.encode(m.displayText, w.uint32(10).fork()).ldelim();
                if (m.phoneNumber != null && Object.hasOwnProperty.call(m, "phoneNumber"))
                    $root.proto.Message.HighlyStructuredMessage.encode(m.phoneNumber, w.uint32(18).fork()).ldelim();
                return w;
            };

            CallButton.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TemplateButton.CallButton();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayText = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.phoneNumber = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            CallButton.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.TemplateButton.CallButton)
                    return d;
                var m = new $root.proto.TemplateButton.CallButton();
                if (d.displayText != null) {
                    if (typeof d.displayText !== "object")
                        throw TypeError(".proto.TemplateButton.CallButton.displayText: object expected");
                    m.displayText = $root.proto.Message.HighlyStructuredMessage.fromObject(d.displayText);
                }
                if (d.phoneNumber != null) {
                    if (typeof d.phoneNumber !== "object")
                        throw TypeError(".proto.TemplateButton.CallButton.phoneNumber: object expected");
                    m.phoneNumber = $root.proto.Message.HighlyStructuredMessage.fromObject(d.phoneNumber);
                }
                return m;
            };

            CallButton.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.displayText != null && m.hasOwnProperty("displayText")) {
                    d.displayText = $root.proto.Message.HighlyStructuredMessage.toObject(m.displayText, o);
                    if (o.oneofs)
                        d._displayText = "displayText";
                }
                if (m.phoneNumber != null && m.hasOwnProperty("phoneNumber")) {
                    d.phoneNumber = $root.proto.Message.HighlyStructuredMessage.toObject(m.phoneNumber, o);
                    if (o.oneofs)
                        d._phoneNumber = "phoneNumber";
                }
                return d;
            };

            CallButton.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            CallButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.TemplateButton.CallButton";
            };

            return CallButton;
        })();

        TemplateButton.QuickReplyButton = (function() {

            function QuickReplyButton(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            QuickReplyButton.prototype.displayText = null;
            QuickReplyButton.prototype.id = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuickReplyButton.prototype, "_displayText", {
                get: $util.oneOfGetter($oneOfFields = ["displayText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(QuickReplyButton.prototype, "_id", {
                get: $util.oneOfGetter($oneOfFields = ["id"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            QuickReplyButton.create = function create(properties) {
                return new QuickReplyButton(properties);
            };

            QuickReplyButton.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayText != null && Object.hasOwnProperty.call(m, "displayText"))
                    $root.proto.Message.HighlyStructuredMessage.encode(m.displayText, w.uint32(10).fork()).ldelim();
                if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                    w.uint32(18).string(m.id);
                return w;
            };

            QuickReplyButton.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TemplateButton.QuickReplyButton();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayText = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.id = r.string();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            QuickReplyButton.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.TemplateButton.QuickReplyButton)
                    return d;
                var m = new $root.proto.TemplateButton.QuickReplyButton();
                if (d.displayText != null) {
                    if (typeof d.displayText !== "object")
                        throw TypeError(".proto.TemplateButton.QuickReplyButton.displayText: object expected");
                    m.displayText = $root.proto.Message.HighlyStructuredMessage.fromObject(d.displayText);
                }
                if (d.id != null) {
                    m.id = String(d.id);
                }
                return m;
            };

            QuickReplyButton.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.displayText != null && m.hasOwnProperty("displayText")) {
                    d.displayText = $root.proto.Message.HighlyStructuredMessage.toObject(m.displayText, o);
                    if (o.oneofs)
                        d._displayText = "displayText";
                }
                if (m.id != null && m.hasOwnProperty("id")) {
                    d.id = m.id;
                    if (o.oneofs)
                        d._id = "id";
                }
                return d;
            };

            QuickReplyButton.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            QuickReplyButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.TemplateButton.QuickReplyButton";
            };

            return QuickReplyButton;
        })();

        TemplateButton.URLButton = (function() {

            function URLButton(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            URLButton.prototype.displayText = null;
            URLButton.prototype.url = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(URLButton.prototype, "_displayText", {
                get: $util.oneOfGetter($oneOfFields = ["displayText"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(URLButton.prototype, "_url", {
                get: $util.oneOfGetter($oneOfFields = ["url"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            URLButton.create = function create(properties) {
                return new URLButton(properties);
            };

            URLButton.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.displayText != null && Object.hasOwnProperty.call(m, "displayText"))
                    $root.proto.Message.HighlyStructuredMessage.encode(m.displayText, w.uint32(10).fork()).ldelim();
                if (m.url != null && Object.hasOwnProperty.call(m, "url"))
                    $root.proto.Message.HighlyStructuredMessage.encode(m.url, w.uint32(18).fork()).ldelim();
                return w;
            };

            URLButton.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TemplateButton.URLButton();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.displayText = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                            break;
                        }
                    case 2: {
                            m.url = $root.proto.Message.HighlyStructuredMessage.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            URLButton.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.TemplateButton.URLButton)
                    return d;
                var m = new $root.proto.TemplateButton.URLButton();
                if (d.displayText != null) {
                    if (typeof d.displayText !== "object")
                        throw TypeError(".proto.TemplateButton.URLButton.displayText: object expected");
                    m.displayText = $root.proto.Message.HighlyStructuredMessage.fromObject(d.displayText);
                }
                if (d.url != null) {
                    if (typeof d.url !== "object")
                        throw TypeError(".proto.TemplateButton.URLButton.url: object expected");
                    m.url = $root.proto.Message.HighlyStructuredMessage.fromObject(d.url);
                }
                return m;
            };

            URLButton.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.displayText != null && m.hasOwnProperty("displayText")) {
                    d.displayText = $root.proto.Message.HighlyStructuredMessage.toObject(m.displayText, o);
                    if (o.oneofs)
                        d._displayText = "displayText";
                }
                if (m.url != null && m.hasOwnProperty("url")) {
                    d.url = $root.proto.Message.HighlyStructuredMessage.toObject(m.url, o);
                    if (o.oneofs)
                        d._url = "url";
                }
                return d;
            };

            URLButton.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            URLButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.TemplateButton.URLButton";
            };

            return URLButton;
        })();

        return TemplateButton;
    })();

    proto.ThreadID = (function() {

        function ThreadID(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        ThreadID.prototype.threadType = null;
        ThreadID.prototype.threadKey = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ThreadID.prototype, "_threadType", {
            get: $util.oneOfGetter($oneOfFields = ["threadType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(ThreadID.prototype, "_threadKey", {
            get: $util.oneOfGetter($oneOfFields = ["threadKey"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        ThreadID.create = function create(properties) {
            return new ThreadID(properties);
        };

        ThreadID.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.threadType != null && Object.hasOwnProperty.call(m, "threadType"))
                w.uint32(8).int32(m.threadType);
            if (m.threadKey != null && Object.hasOwnProperty.call(m, "threadKey"))
                $root.proto.MessageKey.encode(m.threadKey, w.uint32(18).fork()).ldelim();
            return w;
        };

        ThreadID.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThreadID();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.threadType = r.int32();
                        break;
                    }
                case 2: {
                        m.threadKey = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        ThreadID.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.ThreadID)
                return d;
            var m = new $root.proto.ThreadID();
            switch (d.threadType) {
            default:
                if (typeof d.threadType === "number") {
                    m.threadType = d.threadType;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.threadType = 0;
                break;
            case "VIEW_REPLIES":
            case 1:
                m.threadType = 1;
                break;
            case "AI_THREAD":
            case 2:
                m.threadType = 2;
                break;
            }
            if (d.threadKey != null) {
                if (typeof d.threadKey !== "object")
                    throw TypeError(".proto.ThreadID.threadKey: object expected");
                m.threadKey = $root.proto.MessageKey.fromObject(d.threadKey);
            }
            return m;
        };

        ThreadID.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.threadType != null && m.hasOwnProperty("threadType")) {
                d.threadType = o.enums === String ? $root.proto.ThreadID.ThreadType[m.threadType] === undefined ? m.threadType : $root.proto.ThreadID.ThreadType[m.threadType] : m.threadType;
                if (o.oneofs)
                    d._threadType = "threadType";
            }
            if (m.threadKey != null && m.hasOwnProperty("threadKey")) {
                d.threadKey = $root.proto.MessageKey.toObject(m.threadKey, o);
                if (o.oneofs)
                    d._threadKey = "threadKey";
            }
            return d;
        };

        ThreadID.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        ThreadID.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.ThreadID";
        };

        ThreadID.ThreadType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "VIEW_REPLIES"] = 1;
            values[valuesById[2] = "AI_THREAD"] = 2;
            return values;
        })();

        return ThreadID;
    })();

    proto.UrlTrackingMap = (function() {

        function UrlTrackingMap(p) {
            this.urlTrackingMapElements = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        UrlTrackingMap.prototype.urlTrackingMapElements = $util.emptyArray;

        UrlTrackingMap.create = function create(properties) {
            return new UrlTrackingMap(properties);
        };

        UrlTrackingMap.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.urlTrackingMapElements != null && m.urlTrackingMapElements.length) {
                for (var i = 0; i < m.urlTrackingMapElements.length; ++i)
                    $root.proto.UrlTrackingMap.UrlTrackingMapElement.encode(m.urlTrackingMapElements[i], w.uint32(10).fork()).ldelim();
            }
            return w;
        };

        UrlTrackingMap.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.UrlTrackingMap();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        if (!(m.urlTrackingMapElements && m.urlTrackingMapElements.length))
                            m.urlTrackingMapElements = [];
                        m.urlTrackingMapElements.push($root.proto.UrlTrackingMap.UrlTrackingMapElement.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        UrlTrackingMap.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.UrlTrackingMap)
                return d;
            var m = new $root.proto.UrlTrackingMap();
            if (d.urlTrackingMapElements) {
                if (!Array.isArray(d.urlTrackingMapElements))
                    throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: array expected");
                m.urlTrackingMapElements = [];
                for (var i = 0; i < d.urlTrackingMapElements.length; ++i) {
                    if (typeof d.urlTrackingMapElements[i] !== "object")
                        throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: object expected");
                    m.urlTrackingMapElements[i] = $root.proto.UrlTrackingMap.UrlTrackingMapElement.fromObject(d.urlTrackingMapElements[i]);
                }
            }
            return m;
        };

        UrlTrackingMap.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.urlTrackingMapElements = [];
            }
            if (m.urlTrackingMapElements && m.urlTrackingMapElements.length) {
                d.urlTrackingMapElements = [];
                for (var j = 0; j < m.urlTrackingMapElements.length; ++j) {
                    d.urlTrackingMapElements[j] = $root.proto.UrlTrackingMap.UrlTrackingMapElement.toObject(m.urlTrackingMapElements[j], o);
                }
            }
            return d;
        };

        UrlTrackingMap.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        UrlTrackingMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.UrlTrackingMap";
        };

        UrlTrackingMap.UrlTrackingMapElement = (function() {

            function UrlTrackingMapElement(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            UrlTrackingMapElement.prototype.originalUrl = null;
            UrlTrackingMapElement.prototype.unconsentedUsersUrl = null;
            UrlTrackingMapElement.prototype.consentedUsersUrl = null;
            UrlTrackingMapElement.prototype.cardIndex = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UrlTrackingMapElement.prototype, "_originalUrl", {
                get: $util.oneOfGetter($oneOfFields = ["originalUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UrlTrackingMapElement.prototype, "_unconsentedUsersUrl", {
                get: $util.oneOfGetter($oneOfFields = ["unconsentedUsersUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UrlTrackingMapElement.prototype, "_consentedUsersUrl", {
                get: $util.oneOfGetter($oneOfFields = ["consentedUsersUrl"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(UrlTrackingMapElement.prototype, "_cardIndex", {
                get: $util.oneOfGetter($oneOfFields = ["cardIndex"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            UrlTrackingMapElement.create = function create(properties) {
                return new UrlTrackingMapElement(properties);
            };

            UrlTrackingMapElement.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.originalUrl != null && Object.hasOwnProperty.call(m, "originalUrl"))
                    w.uint32(10).string(m.originalUrl);
                if (m.unconsentedUsersUrl != null && Object.hasOwnProperty.call(m, "unconsentedUsersUrl"))
                    w.uint32(18).string(m.unconsentedUsersUrl);
                if (m.consentedUsersUrl != null && Object.hasOwnProperty.call(m, "consentedUsersUrl"))
                    w.uint32(26).string(m.consentedUsersUrl);
                if (m.cardIndex != null && Object.hasOwnProperty.call(m, "cardIndex"))
                    w.uint32(32).uint32(m.cardIndex);
                return w;
            };

            UrlTrackingMapElement.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.UrlTrackingMap.UrlTrackingMapElement();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.originalUrl = r.string();
                            break;
                        }
                    case 2: {
                            m.unconsentedUsersUrl = r.string();
                            break;
                        }
                    case 3: {
                            m.consentedUsersUrl = r.string();
                            break;
                        }
                    case 4: {
                            m.cardIndex = r.uint32();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            UrlTrackingMapElement.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.UrlTrackingMap.UrlTrackingMapElement)
                    return d;
                var m = new $root.proto.UrlTrackingMap.UrlTrackingMapElement();
                if (d.originalUrl != null) {
                    m.originalUrl = String(d.originalUrl);
                }
                if (d.unconsentedUsersUrl != null) {
                    m.unconsentedUsersUrl = String(d.unconsentedUsersUrl);
                }
                if (d.consentedUsersUrl != null) {
                    m.consentedUsersUrl = String(d.consentedUsersUrl);
                }
                if (d.cardIndex != null) {
                    m.cardIndex = d.cardIndex >>> 0;
                }
                return m;
            };

            UrlTrackingMapElement.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.originalUrl != null && m.hasOwnProperty("originalUrl")) {
                    d.originalUrl = m.originalUrl;
                    if (o.oneofs)
                        d._originalUrl = "originalUrl";
                }
                if (m.unconsentedUsersUrl != null && m.hasOwnProperty("unconsentedUsersUrl")) {
                    d.unconsentedUsersUrl = m.unconsentedUsersUrl;
                    if (o.oneofs)
                        d._unconsentedUsersUrl = "unconsentedUsersUrl";
                }
                if (m.consentedUsersUrl != null && m.hasOwnProperty("consentedUsersUrl")) {
                    d.consentedUsersUrl = m.consentedUsersUrl;
                    if (o.oneofs)
                        d._consentedUsersUrl = "consentedUsersUrl";
                }
                if (m.cardIndex != null && m.hasOwnProperty("cardIndex")) {
                    d.cardIndex = m.cardIndex;
                    if (o.oneofs)
                        d._cardIndex = "cardIndex";
                }
                return d;
            };

            UrlTrackingMapElement.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            UrlTrackingMapElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.UrlTrackingMap.UrlTrackingMapElement";
            };

            return UrlTrackingMapElement;
        })();

        return UrlTrackingMap;
    })();

    proto.UserPassword = (function() {

        function UserPassword(p) {
            this.transformerArg = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        UserPassword.prototype.encoding = null;
        UserPassword.prototype.transformer = null;
        UserPassword.prototype.transformerArg = $util.emptyArray;
        UserPassword.prototype.transformedData = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(UserPassword.prototype, "_encoding", {
            get: $util.oneOfGetter($oneOfFields = ["encoding"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(UserPassword.prototype, "_transformer", {
            get: $util.oneOfGetter($oneOfFields = ["transformer"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(UserPassword.prototype, "_transformedData", {
            get: $util.oneOfGetter($oneOfFields = ["transformedData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        UserPassword.create = function create(properties) {
            return new UserPassword(properties);
        };

        UserPassword.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.encoding != null && Object.hasOwnProperty.call(m, "encoding"))
                w.uint32(8).int32(m.encoding);
            if (m.transformer != null && Object.hasOwnProperty.call(m, "transformer"))
                w.uint32(16).int32(m.transformer);
            if (m.transformerArg != null && m.transformerArg.length) {
                for (var i = 0; i < m.transformerArg.length; ++i)
                    $root.proto.UserPassword.TransformerArg.encode(m.transformerArg[i], w.uint32(26).fork()).ldelim();
            }
            if (m.transformedData != null && Object.hasOwnProperty.call(m, "transformedData"))
                w.uint32(34).bytes(m.transformedData);
            return w;
        };

        UserPassword.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.UserPassword();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.encoding = r.int32();
                        break;
                    }
                case 2: {
                        m.transformer = r.int32();
                        break;
                    }
                case 3: {
                        if (!(m.transformerArg && m.transformerArg.length))
                            m.transformerArg = [];
                        m.transformerArg.push($root.proto.UserPassword.TransformerArg.decode(r, r.uint32()));
                        break;
                    }
                case 4: {
                        m.transformedData = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        UserPassword.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.UserPassword)
                return d;
            var m = new $root.proto.UserPassword();
            switch (d.encoding) {
            default:
                if (typeof d.encoding === "number") {
                    m.encoding = d.encoding;
                    break;
                }
                break;
            case "UTF8":
            case 0:
                m.encoding = 0;
                break;
            case "UTF8_BROKEN":
            case 1:
                m.encoding = 1;
                break;
            }
            switch (d.transformer) {
            default:
                if (typeof d.transformer === "number") {
                    m.transformer = d.transformer;
                    break;
                }
                break;
            case "NONE":
            case 0:
                m.transformer = 0;
                break;
            case "PBKDF2_HMAC_SHA512":
            case 1:
                m.transformer = 1;
                break;
            case "PBKDF2_HMAC_SHA384":
            case 2:
                m.transformer = 2;
                break;
            }
            if (d.transformerArg) {
                if (!Array.isArray(d.transformerArg))
                    throw TypeError(".proto.UserPassword.transformerArg: array expected");
                m.transformerArg = [];
                for (var i = 0; i < d.transformerArg.length; ++i) {
                    if (typeof d.transformerArg[i] !== "object")
                        throw TypeError(".proto.UserPassword.transformerArg: object expected");
                    m.transformerArg[i] = $root.proto.UserPassword.TransformerArg.fromObject(d.transformerArg[i]);
                }
            }
            if (d.transformedData != null) {
                if (typeof d.transformedData === "string")
                    $util.base64.decode(d.transformedData, m.transformedData = $util.newBuffer($util.base64.length(d.transformedData)), 0);
                else if (d.transformedData.length >= 0)
                    m.transformedData = d.transformedData;
            }
            return m;
        };

        UserPassword.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.transformerArg = [];
            }
            if (m.encoding != null && m.hasOwnProperty("encoding")) {
                d.encoding = o.enums === String ? $root.proto.UserPassword.Encoding[m.encoding] === undefined ? m.encoding : $root.proto.UserPassword.Encoding[m.encoding] : m.encoding;
                if (o.oneofs)
                    d._encoding = "encoding";
            }
            if (m.transformer != null && m.hasOwnProperty("transformer")) {
                d.transformer = o.enums === String ? $root.proto.UserPassword.Transformer[m.transformer] === undefined ? m.transformer : $root.proto.UserPassword.Transformer[m.transformer] : m.transformer;
                if (o.oneofs)
                    d._transformer = "transformer";
            }
            if (m.transformerArg && m.transformerArg.length) {
                d.transformerArg = [];
                for (var j = 0; j < m.transformerArg.length; ++j) {
                    d.transformerArg[j] = $root.proto.UserPassword.TransformerArg.toObject(m.transformerArg[j], o);
                }
            }
            if (m.transformedData != null && m.hasOwnProperty("transformedData")) {
                d.transformedData = o.bytes === String ? $util.base64.encode(m.transformedData, 0, m.transformedData.length) : o.bytes === Array ? Array.prototype.slice.call(m.transformedData) : m.transformedData;
                if (o.oneofs)
                    d._transformedData = "transformedData";
            }
            return d;
        };

        UserPassword.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.UserPassword";
        };

        UserPassword.Encoding = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UTF8"] = 0;
            values[valuesById[1] = "UTF8_BROKEN"] = 1;
            return values;
        })();

        UserPassword.Transformer = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "NONE"] = 0;
            values[valuesById[1] = "PBKDF2_HMAC_SHA512"] = 1;
            values[valuesById[2] = "PBKDF2_HMAC_SHA384"] = 2;
            return values;
        })();

        UserPassword.TransformerArg = (function() {

            function TransformerArg(p) {
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            TransformerArg.prototype.key = null;
            TransformerArg.prototype.value = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TransformerArg.prototype, "_key", {
                get: $util.oneOfGetter($oneOfFields = ["key"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(TransformerArg.prototype, "_value", {
                get: $util.oneOfGetter($oneOfFields = ["value"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            TransformerArg.create = function create(properties) {
                return new TransformerArg(properties);
            };

            TransformerArg.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                    w.uint32(10).string(m.key);
                if (m.value != null && Object.hasOwnProperty.call(m, "value"))
                    $root.proto.UserPassword.TransformerArg.Value.encode(m.value, w.uint32(18).fork()).ldelim();
                return w;
            };

            TransformerArg.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.UserPassword.TransformerArg();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.key = r.string();
                            break;
                        }
                    case 2: {
                            m.value = $root.proto.UserPassword.TransformerArg.Value.decode(r, r.uint32());
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            TransformerArg.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.UserPassword.TransformerArg)
                    return d;
                var m = new $root.proto.UserPassword.TransformerArg();
                if (d.key != null) {
                    m.key = String(d.key);
                }
                if (d.value != null) {
                    if (typeof d.value !== "object")
                        throw TypeError(".proto.UserPassword.TransformerArg.value: object expected");
                    m.value = $root.proto.UserPassword.TransformerArg.Value.fromObject(d.value);
                }
                return m;
            };

            TransformerArg.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (m.key != null && m.hasOwnProperty("key")) {
                    d.key = m.key;
                    if (o.oneofs)
                        d._key = "key";
                }
                if (m.value != null && m.hasOwnProperty("value")) {
                    d.value = $root.proto.UserPassword.TransformerArg.Value.toObject(m.value, o);
                    if (o.oneofs)
                        d._value = "value";
                }
                return d;
            };

            TransformerArg.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            TransformerArg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.UserPassword.TransformerArg";
            };

            TransformerArg.Value = (function() {

                function Value(p) {
                    if (p)
                        for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                            if (p[ks[i]] != null)
                                this[ks[i]] = p[ks[i]];
                }

                Value.prototype.asBlob = null;
                Value.prototype.asUnsignedInteger = null;

                let $oneOfFields;

                Object.defineProperty(Value.prototype, "value", {
                    get: $util.oneOfGetter($oneOfFields = ["asBlob", "asUnsignedInteger"]),
                    set: $util.oneOfSetter($oneOfFields)
                });

                Value.create = function create(properties) {
                    return new Value(properties);
                };

                Value.encode = function encode(m, w) {
                    if (!w)
                        w = $Writer.create();
                    if (m.asBlob != null && Object.hasOwnProperty.call(m, "asBlob"))
                        w.uint32(10).bytes(m.asBlob);
                    if (m.asUnsignedInteger != null && Object.hasOwnProperty.call(m, "asUnsignedInteger"))
                        w.uint32(16).uint32(m.asUnsignedInteger);
                    return w;
                };

                Value.decode = function decode(r, l, e) {
                    if (!(r instanceof $Reader))
                        r = $Reader.create(r);
                    var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.UserPassword.TransformerArg.Value();
                    while (r.pos < c) {
                        var t = r.uint32();
                        if (t === e)
                            break;
                        switch (t >>> 3) {
                        case 1: {
                                m.asBlob = r.bytes();
                                break;
                            }
                        case 2: {
                                m.asUnsignedInteger = r.uint32();
                                break;
                            }
                        default:
                            r.skipType(t & 7);
                            break;
                        }
                    }
                    return m;
                };

                Value.fromObject = function fromObject(d) {
                    if (d instanceof $root.proto.UserPassword.TransformerArg.Value)
                        return d;
                    var m = new $root.proto.UserPassword.TransformerArg.Value();
                    if (d.asBlob != null) {
                        if (typeof d.asBlob === "string")
                            $util.base64.decode(d.asBlob, m.asBlob = $util.newBuffer($util.base64.length(d.asBlob)), 0);
                        else if (d.asBlob.length >= 0)
                            m.asBlob = d.asBlob;
                    }
                    if (d.asUnsignedInteger != null) {
                        m.asUnsignedInteger = d.asUnsignedInteger >>> 0;
                    }
                    return m;
                };

                Value.toObject = function toObject(m, o) {
                    if (!o)
                        o = {};
                    var d = {};
                    if (m.asBlob != null && m.hasOwnProperty("asBlob")) {
                        d.asBlob = o.bytes === String ? $util.base64.encode(m.asBlob, 0, m.asBlob.length) : o.bytes === Array ? Array.prototype.slice.call(m.asBlob) : m.asBlob;
                        if (o.oneofs)
                            d.value = "asBlob";
                    }
                    if (m.asUnsignedInteger != null && m.hasOwnProperty("asUnsignedInteger")) {
                        d.asUnsignedInteger = m.asUnsignedInteger;
                        if (o.oneofs)
                            d.value = "asUnsignedInteger";
                    }
                    return d;
                };

                Value.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };

                Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/proto.UserPassword.TransformerArg.Value";
                };

                return Value;
            })();

            return TransformerArg;
        })();

        return UserPassword;
    })();

    proto.UserReceipt = (function() {

        function UserReceipt(p) {
            this.pendingDeviceJid = [];
            this.deliveredDeviceJid = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        UserReceipt.prototype.userJid = "";
        UserReceipt.prototype.receiptTimestamp = null;
        UserReceipt.prototype.readTimestamp = null;
        UserReceipt.prototype.playedTimestamp = null;
        UserReceipt.prototype.pendingDeviceJid = $util.emptyArray;
        UserReceipt.prototype.deliveredDeviceJid = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(UserReceipt.prototype, "_receiptTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["receiptTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(UserReceipt.prototype, "_readTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["readTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(UserReceipt.prototype, "_playedTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["playedTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        UserReceipt.create = function create(properties) {
            return new UserReceipt(properties);
        };

        UserReceipt.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.userJid != null && Object.hasOwnProperty.call(m, "userJid"))
                w.uint32(10).string(m.userJid);
            if (m.receiptTimestamp != null && Object.hasOwnProperty.call(m, "receiptTimestamp"))
                w.uint32(16).int64(m.receiptTimestamp);
            if (m.readTimestamp != null && Object.hasOwnProperty.call(m, "readTimestamp"))
                w.uint32(24).int64(m.readTimestamp);
            if (m.playedTimestamp != null && Object.hasOwnProperty.call(m, "playedTimestamp"))
                w.uint32(32).int64(m.playedTimestamp);
            if (m.pendingDeviceJid != null && m.pendingDeviceJid.length) {
                for (var i = 0; i < m.pendingDeviceJid.length; ++i)
                    w.uint32(42).string(m.pendingDeviceJid[i]);
            }
            if (m.deliveredDeviceJid != null && m.deliveredDeviceJid.length) {
                for (var i = 0; i < m.deliveredDeviceJid.length; ++i)
                    w.uint32(50).string(m.deliveredDeviceJid[i]);
            }
            return w;
        };

        UserReceipt.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.UserReceipt();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.userJid = r.string();
                        break;
                    }
                case 2: {
                        m.receiptTimestamp = r.int64();
                        break;
                    }
                case 3: {
                        m.readTimestamp = r.int64();
                        break;
                    }
                case 4: {
                        m.playedTimestamp = r.int64();
                        break;
                    }
                case 5: {
                        if (!(m.pendingDeviceJid && m.pendingDeviceJid.length))
                            m.pendingDeviceJid = [];
                        m.pendingDeviceJid.push(r.string());
                        break;
                    }
                case 6: {
                        if (!(m.deliveredDeviceJid && m.deliveredDeviceJid.length))
                            m.deliveredDeviceJid = [];
                        m.deliveredDeviceJid.push(r.string());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        UserReceipt.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.UserReceipt)
                return d;
            var m = new $root.proto.UserReceipt();
            if (d.userJid != null) {
                m.userJid = String(d.userJid);
            }
            if (d.receiptTimestamp != null) {
                if ($util.Long)
                    (m.receiptTimestamp = $util.Long.fromValue(d.receiptTimestamp)).unsigned = false;
                else if (typeof d.receiptTimestamp === "string")
                    m.receiptTimestamp = parseInt(d.receiptTimestamp, 10);
                else if (typeof d.receiptTimestamp === "number")
                    m.receiptTimestamp = d.receiptTimestamp;
                else if (typeof d.receiptTimestamp === "object")
                    m.receiptTimestamp = new $util.LongBits(d.receiptTimestamp.low >>> 0, d.receiptTimestamp.high >>> 0).toNumber();
            }
            if (d.readTimestamp != null) {
                if ($util.Long)
                    (m.readTimestamp = $util.Long.fromValue(d.readTimestamp)).unsigned = false;
                else if (typeof d.readTimestamp === "string")
                    m.readTimestamp = parseInt(d.readTimestamp, 10);
                else if (typeof d.readTimestamp === "number")
                    m.readTimestamp = d.readTimestamp;
                else if (typeof d.readTimestamp === "object")
                    m.readTimestamp = new $util.LongBits(d.readTimestamp.low >>> 0, d.readTimestamp.high >>> 0).toNumber();
            }
            if (d.playedTimestamp != null) {
                if ($util.Long)
                    (m.playedTimestamp = $util.Long.fromValue(d.playedTimestamp)).unsigned = false;
                else if (typeof d.playedTimestamp === "string")
                    m.playedTimestamp = parseInt(d.playedTimestamp, 10);
                else if (typeof d.playedTimestamp === "number")
                    m.playedTimestamp = d.playedTimestamp;
                else if (typeof d.playedTimestamp === "object")
                    m.playedTimestamp = new $util.LongBits(d.playedTimestamp.low >>> 0, d.playedTimestamp.high >>> 0).toNumber();
            }
            if (d.pendingDeviceJid) {
                if (!Array.isArray(d.pendingDeviceJid))
                    throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected");
                m.pendingDeviceJid = [];
                for (var i = 0; i < d.pendingDeviceJid.length; ++i) {
                    m.pendingDeviceJid[i] = String(d.pendingDeviceJid[i]);
                }
            }
            if (d.deliveredDeviceJid) {
                if (!Array.isArray(d.deliveredDeviceJid))
                    throw TypeError(".proto.UserReceipt.deliveredDeviceJid: array expected");
                m.deliveredDeviceJid = [];
                for (var i = 0; i < d.deliveredDeviceJid.length; ++i) {
                    m.deliveredDeviceJid[i] = String(d.deliveredDeviceJid[i]);
                }
            }
            return m;
        };

        UserReceipt.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.pendingDeviceJid = [];
                d.deliveredDeviceJid = [];
            }
            if (o.defaults) {
                d.userJid = "";
            }
            if (m.userJid != null && m.hasOwnProperty("userJid")) {
                d.userJid = m.userJid;
            }
            if (m.receiptTimestamp != null && m.hasOwnProperty("receiptTimestamp")) {
                if (typeof m.receiptTimestamp === "number")
                    d.receiptTimestamp = o.longs === String ? String(m.receiptTimestamp) : m.receiptTimestamp;
                else
                    d.receiptTimestamp = o.longs === String ? longToString(m.receiptTimestamp) : o.longs === Number ? longToNumber(m.receiptTimestamp) : m.receiptTimestamp;
                if (o.oneofs)
                    d._receiptTimestamp = "receiptTimestamp";
            }
            if (m.readTimestamp != null && m.hasOwnProperty("readTimestamp")) {
                if (typeof m.readTimestamp === "number")
                    d.readTimestamp = o.longs === String ? String(m.readTimestamp) : m.readTimestamp;
                else
                    d.readTimestamp = o.longs === String ? longToString(m.readTimestamp) : o.longs === Number ? longToNumber(m.readTimestamp) : m.readTimestamp;
                if (o.oneofs)
                    d._readTimestamp = "readTimestamp";
            }
            if (m.playedTimestamp != null && m.hasOwnProperty("playedTimestamp")) {
                if (typeof m.playedTimestamp === "number")
                    d.playedTimestamp = o.longs === String ? String(m.playedTimestamp) : m.playedTimestamp;
                else
                    d.playedTimestamp = o.longs === String ? longToString(m.playedTimestamp) : o.longs === Number ? longToNumber(m.playedTimestamp) : m.playedTimestamp;
                if (o.oneofs)
                    d._playedTimestamp = "playedTimestamp";
            }
            if (m.pendingDeviceJid && m.pendingDeviceJid.length) {
                d.pendingDeviceJid = [];
                for (var j = 0; j < m.pendingDeviceJid.length; ++j) {
                    d.pendingDeviceJid[j] = m.pendingDeviceJid[j];
                }
            }
            if (m.deliveredDeviceJid && m.deliveredDeviceJid.length) {
                d.deliveredDeviceJid = [];
                for (var j = 0; j < m.deliveredDeviceJid.length; ++j) {
                    d.deliveredDeviceJid[j] = m.deliveredDeviceJid[j];
                }
            }
            return d;
        };

        UserReceipt.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        UserReceipt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.UserReceipt";
        };

        return UserReceipt;
    })();

    proto.VerifiedNameCertificate = (function() {

        function VerifiedNameCertificate(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        VerifiedNameCertificate.prototype.details = null;
        VerifiedNameCertificate.prototype.signature = null;
        VerifiedNameCertificate.prototype.serverSignature = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(VerifiedNameCertificate.prototype, "_details", {
            get: $util.oneOfGetter($oneOfFields = ["details"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(VerifiedNameCertificate.prototype, "_signature", {
            get: $util.oneOfGetter($oneOfFields = ["signature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(VerifiedNameCertificate.prototype, "_serverSignature", {
            get: $util.oneOfGetter($oneOfFields = ["serverSignature"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        VerifiedNameCertificate.create = function create(properties) {
            return new VerifiedNameCertificate(properties);
        };

        VerifiedNameCertificate.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.details != null && Object.hasOwnProperty.call(m, "details"))
                w.uint32(10).bytes(m.details);
            if (m.signature != null && Object.hasOwnProperty.call(m, "signature"))
                w.uint32(18).bytes(m.signature);
            if (m.serverSignature != null && Object.hasOwnProperty.call(m, "serverSignature"))
                w.uint32(26).bytes(m.serverSignature);
            return w;
        };

        VerifiedNameCertificate.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.VerifiedNameCertificate();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.details = r.bytes();
                        break;
                    }
                case 2: {
                        m.signature = r.bytes();
                        break;
                    }
                case 3: {
                        m.serverSignature = r.bytes();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        VerifiedNameCertificate.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.VerifiedNameCertificate)
                return d;
            var m = new $root.proto.VerifiedNameCertificate();
            if (d.details != null) {
                if (typeof d.details === "string")
                    $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0);
                else if (d.details.length >= 0)
                    m.details = d.details;
            }
            if (d.signature != null) {
                if (typeof d.signature === "string")
                    $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0);
                else if (d.signature.length >= 0)
                    m.signature = d.signature;
            }
            if (d.serverSignature != null) {
                if (typeof d.serverSignature === "string")
                    $util.base64.decode(d.serverSignature, m.serverSignature = $util.newBuffer($util.base64.length(d.serverSignature)), 0);
                else if (d.serverSignature.length >= 0)
                    m.serverSignature = d.serverSignature;
            }
            return m;
        };

        VerifiedNameCertificate.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.details != null && m.hasOwnProperty("details")) {
                d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details;
                if (o.oneofs)
                    d._details = "details";
            }
            if (m.signature != null && m.hasOwnProperty("signature")) {
                d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature;
                if (o.oneofs)
                    d._signature = "signature";
            }
            if (m.serverSignature != null && m.hasOwnProperty("serverSignature")) {
                d.serverSignature = o.bytes === String ? $util.base64.encode(m.serverSignature, 0, m.serverSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.serverSignature) : m.serverSignature;
                if (o.oneofs)
                    d._serverSignature = "serverSignature";
            }
            return d;
        };

        VerifiedNameCertificate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        VerifiedNameCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.VerifiedNameCertificate";
        };

        VerifiedNameCertificate.Details = (function() {

            function Details(p) {
                this.localizedNames = [];
                if (p)
                    for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                        if (p[ks[i]] != null)
                            this[ks[i]] = p[ks[i]];
            }

            Details.prototype.serial = null;
            Details.prototype.issuer = null;
            Details.prototype.verifiedName = null;
            Details.prototype.localizedNames = $util.emptyArray;
            Details.prototype.issueTime = null;

            let $oneOfFields;

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_serial", {
                get: $util.oneOfGetter($oneOfFields = ["serial"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_issuer", {
                get: $util.oneOfGetter($oneOfFields = ["issuer"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_verifiedName", {
                get: $util.oneOfGetter($oneOfFields = ["verifiedName"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            // Virtual OneOf for proto3 optional field
            Object.defineProperty(Details.prototype, "_issueTime", {
                get: $util.oneOfGetter($oneOfFields = ["issueTime"]),
                set: $util.oneOfSetter($oneOfFields)
            });

            Details.create = function create(properties) {
                return new Details(properties);
            };

            Details.encode = function encode(m, w) {
                if (!w)
                    w = $Writer.create();
                if (m.serial != null && Object.hasOwnProperty.call(m, "serial"))
                    w.uint32(8).uint64(m.serial);
                if (m.issuer != null && Object.hasOwnProperty.call(m, "issuer"))
                    w.uint32(18).string(m.issuer);
                if (m.verifiedName != null && Object.hasOwnProperty.call(m, "verifiedName"))
                    w.uint32(34).string(m.verifiedName);
                if (m.localizedNames != null && m.localizedNames.length) {
                    for (var i = 0; i < m.localizedNames.length; ++i)
                        $root.proto.LocalizedName.encode(m.localizedNames[i], w.uint32(66).fork()).ldelim();
                }
                if (m.issueTime != null && Object.hasOwnProperty.call(m, "issueTime"))
                    w.uint32(80).uint64(m.issueTime);
                return w;
            };

            Details.decode = function decode(r, l, e) {
                if (!(r instanceof $Reader))
                    r = $Reader.create(r);
                var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.VerifiedNameCertificate.Details();
                while (r.pos < c) {
                    var t = r.uint32();
                    if (t === e)
                        break;
                    switch (t >>> 3) {
                    case 1: {
                            m.serial = r.uint64();
                            break;
                        }
                    case 2: {
                            m.issuer = r.string();
                            break;
                        }
                    case 4: {
                            m.verifiedName = r.string();
                            break;
                        }
                    case 8: {
                            if (!(m.localizedNames && m.localizedNames.length))
                                m.localizedNames = [];
                            m.localizedNames.push($root.proto.LocalizedName.decode(r, r.uint32()));
                            break;
                        }
                    case 10: {
                            m.issueTime = r.uint64();
                            break;
                        }
                    default:
                        r.skipType(t & 7);
                        break;
                    }
                }
                return m;
            };

            Details.fromObject = function fromObject(d) {
                if (d instanceof $root.proto.VerifiedNameCertificate.Details)
                    return d;
                var m = new $root.proto.VerifiedNameCertificate.Details();
                if (d.serial != null) {
                    if ($util.Long)
                        (m.serial = $util.Long.fromValue(d.serial)).unsigned = true;
                    else if (typeof d.serial === "string")
                        m.serial = parseInt(d.serial, 10);
                    else if (typeof d.serial === "number")
                        m.serial = d.serial;
                    else if (typeof d.serial === "object")
                        m.serial = new $util.LongBits(d.serial.low >>> 0, d.serial.high >>> 0).toNumber(true);
                }
                if (d.issuer != null) {
                    m.issuer = String(d.issuer);
                }
                if (d.verifiedName != null) {
                    m.verifiedName = String(d.verifiedName);
                }
                if (d.localizedNames) {
                    if (!Array.isArray(d.localizedNames))
                        throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: array expected");
                    m.localizedNames = [];
                    for (var i = 0; i < d.localizedNames.length; ++i) {
                        if (typeof d.localizedNames[i] !== "object")
                            throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: object expected");
                        m.localizedNames[i] = $root.proto.LocalizedName.fromObject(d.localizedNames[i]);
                    }
                }
                if (d.issueTime != null) {
                    if ($util.Long)
                        (m.issueTime = $util.Long.fromValue(d.issueTime)).unsigned = true;
                    else if (typeof d.issueTime === "string")
                        m.issueTime = parseInt(d.issueTime, 10);
                    else if (typeof d.issueTime === "number")
                        m.issueTime = d.issueTime;
                    else if (typeof d.issueTime === "object")
                        m.issueTime = new $util.LongBits(d.issueTime.low >>> 0, d.issueTime.high >>> 0).toNumber(true);
                }
                return m;
            };

            Details.toObject = function toObject(m, o) {
                if (!o)
                    o = {};
                var d = {};
                if (o.arrays || o.defaults) {
                    d.localizedNames = [];
                }
                if (m.serial != null && m.hasOwnProperty("serial")) {
                    if (typeof m.serial === "number")
                        d.serial = o.longs === String ? String(m.serial) : m.serial;
                    else
                        d.serial = o.longs === String ? longToString(m.serial, true) : o.longs === Number ? longToNumber(m.serial, true) : m.serial;
                    if (o.oneofs)
                        d._serial = "serial";
                }
                if (m.issuer != null && m.hasOwnProperty("issuer")) {
                    d.issuer = m.issuer;
                    if (o.oneofs)
                        d._issuer = "issuer";
                }
                if (m.verifiedName != null && m.hasOwnProperty("verifiedName")) {
                    d.verifiedName = m.verifiedName;
                    if (o.oneofs)
                        d._verifiedName = "verifiedName";
                }
                if (m.localizedNames && m.localizedNames.length) {
                    d.localizedNames = [];
                    for (var j = 0; j < m.localizedNames.length; ++j) {
                        d.localizedNames[j] = $root.proto.LocalizedName.toObject(m.localizedNames[j], o);
                    }
                }
                if (m.issueTime != null && m.hasOwnProperty("issueTime")) {
                    if (typeof m.issueTime === "number")
                        d.issueTime = o.longs === String ? String(m.issueTime) : m.issueTime;
                    else
                        d.issueTime = o.longs === String ? longToString(m.issueTime, true) : o.longs === Number ? longToNumber(m.issueTime, true) : m.issueTime;
                    if (o.oneofs)
                        d._issueTime = "issueTime";
                }
                return d;
            };

            Details.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/proto.VerifiedNameCertificate.Details";
            };

            return Details;
        })();

        return VerifiedNameCertificate;
    })();

    proto.WallpaperSettings = (function() {

        function WallpaperSettings(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        WallpaperSettings.prototype.filename = null;
        WallpaperSettings.prototype.opacity = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WallpaperSettings.prototype, "_filename", {
            get: $util.oneOfGetter($oneOfFields = ["filename"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WallpaperSettings.prototype, "_opacity", {
            get: $util.oneOfGetter($oneOfFields = ["opacity"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        WallpaperSettings.create = function create(properties) {
            return new WallpaperSettings(properties);
        };

        WallpaperSettings.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.filename != null && Object.hasOwnProperty.call(m, "filename"))
                w.uint32(10).string(m.filename);
            if (m.opacity != null && Object.hasOwnProperty.call(m, "opacity"))
                w.uint32(16).uint32(m.opacity);
            return w;
        };

        WallpaperSettings.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.WallpaperSettings();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.filename = r.string();
                        break;
                    }
                case 2: {
                        m.opacity = r.uint32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        WallpaperSettings.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.WallpaperSettings)
                return d;
            var m = new $root.proto.WallpaperSettings();
            if (d.filename != null) {
                m.filename = String(d.filename);
            }
            if (d.opacity != null) {
                m.opacity = d.opacity >>> 0;
            }
            return m;
        };

        WallpaperSettings.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.filename != null && m.hasOwnProperty("filename")) {
                d.filename = m.filename;
                if (o.oneofs)
                    d._filename = "filename";
            }
            if (m.opacity != null && m.hasOwnProperty("opacity")) {
                d.opacity = m.opacity;
                if (o.oneofs)
                    d._opacity = "opacity";
            }
            return d;
        };

        WallpaperSettings.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        WallpaperSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.WallpaperSettings";
        };

        return WallpaperSettings;
    })();

    proto.WebFeatures = (function() {

        function WebFeatures(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        WebFeatures.prototype.labelsDisplay = null;
        WebFeatures.prototype.voipIndividualOutgoing = null;
        WebFeatures.prototype.groupsV3 = null;
        WebFeatures.prototype.groupsV3Create = null;
        WebFeatures.prototype.changeNumberV2 = null;
        WebFeatures.prototype.queryStatusV3Thumbnail = null;
        WebFeatures.prototype.liveLocations = null;
        WebFeatures.prototype.queryVname = null;
        WebFeatures.prototype.voipIndividualIncoming = null;
        WebFeatures.prototype.quickRepliesQuery = null;
        WebFeatures.prototype.payments = null;
        WebFeatures.prototype.stickerPackQuery = null;
        WebFeatures.prototype.liveLocationsFinal = null;
        WebFeatures.prototype.labelsEdit = null;
        WebFeatures.prototype.mediaUpload = null;
        WebFeatures.prototype.mediaUploadRichQuickReplies = null;
        WebFeatures.prototype.vnameV2 = null;
        WebFeatures.prototype.videoPlaybackUrl = null;
        WebFeatures.prototype.statusRanking = null;
        WebFeatures.prototype.voipIndividualVideo = null;
        WebFeatures.prototype.thirdPartyStickers = null;
        WebFeatures.prototype.frequentlyForwardedSetting = null;
        WebFeatures.prototype.groupsV4JoinPermission = null;
        WebFeatures.prototype.recentStickers = null;
        WebFeatures.prototype.catalog = null;
        WebFeatures.prototype.starredStickers = null;
        WebFeatures.prototype.voipGroupCall = null;
        WebFeatures.prototype.templateMessage = null;
        WebFeatures.prototype.templateMessageInteractivity = null;
        WebFeatures.prototype.ephemeralMessages = null;
        WebFeatures.prototype.e2ENotificationSync = null;
        WebFeatures.prototype.recentStickersV2 = null;
        WebFeatures.prototype.recentStickersV3 = null;
        WebFeatures.prototype.userNotice = null;
        WebFeatures.prototype.support = null;
        WebFeatures.prototype.groupUiiCleanup = null;
        WebFeatures.prototype.groupDogfoodingInternalOnly = null;
        WebFeatures.prototype.settingsSync = null;
        WebFeatures.prototype.archiveV2 = null;
        WebFeatures.prototype.ephemeralAllowGroupMembers = null;
        WebFeatures.prototype.ephemeral24HDuration = null;
        WebFeatures.prototype.mdForceUpgrade = null;
        WebFeatures.prototype.disappearingMode = null;
        WebFeatures.prototype.externalMdOptInAvailable = null;
        WebFeatures.prototype.noDeleteMessageTimeLimit = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_labelsDisplay", {
            get: $util.oneOfGetter($oneOfFields = ["labelsDisplay"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_voipIndividualOutgoing", {
            get: $util.oneOfGetter($oneOfFields = ["voipIndividualOutgoing"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_groupsV3", {
            get: $util.oneOfGetter($oneOfFields = ["groupsV3"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_groupsV3Create", {
            get: $util.oneOfGetter($oneOfFields = ["groupsV3Create"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_changeNumberV2", {
            get: $util.oneOfGetter($oneOfFields = ["changeNumberV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_queryStatusV3Thumbnail", {
            get: $util.oneOfGetter($oneOfFields = ["queryStatusV3Thumbnail"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_liveLocations", {
            get: $util.oneOfGetter($oneOfFields = ["liveLocations"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_queryVname", {
            get: $util.oneOfGetter($oneOfFields = ["queryVname"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_voipIndividualIncoming", {
            get: $util.oneOfGetter($oneOfFields = ["voipIndividualIncoming"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_quickRepliesQuery", {
            get: $util.oneOfGetter($oneOfFields = ["quickRepliesQuery"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_payments", {
            get: $util.oneOfGetter($oneOfFields = ["payments"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_stickerPackQuery", {
            get: $util.oneOfGetter($oneOfFields = ["stickerPackQuery"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_liveLocationsFinal", {
            get: $util.oneOfGetter($oneOfFields = ["liveLocationsFinal"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_labelsEdit", {
            get: $util.oneOfGetter($oneOfFields = ["labelsEdit"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_mediaUpload", {
            get: $util.oneOfGetter($oneOfFields = ["mediaUpload"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_mediaUploadRichQuickReplies", {
            get: $util.oneOfGetter($oneOfFields = ["mediaUploadRichQuickReplies"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_vnameV2", {
            get: $util.oneOfGetter($oneOfFields = ["vnameV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_videoPlaybackUrl", {
            get: $util.oneOfGetter($oneOfFields = ["videoPlaybackUrl"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_statusRanking", {
            get: $util.oneOfGetter($oneOfFields = ["statusRanking"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_voipIndividualVideo", {
            get: $util.oneOfGetter($oneOfFields = ["voipIndividualVideo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_thirdPartyStickers", {
            get: $util.oneOfGetter($oneOfFields = ["thirdPartyStickers"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_frequentlyForwardedSetting", {
            get: $util.oneOfGetter($oneOfFields = ["frequentlyForwardedSetting"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_groupsV4JoinPermission", {
            get: $util.oneOfGetter($oneOfFields = ["groupsV4JoinPermission"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_recentStickers", {
            get: $util.oneOfGetter($oneOfFields = ["recentStickers"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_catalog", {
            get: $util.oneOfGetter($oneOfFields = ["catalog"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_starredStickers", {
            get: $util.oneOfGetter($oneOfFields = ["starredStickers"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_voipGroupCall", {
            get: $util.oneOfGetter($oneOfFields = ["voipGroupCall"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_templateMessage", {
            get: $util.oneOfGetter($oneOfFields = ["templateMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_templateMessageInteractivity", {
            get: $util.oneOfGetter($oneOfFields = ["templateMessageInteractivity"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_ephemeralMessages", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralMessages"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_e2ENotificationSync", {
            get: $util.oneOfGetter($oneOfFields = ["e2ENotificationSync"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_recentStickersV2", {
            get: $util.oneOfGetter($oneOfFields = ["recentStickersV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_recentStickersV3", {
            get: $util.oneOfGetter($oneOfFields = ["recentStickersV3"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_userNotice", {
            get: $util.oneOfGetter($oneOfFields = ["userNotice"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_support", {
            get: $util.oneOfGetter($oneOfFields = ["support"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_groupUiiCleanup", {
            get: $util.oneOfGetter($oneOfFields = ["groupUiiCleanup"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_groupDogfoodingInternalOnly", {
            get: $util.oneOfGetter($oneOfFields = ["groupDogfoodingInternalOnly"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_settingsSync", {
            get: $util.oneOfGetter($oneOfFields = ["settingsSync"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_archiveV2", {
            get: $util.oneOfGetter($oneOfFields = ["archiveV2"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_ephemeralAllowGroupMembers", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralAllowGroupMembers"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_ephemeral24HDuration", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeral24HDuration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_mdForceUpgrade", {
            get: $util.oneOfGetter($oneOfFields = ["mdForceUpgrade"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_disappearingMode", {
            get: $util.oneOfGetter($oneOfFields = ["disappearingMode"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_externalMdOptInAvailable", {
            get: $util.oneOfGetter($oneOfFields = ["externalMdOptInAvailable"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebFeatures.prototype, "_noDeleteMessageTimeLimit", {
            get: $util.oneOfGetter($oneOfFields = ["noDeleteMessageTimeLimit"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        WebFeatures.create = function create(properties) {
            return new WebFeatures(properties);
        };

        WebFeatures.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.labelsDisplay != null && Object.hasOwnProperty.call(m, "labelsDisplay"))
                w.uint32(8).int32(m.labelsDisplay);
            if (m.voipIndividualOutgoing != null && Object.hasOwnProperty.call(m, "voipIndividualOutgoing"))
                w.uint32(16).int32(m.voipIndividualOutgoing);
            if (m.groupsV3 != null && Object.hasOwnProperty.call(m, "groupsV3"))
                w.uint32(24).int32(m.groupsV3);
            if (m.groupsV3Create != null && Object.hasOwnProperty.call(m, "groupsV3Create"))
                w.uint32(32).int32(m.groupsV3Create);
            if (m.changeNumberV2 != null && Object.hasOwnProperty.call(m, "changeNumberV2"))
                w.uint32(40).int32(m.changeNumberV2);
            if (m.queryStatusV3Thumbnail != null && Object.hasOwnProperty.call(m, "queryStatusV3Thumbnail"))
                w.uint32(48).int32(m.queryStatusV3Thumbnail);
            if (m.liveLocations != null && Object.hasOwnProperty.call(m, "liveLocations"))
                w.uint32(56).int32(m.liveLocations);
            if (m.queryVname != null && Object.hasOwnProperty.call(m, "queryVname"))
                w.uint32(64).int32(m.queryVname);
            if (m.voipIndividualIncoming != null && Object.hasOwnProperty.call(m, "voipIndividualIncoming"))
                w.uint32(72).int32(m.voipIndividualIncoming);
            if (m.quickRepliesQuery != null && Object.hasOwnProperty.call(m, "quickRepliesQuery"))
                w.uint32(80).int32(m.quickRepliesQuery);
            if (m.payments != null && Object.hasOwnProperty.call(m, "payments"))
                w.uint32(88).int32(m.payments);
            if (m.stickerPackQuery != null && Object.hasOwnProperty.call(m, "stickerPackQuery"))
                w.uint32(96).int32(m.stickerPackQuery);
            if (m.liveLocationsFinal != null && Object.hasOwnProperty.call(m, "liveLocationsFinal"))
                w.uint32(104).int32(m.liveLocationsFinal);
            if (m.labelsEdit != null && Object.hasOwnProperty.call(m, "labelsEdit"))
                w.uint32(112).int32(m.labelsEdit);
            if (m.mediaUpload != null && Object.hasOwnProperty.call(m, "mediaUpload"))
                w.uint32(120).int32(m.mediaUpload);
            if (m.mediaUploadRichQuickReplies != null && Object.hasOwnProperty.call(m, "mediaUploadRichQuickReplies"))
                w.uint32(144).int32(m.mediaUploadRichQuickReplies);
            if (m.vnameV2 != null && Object.hasOwnProperty.call(m, "vnameV2"))
                w.uint32(152).int32(m.vnameV2);
            if (m.videoPlaybackUrl != null && Object.hasOwnProperty.call(m, "videoPlaybackUrl"))
                w.uint32(160).int32(m.videoPlaybackUrl);
            if (m.statusRanking != null && Object.hasOwnProperty.call(m, "statusRanking"))
                w.uint32(168).int32(m.statusRanking);
            if (m.voipIndividualVideo != null && Object.hasOwnProperty.call(m, "voipIndividualVideo"))
                w.uint32(176).int32(m.voipIndividualVideo);
            if (m.thirdPartyStickers != null && Object.hasOwnProperty.call(m, "thirdPartyStickers"))
                w.uint32(184).int32(m.thirdPartyStickers);
            if (m.frequentlyForwardedSetting != null && Object.hasOwnProperty.call(m, "frequentlyForwardedSetting"))
                w.uint32(192).int32(m.frequentlyForwardedSetting);
            if (m.groupsV4JoinPermission != null && Object.hasOwnProperty.call(m, "groupsV4JoinPermission"))
                w.uint32(200).int32(m.groupsV4JoinPermission);
            if (m.recentStickers != null && Object.hasOwnProperty.call(m, "recentStickers"))
                w.uint32(208).int32(m.recentStickers);
            if (m.catalog != null && Object.hasOwnProperty.call(m, "catalog"))
                w.uint32(216).int32(m.catalog);
            if (m.starredStickers != null && Object.hasOwnProperty.call(m, "starredStickers"))
                w.uint32(224).int32(m.starredStickers);
            if (m.voipGroupCall != null && Object.hasOwnProperty.call(m, "voipGroupCall"))
                w.uint32(232).int32(m.voipGroupCall);
            if (m.templateMessage != null && Object.hasOwnProperty.call(m, "templateMessage"))
                w.uint32(240).int32(m.templateMessage);
            if (m.templateMessageInteractivity != null && Object.hasOwnProperty.call(m, "templateMessageInteractivity"))
                w.uint32(248).int32(m.templateMessageInteractivity);
            if (m.ephemeralMessages != null && Object.hasOwnProperty.call(m, "ephemeralMessages"))
                w.uint32(256).int32(m.ephemeralMessages);
            if (m.e2ENotificationSync != null && Object.hasOwnProperty.call(m, "e2ENotificationSync"))
                w.uint32(264).int32(m.e2ENotificationSync);
            if (m.recentStickersV2 != null && Object.hasOwnProperty.call(m, "recentStickersV2"))
                w.uint32(272).int32(m.recentStickersV2);
            if (m.recentStickersV3 != null && Object.hasOwnProperty.call(m, "recentStickersV3"))
                w.uint32(288).int32(m.recentStickersV3);
            if (m.userNotice != null && Object.hasOwnProperty.call(m, "userNotice"))
                w.uint32(296).int32(m.userNotice);
            if (m.support != null && Object.hasOwnProperty.call(m, "support"))
                w.uint32(312).int32(m.support);
            if (m.groupUiiCleanup != null && Object.hasOwnProperty.call(m, "groupUiiCleanup"))
                w.uint32(320).int32(m.groupUiiCleanup);
            if (m.groupDogfoodingInternalOnly != null && Object.hasOwnProperty.call(m, "groupDogfoodingInternalOnly"))
                w.uint32(328).int32(m.groupDogfoodingInternalOnly);
            if (m.settingsSync != null && Object.hasOwnProperty.call(m, "settingsSync"))
                w.uint32(336).int32(m.settingsSync);
            if (m.archiveV2 != null && Object.hasOwnProperty.call(m, "archiveV2"))
                w.uint32(344).int32(m.archiveV2);
            if (m.ephemeralAllowGroupMembers != null && Object.hasOwnProperty.call(m, "ephemeralAllowGroupMembers"))
                w.uint32(352).int32(m.ephemeralAllowGroupMembers);
            if (m.ephemeral24HDuration != null && Object.hasOwnProperty.call(m, "ephemeral24HDuration"))
                w.uint32(360).int32(m.ephemeral24HDuration);
            if (m.mdForceUpgrade != null && Object.hasOwnProperty.call(m, "mdForceUpgrade"))
                w.uint32(368).int32(m.mdForceUpgrade);
            if (m.disappearingMode != null && Object.hasOwnProperty.call(m, "disappearingMode"))
                w.uint32(376).int32(m.disappearingMode);
            if (m.externalMdOptInAvailable != null && Object.hasOwnProperty.call(m, "externalMdOptInAvailable"))
                w.uint32(384).int32(m.externalMdOptInAvailable);
            if (m.noDeleteMessageTimeLimit != null && Object.hasOwnProperty.call(m, "noDeleteMessageTimeLimit"))
                w.uint32(392).int32(m.noDeleteMessageTimeLimit);
            return w;
        };

        WebFeatures.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.WebFeatures();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.labelsDisplay = r.int32();
                        break;
                    }
                case 2: {
                        m.voipIndividualOutgoing = r.int32();
                        break;
                    }
                case 3: {
                        m.groupsV3 = r.int32();
                        break;
                    }
                case 4: {
                        m.groupsV3Create = r.int32();
                        break;
                    }
                case 5: {
                        m.changeNumberV2 = r.int32();
                        break;
                    }
                case 6: {
                        m.queryStatusV3Thumbnail = r.int32();
                        break;
                    }
                case 7: {
                        m.liveLocations = r.int32();
                        break;
                    }
                case 8: {
                        m.queryVname = r.int32();
                        break;
                    }
                case 9: {
                        m.voipIndividualIncoming = r.int32();
                        break;
                    }
                case 10: {
                        m.quickRepliesQuery = r.int32();
                        break;
                    }
                case 11: {
                        m.payments = r.int32();
                        break;
                    }
                case 12: {
                        m.stickerPackQuery = r.int32();
                        break;
                    }
                case 13: {
                        m.liveLocationsFinal = r.int32();
                        break;
                    }
                case 14: {
                        m.labelsEdit = r.int32();
                        break;
                    }
                case 15: {
                        m.mediaUpload = r.int32();
                        break;
                    }
                case 18: {
                        m.mediaUploadRichQuickReplies = r.int32();
                        break;
                    }
                case 19: {
                        m.vnameV2 = r.int32();
                        break;
                    }
                case 20: {
                        m.videoPlaybackUrl = r.int32();
                        break;
                    }
                case 21: {
                        m.statusRanking = r.int32();
                        break;
                    }
                case 22: {
                        m.voipIndividualVideo = r.int32();
                        break;
                    }
                case 23: {
                        m.thirdPartyStickers = r.int32();
                        break;
                    }
                case 24: {
                        m.frequentlyForwardedSetting = r.int32();
                        break;
                    }
                case 25: {
                        m.groupsV4JoinPermission = r.int32();
                        break;
                    }
                case 26: {
                        m.recentStickers = r.int32();
                        break;
                    }
                case 27: {
                        m.catalog = r.int32();
                        break;
                    }
                case 28: {
                        m.starredStickers = r.int32();
                        break;
                    }
                case 29: {
                        m.voipGroupCall = r.int32();
                        break;
                    }
                case 30: {
                        m.templateMessage = r.int32();
                        break;
                    }
                case 31: {
                        m.templateMessageInteractivity = r.int32();
                        break;
                    }
                case 32: {
                        m.ephemeralMessages = r.int32();
                        break;
                    }
                case 33: {
                        m.e2ENotificationSync = r.int32();
                        break;
                    }
                case 34: {
                        m.recentStickersV2 = r.int32();
                        break;
                    }
                case 36: {
                        m.recentStickersV3 = r.int32();
                        break;
                    }
                case 37: {
                        m.userNotice = r.int32();
                        break;
                    }
                case 39: {
                        m.support = r.int32();
                        break;
                    }
                case 40: {
                        m.groupUiiCleanup = r.int32();
                        break;
                    }
                case 41: {
                        m.groupDogfoodingInternalOnly = r.int32();
                        break;
                    }
                case 42: {
                        m.settingsSync = r.int32();
                        break;
                    }
                case 43: {
                        m.archiveV2 = r.int32();
                        break;
                    }
                case 44: {
                        m.ephemeralAllowGroupMembers = r.int32();
                        break;
                    }
                case 45: {
                        m.ephemeral24HDuration = r.int32();
                        break;
                    }
                case 46: {
                        m.mdForceUpgrade = r.int32();
                        break;
                    }
                case 47: {
                        m.disappearingMode = r.int32();
                        break;
                    }
                case 48: {
                        m.externalMdOptInAvailable = r.int32();
                        break;
                    }
                case 49: {
                        m.noDeleteMessageTimeLimit = r.int32();
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        WebFeatures.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.WebFeatures)
                return d;
            var m = new $root.proto.WebFeatures();
            switch (d.labelsDisplay) {
            default:
                if (typeof d.labelsDisplay === "number") {
                    m.labelsDisplay = d.labelsDisplay;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.labelsDisplay = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.labelsDisplay = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.labelsDisplay = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.labelsDisplay = 3;
                break;
            }
            switch (d.voipIndividualOutgoing) {
            default:
                if (typeof d.voipIndividualOutgoing === "number") {
                    m.voipIndividualOutgoing = d.voipIndividualOutgoing;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.voipIndividualOutgoing = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.voipIndividualOutgoing = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.voipIndividualOutgoing = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.voipIndividualOutgoing = 3;
                break;
            }
            switch (d.groupsV3) {
            default:
                if (typeof d.groupsV3 === "number") {
                    m.groupsV3 = d.groupsV3;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.groupsV3 = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.groupsV3 = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.groupsV3 = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.groupsV3 = 3;
                break;
            }
            switch (d.groupsV3Create) {
            default:
                if (typeof d.groupsV3Create === "number") {
                    m.groupsV3Create = d.groupsV3Create;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.groupsV3Create = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.groupsV3Create = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.groupsV3Create = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.groupsV3Create = 3;
                break;
            }
            switch (d.changeNumberV2) {
            default:
                if (typeof d.changeNumberV2 === "number") {
                    m.changeNumberV2 = d.changeNumberV2;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.changeNumberV2 = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.changeNumberV2 = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.changeNumberV2 = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.changeNumberV2 = 3;
                break;
            }
            switch (d.queryStatusV3Thumbnail) {
            default:
                if (typeof d.queryStatusV3Thumbnail === "number") {
                    m.queryStatusV3Thumbnail = d.queryStatusV3Thumbnail;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.queryStatusV3Thumbnail = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.queryStatusV3Thumbnail = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.queryStatusV3Thumbnail = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.queryStatusV3Thumbnail = 3;
                break;
            }
            switch (d.liveLocations) {
            default:
                if (typeof d.liveLocations === "number") {
                    m.liveLocations = d.liveLocations;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.liveLocations = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.liveLocations = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.liveLocations = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.liveLocations = 3;
                break;
            }
            switch (d.queryVname) {
            default:
                if (typeof d.queryVname === "number") {
                    m.queryVname = d.queryVname;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.queryVname = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.queryVname = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.queryVname = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.queryVname = 3;
                break;
            }
            switch (d.voipIndividualIncoming) {
            default:
                if (typeof d.voipIndividualIncoming === "number") {
                    m.voipIndividualIncoming = d.voipIndividualIncoming;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.voipIndividualIncoming = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.voipIndividualIncoming = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.voipIndividualIncoming = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.voipIndividualIncoming = 3;
                break;
            }
            switch (d.quickRepliesQuery) {
            default:
                if (typeof d.quickRepliesQuery === "number") {
                    m.quickRepliesQuery = d.quickRepliesQuery;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.quickRepliesQuery = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.quickRepliesQuery = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.quickRepliesQuery = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.quickRepliesQuery = 3;
                break;
            }
            switch (d.payments) {
            default:
                if (typeof d.payments === "number") {
                    m.payments = d.payments;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.payments = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.payments = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.payments = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.payments = 3;
                break;
            }
            switch (d.stickerPackQuery) {
            default:
                if (typeof d.stickerPackQuery === "number") {
                    m.stickerPackQuery = d.stickerPackQuery;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.stickerPackQuery = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.stickerPackQuery = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.stickerPackQuery = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.stickerPackQuery = 3;
                break;
            }
            switch (d.liveLocationsFinal) {
            default:
                if (typeof d.liveLocationsFinal === "number") {
                    m.liveLocationsFinal = d.liveLocationsFinal;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.liveLocationsFinal = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.liveLocationsFinal = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.liveLocationsFinal = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.liveLocationsFinal = 3;
                break;
            }
            switch (d.labelsEdit) {
            default:
                if (typeof d.labelsEdit === "number") {
                    m.labelsEdit = d.labelsEdit;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.labelsEdit = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.labelsEdit = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.labelsEdit = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.labelsEdit = 3;
                break;
            }
            switch (d.mediaUpload) {
            default:
                if (typeof d.mediaUpload === "number") {
                    m.mediaUpload = d.mediaUpload;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.mediaUpload = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.mediaUpload = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.mediaUpload = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.mediaUpload = 3;
                break;
            }
            switch (d.mediaUploadRichQuickReplies) {
            default:
                if (typeof d.mediaUploadRichQuickReplies === "number") {
                    m.mediaUploadRichQuickReplies = d.mediaUploadRichQuickReplies;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.mediaUploadRichQuickReplies = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.mediaUploadRichQuickReplies = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.mediaUploadRichQuickReplies = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.mediaUploadRichQuickReplies = 3;
                break;
            }
            switch (d.vnameV2) {
            default:
                if (typeof d.vnameV2 === "number") {
                    m.vnameV2 = d.vnameV2;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.vnameV2 = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.vnameV2 = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.vnameV2 = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.vnameV2 = 3;
                break;
            }
            switch (d.videoPlaybackUrl) {
            default:
                if (typeof d.videoPlaybackUrl === "number") {
                    m.videoPlaybackUrl = d.videoPlaybackUrl;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.videoPlaybackUrl = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.videoPlaybackUrl = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.videoPlaybackUrl = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.videoPlaybackUrl = 3;
                break;
            }
            switch (d.statusRanking) {
            default:
                if (typeof d.statusRanking === "number") {
                    m.statusRanking = d.statusRanking;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.statusRanking = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.statusRanking = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.statusRanking = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.statusRanking = 3;
                break;
            }
            switch (d.voipIndividualVideo) {
            default:
                if (typeof d.voipIndividualVideo === "number") {
                    m.voipIndividualVideo = d.voipIndividualVideo;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.voipIndividualVideo = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.voipIndividualVideo = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.voipIndividualVideo = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.voipIndividualVideo = 3;
                break;
            }
            switch (d.thirdPartyStickers) {
            default:
                if (typeof d.thirdPartyStickers === "number") {
                    m.thirdPartyStickers = d.thirdPartyStickers;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.thirdPartyStickers = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.thirdPartyStickers = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.thirdPartyStickers = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.thirdPartyStickers = 3;
                break;
            }
            switch (d.frequentlyForwardedSetting) {
            default:
                if (typeof d.frequentlyForwardedSetting === "number") {
                    m.frequentlyForwardedSetting = d.frequentlyForwardedSetting;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.frequentlyForwardedSetting = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.frequentlyForwardedSetting = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.frequentlyForwardedSetting = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.frequentlyForwardedSetting = 3;
                break;
            }
            switch (d.groupsV4JoinPermission) {
            default:
                if (typeof d.groupsV4JoinPermission === "number") {
                    m.groupsV4JoinPermission = d.groupsV4JoinPermission;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.groupsV4JoinPermission = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.groupsV4JoinPermission = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.groupsV4JoinPermission = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.groupsV4JoinPermission = 3;
                break;
            }
            switch (d.recentStickers) {
            default:
                if (typeof d.recentStickers === "number") {
                    m.recentStickers = d.recentStickers;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.recentStickers = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.recentStickers = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.recentStickers = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.recentStickers = 3;
                break;
            }
            switch (d.catalog) {
            default:
                if (typeof d.catalog === "number") {
                    m.catalog = d.catalog;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.catalog = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.catalog = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.catalog = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.catalog = 3;
                break;
            }
            switch (d.starredStickers) {
            default:
                if (typeof d.starredStickers === "number") {
                    m.starredStickers = d.starredStickers;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.starredStickers = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.starredStickers = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.starredStickers = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.starredStickers = 3;
                break;
            }
            switch (d.voipGroupCall) {
            default:
                if (typeof d.voipGroupCall === "number") {
                    m.voipGroupCall = d.voipGroupCall;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.voipGroupCall = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.voipGroupCall = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.voipGroupCall = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.voipGroupCall = 3;
                break;
            }
            switch (d.templateMessage) {
            default:
                if (typeof d.templateMessage === "number") {
                    m.templateMessage = d.templateMessage;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.templateMessage = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.templateMessage = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.templateMessage = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.templateMessage = 3;
                break;
            }
            switch (d.templateMessageInteractivity) {
            default:
                if (typeof d.templateMessageInteractivity === "number") {
                    m.templateMessageInteractivity = d.templateMessageInteractivity;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.templateMessageInteractivity = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.templateMessageInteractivity = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.templateMessageInteractivity = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.templateMessageInteractivity = 3;
                break;
            }
            switch (d.ephemeralMessages) {
            default:
                if (typeof d.ephemeralMessages === "number") {
                    m.ephemeralMessages = d.ephemeralMessages;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.ephemeralMessages = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.ephemeralMessages = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.ephemeralMessages = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.ephemeralMessages = 3;
                break;
            }
            switch (d.e2ENotificationSync) {
            default:
                if (typeof d.e2ENotificationSync === "number") {
                    m.e2ENotificationSync = d.e2ENotificationSync;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.e2ENotificationSync = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.e2ENotificationSync = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.e2ENotificationSync = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.e2ENotificationSync = 3;
                break;
            }
            switch (d.recentStickersV2) {
            default:
                if (typeof d.recentStickersV2 === "number") {
                    m.recentStickersV2 = d.recentStickersV2;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.recentStickersV2 = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.recentStickersV2 = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.recentStickersV2 = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.recentStickersV2 = 3;
                break;
            }
            switch (d.recentStickersV3) {
            default:
                if (typeof d.recentStickersV3 === "number") {
                    m.recentStickersV3 = d.recentStickersV3;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.recentStickersV3 = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.recentStickersV3 = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.recentStickersV3 = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.recentStickersV3 = 3;
                break;
            }
            switch (d.userNotice) {
            default:
                if (typeof d.userNotice === "number") {
                    m.userNotice = d.userNotice;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.userNotice = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.userNotice = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.userNotice = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.userNotice = 3;
                break;
            }
            switch (d.support) {
            default:
                if (typeof d.support === "number") {
                    m.support = d.support;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.support = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.support = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.support = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.support = 3;
                break;
            }
            switch (d.groupUiiCleanup) {
            default:
                if (typeof d.groupUiiCleanup === "number") {
                    m.groupUiiCleanup = d.groupUiiCleanup;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.groupUiiCleanup = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.groupUiiCleanup = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.groupUiiCleanup = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.groupUiiCleanup = 3;
                break;
            }
            switch (d.groupDogfoodingInternalOnly) {
            default:
                if (typeof d.groupDogfoodingInternalOnly === "number") {
                    m.groupDogfoodingInternalOnly = d.groupDogfoodingInternalOnly;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.groupDogfoodingInternalOnly = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.groupDogfoodingInternalOnly = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.groupDogfoodingInternalOnly = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.groupDogfoodingInternalOnly = 3;
                break;
            }
            switch (d.settingsSync) {
            default:
                if (typeof d.settingsSync === "number") {
                    m.settingsSync = d.settingsSync;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.settingsSync = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.settingsSync = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.settingsSync = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.settingsSync = 3;
                break;
            }
            switch (d.archiveV2) {
            default:
                if (typeof d.archiveV2 === "number") {
                    m.archiveV2 = d.archiveV2;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.archiveV2 = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.archiveV2 = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.archiveV2 = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.archiveV2 = 3;
                break;
            }
            switch (d.ephemeralAllowGroupMembers) {
            default:
                if (typeof d.ephemeralAllowGroupMembers === "number") {
                    m.ephemeralAllowGroupMembers = d.ephemeralAllowGroupMembers;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.ephemeralAllowGroupMembers = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.ephemeralAllowGroupMembers = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.ephemeralAllowGroupMembers = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.ephemeralAllowGroupMembers = 3;
                break;
            }
            switch (d.ephemeral24HDuration) {
            default:
                if (typeof d.ephemeral24HDuration === "number") {
                    m.ephemeral24HDuration = d.ephemeral24HDuration;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.ephemeral24HDuration = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.ephemeral24HDuration = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.ephemeral24HDuration = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.ephemeral24HDuration = 3;
                break;
            }
            switch (d.mdForceUpgrade) {
            default:
                if (typeof d.mdForceUpgrade === "number") {
                    m.mdForceUpgrade = d.mdForceUpgrade;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.mdForceUpgrade = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.mdForceUpgrade = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.mdForceUpgrade = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.mdForceUpgrade = 3;
                break;
            }
            switch (d.disappearingMode) {
            default:
                if (typeof d.disappearingMode === "number") {
                    m.disappearingMode = d.disappearingMode;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.disappearingMode = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.disappearingMode = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.disappearingMode = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.disappearingMode = 3;
                break;
            }
            switch (d.externalMdOptInAvailable) {
            default:
                if (typeof d.externalMdOptInAvailable === "number") {
                    m.externalMdOptInAvailable = d.externalMdOptInAvailable;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.externalMdOptInAvailable = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.externalMdOptInAvailable = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.externalMdOptInAvailable = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.externalMdOptInAvailable = 3;
                break;
            }
            switch (d.noDeleteMessageTimeLimit) {
            default:
                if (typeof d.noDeleteMessageTimeLimit === "number") {
                    m.noDeleteMessageTimeLimit = d.noDeleteMessageTimeLimit;
                    break;
                }
                break;
            case "NOT_STARTED":
            case 0:
                m.noDeleteMessageTimeLimit = 0;
                break;
            case "FORCE_UPGRADE":
            case 1:
                m.noDeleteMessageTimeLimit = 1;
                break;
            case "DEVELOPMENT":
            case 2:
                m.noDeleteMessageTimeLimit = 2;
                break;
            case "PRODUCTION":
            case 3:
                m.noDeleteMessageTimeLimit = 3;
                break;
            }
            return m;
        };

        WebFeatures.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (m.labelsDisplay != null && m.hasOwnProperty("labelsDisplay")) {
                d.labelsDisplay = o.enums === String ? $root.proto.WebFeatures.Flag[m.labelsDisplay] === undefined ? m.labelsDisplay : $root.proto.WebFeatures.Flag[m.labelsDisplay] : m.labelsDisplay;
                if (o.oneofs)
                    d._labelsDisplay = "labelsDisplay";
            }
            if (m.voipIndividualOutgoing != null && m.hasOwnProperty("voipIndividualOutgoing")) {
                d.voipIndividualOutgoing = o.enums === String ? $root.proto.WebFeatures.Flag[m.voipIndividualOutgoing] === undefined ? m.voipIndividualOutgoing : $root.proto.WebFeatures.Flag[m.voipIndividualOutgoing] : m.voipIndividualOutgoing;
                if (o.oneofs)
                    d._voipIndividualOutgoing = "voipIndividualOutgoing";
            }
            if (m.groupsV3 != null && m.hasOwnProperty("groupsV3")) {
                d.groupsV3 = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupsV3] === undefined ? m.groupsV3 : $root.proto.WebFeatures.Flag[m.groupsV3] : m.groupsV3;
                if (o.oneofs)
                    d._groupsV3 = "groupsV3";
            }
            if (m.groupsV3Create != null && m.hasOwnProperty("groupsV3Create")) {
                d.groupsV3Create = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupsV3Create] === undefined ? m.groupsV3Create : $root.proto.WebFeatures.Flag[m.groupsV3Create] : m.groupsV3Create;
                if (o.oneofs)
                    d._groupsV3Create = "groupsV3Create";
            }
            if (m.changeNumberV2 != null && m.hasOwnProperty("changeNumberV2")) {
                d.changeNumberV2 = o.enums === String ? $root.proto.WebFeatures.Flag[m.changeNumberV2] === undefined ? m.changeNumberV2 : $root.proto.WebFeatures.Flag[m.changeNumberV2] : m.changeNumberV2;
                if (o.oneofs)
                    d._changeNumberV2 = "changeNumberV2";
            }
            if (m.queryStatusV3Thumbnail != null && m.hasOwnProperty("queryStatusV3Thumbnail")) {
                d.queryStatusV3Thumbnail = o.enums === String ? $root.proto.WebFeatures.Flag[m.queryStatusV3Thumbnail] === undefined ? m.queryStatusV3Thumbnail : $root.proto.WebFeatures.Flag[m.queryStatusV3Thumbnail] : m.queryStatusV3Thumbnail;
                if (o.oneofs)
                    d._queryStatusV3Thumbnail = "queryStatusV3Thumbnail";
            }
            if (m.liveLocations != null && m.hasOwnProperty("liveLocations")) {
                d.liveLocations = o.enums === String ? $root.proto.WebFeatures.Flag[m.liveLocations] === undefined ? m.liveLocations : $root.proto.WebFeatures.Flag[m.liveLocations] : m.liveLocations;
                if (o.oneofs)
                    d._liveLocations = "liveLocations";
            }
            if (m.queryVname != null && m.hasOwnProperty("queryVname")) {
                d.queryVname = o.enums === String ? $root.proto.WebFeatures.Flag[m.queryVname] === undefined ? m.queryVname : $root.proto.WebFeatures.Flag[m.queryVname] : m.queryVname;
                if (o.oneofs)
                    d._queryVname = "queryVname";
            }
            if (m.voipIndividualIncoming != null && m.hasOwnProperty("voipIndividualIncoming")) {
                d.voipIndividualIncoming = o.enums === String ? $root.proto.WebFeatures.Flag[m.voipIndividualIncoming] === undefined ? m.voipIndividualIncoming : $root.proto.WebFeatures.Flag[m.voipIndividualIncoming] : m.voipIndividualIncoming;
                if (o.oneofs)
                    d._voipIndividualIncoming = "voipIndividualIncoming";
            }
            if (m.quickRepliesQuery != null && m.hasOwnProperty("quickRepliesQuery")) {
                d.quickRepliesQuery = o.enums === String ? $root.proto.WebFeatures.Flag[m.quickRepliesQuery] === undefined ? m.quickRepliesQuery : $root.proto.WebFeatures.Flag[m.quickRepliesQuery] : m.quickRepliesQuery;
                if (o.oneofs)
                    d._quickRepliesQuery = "quickRepliesQuery";
            }
            if (m.payments != null && m.hasOwnProperty("payments")) {
                d.payments = o.enums === String ? $root.proto.WebFeatures.Flag[m.payments] === undefined ? m.payments : $root.proto.WebFeatures.Flag[m.payments] : m.payments;
                if (o.oneofs)
                    d._payments = "payments";
            }
            if (m.stickerPackQuery != null && m.hasOwnProperty("stickerPackQuery")) {
                d.stickerPackQuery = o.enums === String ? $root.proto.WebFeatures.Flag[m.stickerPackQuery] === undefined ? m.stickerPackQuery : $root.proto.WebFeatures.Flag[m.stickerPackQuery] : m.stickerPackQuery;
                if (o.oneofs)
                    d._stickerPackQuery = "stickerPackQuery";
            }
            if (m.liveLocationsFinal != null && m.hasOwnProperty("liveLocationsFinal")) {
                d.liveLocationsFinal = o.enums === String ? $root.proto.WebFeatures.Flag[m.liveLocationsFinal] === undefined ? m.liveLocationsFinal : $root.proto.WebFeatures.Flag[m.liveLocationsFinal] : m.liveLocationsFinal;
                if (o.oneofs)
                    d._liveLocationsFinal = "liveLocationsFinal";
            }
            if (m.labelsEdit != null && m.hasOwnProperty("labelsEdit")) {
                d.labelsEdit = o.enums === String ? $root.proto.WebFeatures.Flag[m.labelsEdit] === undefined ? m.labelsEdit : $root.proto.WebFeatures.Flag[m.labelsEdit] : m.labelsEdit;
                if (o.oneofs)
                    d._labelsEdit = "labelsEdit";
            }
            if (m.mediaUpload != null && m.hasOwnProperty("mediaUpload")) {
                d.mediaUpload = o.enums === String ? $root.proto.WebFeatures.Flag[m.mediaUpload] === undefined ? m.mediaUpload : $root.proto.WebFeatures.Flag[m.mediaUpload] : m.mediaUpload;
                if (o.oneofs)
                    d._mediaUpload = "mediaUpload";
            }
            if (m.mediaUploadRichQuickReplies != null && m.hasOwnProperty("mediaUploadRichQuickReplies")) {
                d.mediaUploadRichQuickReplies = o.enums === String ? $root.proto.WebFeatures.Flag[m.mediaUploadRichQuickReplies] === undefined ? m.mediaUploadRichQuickReplies : $root.proto.WebFeatures.Flag[m.mediaUploadRichQuickReplies] : m.mediaUploadRichQuickReplies;
                if (o.oneofs)
                    d._mediaUploadRichQuickReplies = "mediaUploadRichQuickReplies";
            }
            if (m.vnameV2 != null && m.hasOwnProperty("vnameV2")) {
                d.vnameV2 = o.enums === String ? $root.proto.WebFeatures.Flag[m.vnameV2] === undefined ? m.vnameV2 : $root.proto.WebFeatures.Flag[m.vnameV2] : m.vnameV2;
                if (o.oneofs)
                    d._vnameV2 = "vnameV2";
            }
            if (m.videoPlaybackUrl != null && m.hasOwnProperty("videoPlaybackUrl")) {
                d.videoPlaybackUrl = o.enums === String ? $root.proto.WebFeatures.Flag[m.videoPlaybackUrl] === undefined ? m.videoPlaybackUrl : $root.proto.WebFeatures.Flag[m.videoPlaybackUrl] : m.videoPlaybackUrl;
                if (o.oneofs)
                    d._videoPlaybackUrl = "videoPlaybackUrl";
            }
            if (m.statusRanking != null && m.hasOwnProperty("statusRanking")) {
                d.statusRanking = o.enums === String ? $root.proto.WebFeatures.Flag[m.statusRanking] === undefined ? m.statusRanking : $root.proto.WebFeatures.Flag[m.statusRanking] : m.statusRanking;
                if (o.oneofs)
                    d._statusRanking = "statusRanking";
            }
            if (m.voipIndividualVideo != null && m.hasOwnProperty("voipIndividualVideo")) {
                d.voipIndividualVideo = o.enums === String ? $root.proto.WebFeatures.Flag[m.voipIndividualVideo] === undefined ? m.voipIndividualVideo : $root.proto.WebFeatures.Flag[m.voipIndividualVideo] : m.voipIndividualVideo;
                if (o.oneofs)
                    d._voipIndividualVideo = "voipIndividualVideo";
            }
            if (m.thirdPartyStickers != null && m.hasOwnProperty("thirdPartyStickers")) {
                d.thirdPartyStickers = o.enums === String ? $root.proto.WebFeatures.Flag[m.thirdPartyStickers] === undefined ? m.thirdPartyStickers : $root.proto.WebFeatures.Flag[m.thirdPartyStickers] : m.thirdPartyStickers;
                if (o.oneofs)
                    d._thirdPartyStickers = "thirdPartyStickers";
            }
            if (m.frequentlyForwardedSetting != null && m.hasOwnProperty("frequentlyForwardedSetting")) {
                d.frequentlyForwardedSetting = o.enums === String ? $root.proto.WebFeatures.Flag[m.frequentlyForwardedSetting] === undefined ? m.frequentlyForwardedSetting : $root.proto.WebFeatures.Flag[m.frequentlyForwardedSetting] : m.frequentlyForwardedSetting;
                if (o.oneofs)
                    d._frequentlyForwardedSetting = "frequentlyForwardedSetting";
            }
            if (m.groupsV4JoinPermission != null && m.hasOwnProperty("groupsV4JoinPermission")) {
                d.groupsV4JoinPermission = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupsV4JoinPermission] === undefined ? m.groupsV4JoinPermission : $root.proto.WebFeatures.Flag[m.groupsV4JoinPermission] : m.groupsV4JoinPermission;
                if (o.oneofs)
                    d._groupsV4JoinPermission = "groupsV4JoinPermission";
            }
            if (m.recentStickers != null && m.hasOwnProperty("recentStickers")) {
                d.recentStickers = o.enums === String ? $root.proto.WebFeatures.Flag[m.recentStickers] === undefined ? m.recentStickers : $root.proto.WebFeatures.Flag[m.recentStickers] : m.recentStickers;
                if (o.oneofs)
                    d._recentStickers = "recentStickers";
            }
            if (m.catalog != null && m.hasOwnProperty("catalog")) {
                d.catalog = o.enums === String ? $root.proto.WebFeatures.Flag[m.catalog] === undefined ? m.catalog : $root.proto.WebFeatures.Flag[m.catalog] : m.catalog;
                if (o.oneofs)
                    d._catalog = "catalog";
            }
            if (m.starredStickers != null && m.hasOwnProperty("starredStickers")) {
                d.starredStickers = o.enums === String ? $root.proto.WebFeatures.Flag[m.starredStickers] === undefined ? m.starredStickers : $root.proto.WebFeatures.Flag[m.starredStickers] : m.starredStickers;
                if (o.oneofs)
                    d._starredStickers = "starredStickers";
            }
            if (m.voipGroupCall != null && m.hasOwnProperty("voipGroupCall")) {
                d.voipGroupCall = o.enums === String ? $root.proto.WebFeatures.Flag[m.voipGroupCall] === undefined ? m.voipGroupCall : $root.proto.WebFeatures.Flag[m.voipGroupCall] : m.voipGroupCall;
                if (o.oneofs)
                    d._voipGroupCall = "voipGroupCall";
            }
            if (m.templateMessage != null && m.hasOwnProperty("templateMessage")) {
                d.templateMessage = o.enums === String ? $root.proto.WebFeatures.Flag[m.templateMessage] === undefined ? m.templateMessage : $root.proto.WebFeatures.Flag[m.templateMessage] : m.templateMessage;
                if (o.oneofs)
                    d._templateMessage = "templateMessage";
            }
            if (m.templateMessageInteractivity != null && m.hasOwnProperty("templateMessageInteractivity")) {
                d.templateMessageInteractivity = o.enums === String ? $root.proto.WebFeatures.Flag[m.templateMessageInteractivity] === undefined ? m.templateMessageInteractivity : $root.proto.WebFeatures.Flag[m.templateMessageInteractivity] : m.templateMessageInteractivity;
                if (o.oneofs)
                    d._templateMessageInteractivity = "templateMessageInteractivity";
            }
            if (m.ephemeralMessages != null && m.hasOwnProperty("ephemeralMessages")) {
                d.ephemeralMessages = o.enums === String ? $root.proto.WebFeatures.Flag[m.ephemeralMessages] === undefined ? m.ephemeralMessages : $root.proto.WebFeatures.Flag[m.ephemeralMessages] : m.ephemeralMessages;
                if (o.oneofs)
                    d._ephemeralMessages = "ephemeralMessages";
            }
            if (m.e2ENotificationSync != null && m.hasOwnProperty("e2ENotificationSync")) {
                d.e2ENotificationSync = o.enums === String ? $root.proto.WebFeatures.Flag[m.e2ENotificationSync] === undefined ? m.e2ENotificationSync : $root.proto.WebFeatures.Flag[m.e2ENotificationSync] : m.e2ENotificationSync;
                if (o.oneofs)
                    d._e2ENotificationSync = "e2ENotificationSync";
            }
            if (m.recentStickersV2 != null && m.hasOwnProperty("recentStickersV2")) {
                d.recentStickersV2 = o.enums === String ? $root.proto.WebFeatures.Flag[m.recentStickersV2] === undefined ? m.recentStickersV2 : $root.proto.WebFeatures.Flag[m.recentStickersV2] : m.recentStickersV2;
                if (o.oneofs)
                    d._recentStickersV2 = "recentStickersV2";
            }
            if (m.recentStickersV3 != null && m.hasOwnProperty("recentStickersV3")) {
                d.recentStickersV3 = o.enums === String ? $root.proto.WebFeatures.Flag[m.recentStickersV3] === undefined ? m.recentStickersV3 : $root.proto.WebFeatures.Flag[m.recentStickersV3] : m.recentStickersV3;
                if (o.oneofs)
                    d._recentStickersV3 = "recentStickersV3";
            }
            if (m.userNotice != null && m.hasOwnProperty("userNotice")) {
                d.userNotice = o.enums === String ? $root.proto.WebFeatures.Flag[m.userNotice] === undefined ? m.userNotice : $root.proto.WebFeatures.Flag[m.userNotice] : m.userNotice;
                if (o.oneofs)
                    d._userNotice = "userNotice";
            }
            if (m.support != null && m.hasOwnProperty("support")) {
                d.support = o.enums === String ? $root.proto.WebFeatures.Flag[m.support] === undefined ? m.support : $root.proto.WebFeatures.Flag[m.support] : m.support;
                if (o.oneofs)
                    d._support = "support";
            }
            if (m.groupUiiCleanup != null && m.hasOwnProperty("groupUiiCleanup")) {
                d.groupUiiCleanup = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupUiiCleanup] === undefined ? m.groupUiiCleanup : $root.proto.WebFeatures.Flag[m.groupUiiCleanup] : m.groupUiiCleanup;
                if (o.oneofs)
                    d._groupUiiCleanup = "groupUiiCleanup";
            }
            if (m.groupDogfoodingInternalOnly != null && m.hasOwnProperty("groupDogfoodingInternalOnly")) {
                d.groupDogfoodingInternalOnly = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupDogfoodingInternalOnly] === undefined ? m.groupDogfoodingInternalOnly : $root.proto.WebFeatures.Flag[m.groupDogfoodingInternalOnly] : m.groupDogfoodingInternalOnly;
                if (o.oneofs)
                    d._groupDogfoodingInternalOnly = "groupDogfoodingInternalOnly";
            }
            if (m.settingsSync != null && m.hasOwnProperty("settingsSync")) {
                d.settingsSync = o.enums === String ? $root.proto.WebFeatures.Flag[m.settingsSync] === undefined ? m.settingsSync : $root.proto.WebFeatures.Flag[m.settingsSync] : m.settingsSync;
                if (o.oneofs)
                    d._settingsSync = "settingsSync";
            }
            if (m.archiveV2 != null && m.hasOwnProperty("archiveV2")) {
                d.archiveV2 = o.enums === String ? $root.proto.WebFeatures.Flag[m.archiveV2] === undefined ? m.archiveV2 : $root.proto.WebFeatures.Flag[m.archiveV2] : m.archiveV2;
                if (o.oneofs)
                    d._archiveV2 = "archiveV2";
            }
            if (m.ephemeralAllowGroupMembers != null && m.hasOwnProperty("ephemeralAllowGroupMembers")) {
                d.ephemeralAllowGroupMembers = o.enums === String ? $root.proto.WebFeatures.Flag[m.ephemeralAllowGroupMembers] === undefined ? m.ephemeralAllowGroupMembers : $root.proto.WebFeatures.Flag[m.ephemeralAllowGroupMembers] : m.ephemeralAllowGroupMembers;
                if (o.oneofs)
                    d._ephemeralAllowGroupMembers = "ephemeralAllowGroupMembers";
            }
            if (m.ephemeral24HDuration != null && m.hasOwnProperty("ephemeral24HDuration")) {
                d.ephemeral24HDuration = o.enums === String ? $root.proto.WebFeatures.Flag[m.ephemeral24HDuration] === undefined ? m.ephemeral24HDuration : $root.proto.WebFeatures.Flag[m.ephemeral24HDuration] : m.ephemeral24HDuration;
                if (o.oneofs)
                    d._ephemeral24HDuration = "ephemeral24HDuration";
            }
            if (m.mdForceUpgrade != null && m.hasOwnProperty("mdForceUpgrade")) {
                d.mdForceUpgrade = o.enums === String ? $root.proto.WebFeatures.Flag[m.mdForceUpgrade] === undefined ? m.mdForceUpgrade : $root.proto.WebFeatures.Flag[m.mdForceUpgrade] : m.mdForceUpgrade;
                if (o.oneofs)
                    d._mdForceUpgrade = "mdForceUpgrade";
            }
            if (m.disappearingMode != null && m.hasOwnProperty("disappearingMode")) {
                d.disappearingMode = o.enums === String ? $root.proto.WebFeatures.Flag[m.disappearingMode] === undefined ? m.disappearingMode : $root.proto.WebFeatures.Flag[m.disappearingMode] : m.disappearingMode;
                if (o.oneofs)
                    d._disappearingMode = "disappearingMode";
            }
            if (m.externalMdOptInAvailable != null && m.hasOwnProperty("externalMdOptInAvailable")) {
                d.externalMdOptInAvailable = o.enums === String ? $root.proto.WebFeatures.Flag[m.externalMdOptInAvailable] === undefined ? m.externalMdOptInAvailable : $root.proto.WebFeatures.Flag[m.externalMdOptInAvailable] : m.externalMdOptInAvailable;
                if (o.oneofs)
                    d._externalMdOptInAvailable = "externalMdOptInAvailable";
            }
            if (m.noDeleteMessageTimeLimit != null && m.hasOwnProperty("noDeleteMessageTimeLimit")) {
                d.noDeleteMessageTimeLimit = o.enums === String ? $root.proto.WebFeatures.Flag[m.noDeleteMessageTimeLimit] === undefined ? m.noDeleteMessageTimeLimit : $root.proto.WebFeatures.Flag[m.noDeleteMessageTimeLimit] : m.noDeleteMessageTimeLimit;
                if (o.oneofs)
                    d._noDeleteMessageTimeLimit = "noDeleteMessageTimeLimit";
            }
            return d;
        };

        WebFeatures.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        WebFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.WebFeatures";
        };

        WebFeatures.Flag = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "NOT_STARTED"] = 0;
            values[valuesById[1] = "FORCE_UPGRADE"] = 1;
            values[valuesById[2] = "DEVELOPMENT"] = 2;
            values[valuesById[3] = "PRODUCTION"] = 3;
            return values;
        })();

        return WebFeatures;
    })();

    proto.WebLinkRenderConfig = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "WEBVIEW"] = 0;
        values[valuesById[1] = "SYSTEM"] = 1;
        return values;
    })();

    proto.WebMessageInfo = (function() {

        function WebMessageInfo(p) {
            this.messageStubParameters = [];
            this.labels = [];
            this.userReceipt = [];
            this.reactions = [];
            this.pollUpdates = [];
            this.eventResponses = [];
            this.statusMentions = [];
            this.messageAddOns = [];
            this.statusMentionSources = [];
            this.supportAiCitations = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        WebMessageInfo.prototype.key = null;
        WebMessageInfo.prototype.message = null;
        WebMessageInfo.prototype.messageTimestamp = null;
        WebMessageInfo.prototype.status = null;
        WebMessageInfo.prototype.participant = null;
        WebMessageInfo.prototype.messageC2STimestamp = null;
        WebMessageInfo.prototype.ignore = null;
        WebMessageInfo.prototype.starred = null;
        WebMessageInfo.prototype.broadcast = null;
        WebMessageInfo.prototype.pushName = null;
        WebMessageInfo.prototype.mediaCiphertextSha256 = null;
        WebMessageInfo.prototype.multicast = null;
        WebMessageInfo.prototype.urlText = null;
        WebMessageInfo.prototype.urlNumber = null;
        WebMessageInfo.prototype.messageStubType = null;
        WebMessageInfo.prototype.clearMedia = null;
        WebMessageInfo.prototype.messageStubParameters = $util.emptyArray;
        WebMessageInfo.prototype.duration = null;
        WebMessageInfo.prototype.labels = $util.emptyArray;
        WebMessageInfo.prototype.paymentInfo = null;
        WebMessageInfo.prototype.finalLiveLocation = null;
        WebMessageInfo.prototype.quotedPaymentInfo = null;
        WebMessageInfo.prototype.ephemeralStartTimestamp = null;
        WebMessageInfo.prototype.ephemeralDuration = null;
        WebMessageInfo.prototype.ephemeralOffToOn = null;
        WebMessageInfo.prototype.ephemeralOutOfSync = null;
        WebMessageInfo.prototype.bizPrivacyStatus = null;
        WebMessageInfo.prototype.verifiedBizName = null;
        WebMessageInfo.prototype.mediaData = null;
        WebMessageInfo.prototype.photoChange = null;
        WebMessageInfo.prototype.userReceipt = $util.emptyArray;
        WebMessageInfo.prototype.reactions = $util.emptyArray;
        WebMessageInfo.prototype.quotedStickerData = null;
        WebMessageInfo.prototype.futureproofData = null;
        WebMessageInfo.prototype.statusPsa = null;
        WebMessageInfo.prototype.pollUpdates = $util.emptyArray;
        WebMessageInfo.prototype.pollAdditionalMetadata = null;
        WebMessageInfo.prototype.agentId = null;
        WebMessageInfo.prototype.statusAlreadyViewed = null;
        WebMessageInfo.prototype.messageSecret = null;
        WebMessageInfo.prototype.keepInChat = null;
        WebMessageInfo.prototype.originalSelfAuthorUserJidString = null;
        WebMessageInfo.prototype.revokeMessageTimestamp = null;
        WebMessageInfo.prototype.pinInChat = null;
        WebMessageInfo.prototype.premiumMessageInfo = null;
        WebMessageInfo.prototype.is1PBizBotMessage = null;
        WebMessageInfo.prototype.isGroupHistoryMessage = null;
        WebMessageInfo.prototype.botMessageInvokerJid = null;
        WebMessageInfo.prototype.commentMetadata = null;
        WebMessageInfo.prototype.eventResponses = $util.emptyArray;
        WebMessageInfo.prototype.reportingTokenInfo = null;
        WebMessageInfo.prototype.newsletterServerId = null;
        WebMessageInfo.prototype.eventAdditionalMetadata = null;
        WebMessageInfo.prototype.isMentionedInStatus = null;
        WebMessageInfo.prototype.statusMentions = $util.emptyArray;
        WebMessageInfo.prototype.targetMessageId = null;
        WebMessageInfo.prototype.messageAddOns = $util.emptyArray;
        WebMessageInfo.prototype.statusMentionMessageInfo = null;
        WebMessageInfo.prototype.isSupportAiMessage = null;
        WebMessageInfo.prototype.statusMentionSources = $util.emptyArray;
        WebMessageInfo.prototype.supportAiCitations = $util.emptyArray;
        WebMessageInfo.prototype.botTargetId = null;
        WebMessageInfo.prototype.groupHistoryIndividualMessageInfo = null;
        WebMessageInfo.prototype.groupHistoryBundleInfo = null;
        WebMessageInfo.prototype.interactiveMessageAdditionalMetadata = null;
        WebMessageInfo.prototype.quarantinedMessage = null;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_message", {
            get: $util.oneOfGetter($oneOfFields = ["message"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_messageTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["messageTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_status", {
            get: $util.oneOfGetter($oneOfFields = ["status"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_participant", {
            get: $util.oneOfGetter($oneOfFields = ["participant"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_messageC2STimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["messageC2STimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_ignore", {
            get: $util.oneOfGetter($oneOfFields = ["ignore"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_starred", {
            get: $util.oneOfGetter($oneOfFields = ["starred"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_broadcast", {
            get: $util.oneOfGetter($oneOfFields = ["broadcast"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_pushName", {
            get: $util.oneOfGetter($oneOfFields = ["pushName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_mediaCiphertextSha256", {
            get: $util.oneOfGetter($oneOfFields = ["mediaCiphertextSha256"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_multicast", {
            get: $util.oneOfGetter($oneOfFields = ["multicast"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_urlText", {
            get: $util.oneOfGetter($oneOfFields = ["urlText"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_urlNumber", {
            get: $util.oneOfGetter($oneOfFields = ["urlNumber"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_messageStubType", {
            get: $util.oneOfGetter($oneOfFields = ["messageStubType"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_clearMedia", {
            get: $util.oneOfGetter($oneOfFields = ["clearMedia"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_duration", {
            get: $util.oneOfGetter($oneOfFields = ["duration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_paymentInfo", {
            get: $util.oneOfGetter($oneOfFields = ["paymentInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_finalLiveLocation", {
            get: $util.oneOfGetter($oneOfFields = ["finalLiveLocation"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_quotedPaymentInfo", {
            get: $util.oneOfGetter($oneOfFields = ["quotedPaymentInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_ephemeralStartTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralStartTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_ephemeralDuration", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralDuration"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_ephemeralOffToOn", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralOffToOn"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_ephemeralOutOfSync", {
            get: $util.oneOfGetter($oneOfFields = ["ephemeralOutOfSync"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_bizPrivacyStatus", {
            get: $util.oneOfGetter($oneOfFields = ["bizPrivacyStatus"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_verifiedBizName", {
            get: $util.oneOfGetter($oneOfFields = ["verifiedBizName"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_mediaData", {
            get: $util.oneOfGetter($oneOfFields = ["mediaData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_photoChange", {
            get: $util.oneOfGetter($oneOfFields = ["photoChange"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_quotedStickerData", {
            get: $util.oneOfGetter($oneOfFields = ["quotedStickerData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_futureproofData", {
            get: $util.oneOfGetter($oneOfFields = ["futureproofData"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_statusPsa", {
            get: $util.oneOfGetter($oneOfFields = ["statusPsa"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_pollAdditionalMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["pollAdditionalMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_agentId", {
            get: $util.oneOfGetter($oneOfFields = ["agentId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_statusAlreadyViewed", {
            get: $util.oneOfGetter($oneOfFields = ["statusAlreadyViewed"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_messageSecret", {
            get: $util.oneOfGetter($oneOfFields = ["messageSecret"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_keepInChat", {
            get: $util.oneOfGetter($oneOfFields = ["keepInChat"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_originalSelfAuthorUserJidString", {
            get: $util.oneOfGetter($oneOfFields = ["originalSelfAuthorUserJidString"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_revokeMessageTimestamp", {
            get: $util.oneOfGetter($oneOfFields = ["revokeMessageTimestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_pinInChat", {
            get: $util.oneOfGetter($oneOfFields = ["pinInChat"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_premiumMessageInfo", {
            get: $util.oneOfGetter($oneOfFields = ["premiumMessageInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_is1PBizBotMessage", {
            get: $util.oneOfGetter($oneOfFields = ["is1PBizBotMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_isGroupHistoryMessage", {
            get: $util.oneOfGetter($oneOfFields = ["isGroupHistoryMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_botMessageInvokerJid", {
            get: $util.oneOfGetter($oneOfFields = ["botMessageInvokerJid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_commentMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["commentMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_reportingTokenInfo", {
            get: $util.oneOfGetter($oneOfFields = ["reportingTokenInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_newsletterServerId", {
            get: $util.oneOfGetter($oneOfFields = ["newsletterServerId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_eventAdditionalMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["eventAdditionalMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_isMentionedInStatus", {
            get: $util.oneOfGetter($oneOfFields = ["isMentionedInStatus"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_targetMessageId", {
            get: $util.oneOfGetter($oneOfFields = ["targetMessageId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_statusMentionMessageInfo", {
            get: $util.oneOfGetter($oneOfFields = ["statusMentionMessageInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_isSupportAiMessage", {
            get: $util.oneOfGetter($oneOfFields = ["isSupportAiMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_botTargetId", {
            get: $util.oneOfGetter($oneOfFields = ["botTargetId"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_groupHistoryIndividualMessageInfo", {
            get: $util.oneOfGetter($oneOfFields = ["groupHistoryIndividualMessageInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_groupHistoryBundleInfo", {
            get: $util.oneOfGetter($oneOfFields = ["groupHistoryBundleInfo"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_interactiveMessageAdditionalMetadata", {
            get: $util.oneOfGetter($oneOfFields = ["interactiveMessageAdditionalMetadata"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebMessageInfo.prototype, "_quarantinedMessage", {
            get: $util.oneOfGetter($oneOfFields = ["quarantinedMessage"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        WebMessageInfo.create = function create(properties) {
            return new WebMessageInfo(properties);
        };

        WebMessageInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.key != null && Object.hasOwnProperty.call(m, "key"))
                $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim();
            if (m.message != null && Object.hasOwnProperty.call(m, "message"))
                $root.proto.Message.encode(m.message, w.uint32(18).fork()).ldelim();
            if (m.messageTimestamp != null && Object.hasOwnProperty.call(m, "messageTimestamp"))
                w.uint32(24).uint64(m.messageTimestamp);
            if (m.status != null && Object.hasOwnProperty.call(m, "status"))
                w.uint32(32).int32(m.status);
            if (m.participant != null && Object.hasOwnProperty.call(m, "participant"))
                w.uint32(42).string(m.participant);
            if (m.messageC2STimestamp != null && Object.hasOwnProperty.call(m, "messageC2STimestamp"))
                w.uint32(48).uint64(m.messageC2STimestamp);
            if (m.ignore != null && Object.hasOwnProperty.call(m, "ignore"))
                w.uint32(128).bool(m.ignore);
            if (m.starred != null && Object.hasOwnProperty.call(m, "starred"))
                w.uint32(136).bool(m.starred);
            if (m.broadcast != null && Object.hasOwnProperty.call(m, "broadcast"))
                w.uint32(144).bool(m.broadcast);
            if (m.pushName != null && Object.hasOwnProperty.call(m, "pushName"))
                w.uint32(154).string(m.pushName);
            if (m.mediaCiphertextSha256 != null && Object.hasOwnProperty.call(m, "mediaCiphertextSha256"))
                w.uint32(162).bytes(m.mediaCiphertextSha256);
            if (m.multicast != null && Object.hasOwnProperty.call(m, "multicast"))
                w.uint32(168).bool(m.multicast);
            if (m.urlText != null && Object.hasOwnProperty.call(m, "urlText"))
                w.uint32(176).bool(m.urlText);
            if (m.urlNumber != null && Object.hasOwnProperty.call(m, "urlNumber"))
                w.uint32(184).bool(m.urlNumber);
            if (m.messageStubType != null && Object.hasOwnProperty.call(m, "messageStubType"))
                w.uint32(192).int32(m.messageStubType);
            if (m.clearMedia != null && Object.hasOwnProperty.call(m, "clearMedia"))
                w.uint32(200).bool(m.clearMedia);
            if (m.messageStubParameters != null && m.messageStubParameters.length) {
                for (var i = 0; i < m.messageStubParameters.length; ++i)
                    w.uint32(210).string(m.messageStubParameters[i]);
            }
            if (m.duration != null && Object.hasOwnProperty.call(m, "duration"))
                w.uint32(216).uint32(m.duration);
            if (m.labels != null && m.labels.length) {
                for (var i = 0; i < m.labels.length; ++i)
                    w.uint32(226).string(m.labels[i]);
            }
            if (m.paymentInfo != null && Object.hasOwnProperty.call(m, "paymentInfo"))
                $root.proto.PaymentInfo.encode(m.paymentInfo, w.uint32(234).fork()).ldelim();
            if (m.finalLiveLocation != null && Object.hasOwnProperty.call(m, "finalLiveLocation"))
                $root.proto.Message.LiveLocationMessage.encode(m.finalLiveLocation, w.uint32(242).fork()).ldelim();
            if (m.quotedPaymentInfo != null && Object.hasOwnProperty.call(m, "quotedPaymentInfo"))
                $root.proto.PaymentInfo.encode(m.quotedPaymentInfo, w.uint32(250).fork()).ldelim();
            if (m.ephemeralStartTimestamp != null && Object.hasOwnProperty.call(m, "ephemeralStartTimestamp"))
                w.uint32(256).uint64(m.ephemeralStartTimestamp);
            if (m.ephemeralDuration != null && Object.hasOwnProperty.call(m, "ephemeralDuration"))
                w.uint32(264).uint32(m.ephemeralDuration);
            if (m.ephemeralOffToOn != null && Object.hasOwnProperty.call(m, "ephemeralOffToOn"))
                w.uint32(272).bool(m.ephemeralOffToOn);
            if (m.ephemeralOutOfSync != null && Object.hasOwnProperty.call(m, "ephemeralOutOfSync"))
                w.uint32(280).bool(m.ephemeralOutOfSync);
            if (m.bizPrivacyStatus != null && Object.hasOwnProperty.call(m, "bizPrivacyStatus"))
                w.uint32(288).int32(m.bizPrivacyStatus);
            if (m.verifiedBizName != null && Object.hasOwnProperty.call(m, "verifiedBizName"))
                w.uint32(298).string(m.verifiedBizName);
            if (m.mediaData != null && Object.hasOwnProperty.call(m, "mediaData"))
                $root.proto.MediaData.encode(m.mediaData, w.uint32(306).fork()).ldelim();
            if (m.photoChange != null && Object.hasOwnProperty.call(m, "photoChange"))
                $root.proto.PhotoChange.encode(m.photoChange, w.uint32(314).fork()).ldelim();
            if (m.userReceipt != null && m.userReceipt.length) {
                for (var i = 0; i < m.userReceipt.length; ++i)
                    $root.proto.UserReceipt.encode(m.userReceipt[i], w.uint32(322).fork()).ldelim();
            }
            if (m.reactions != null && m.reactions.length) {
                for (var i = 0; i < m.reactions.length; ++i)
                    $root.proto.Reaction.encode(m.reactions[i], w.uint32(330).fork()).ldelim();
            }
            if (m.quotedStickerData != null && Object.hasOwnProperty.call(m, "quotedStickerData"))
                $root.proto.MediaData.encode(m.quotedStickerData, w.uint32(338).fork()).ldelim();
            if (m.futureproofData != null && Object.hasOwnProperty.call(m, "futureproofData"))
                w.uint32(346).bytes(m.futureproofData);
            if (m.statusPsa != null && Object.hasOwnProperty.call(m, "statusPsa"))
                $root.proto.StatusPSA.encode(m.statusPsa, w.uint32(354).fork()).ldelim();
            if (m.pollUpdates != null && m.pollUpdates.length) {
                for (var i = 0; i < m.pollUpdates.length; ++i)
                    $root.proto.PollUpdate.encode(m.pollUpdates[i], w.uint32(362).fork()).ldelim();
            }
            if (m.pollAdditionalMetadata != null && Object.hasOwnProperty.call(m, "pollAdditionalMetadata"))
                $root.proto.PollAdditionalMetadata.encode(m.pollAdditionalMetadata, w.uint32(370).fork()).ldelim();
            if (m.agentId != null && Object.hasOwnProperty.call(m, "agentId"))
                w.uint32(378).string(m.agentId);
            if (m.statusAlreadyViewed != null && Object.hasOwnProperty.call(m, "statusAlreadyViewed"))
                w.uint32(384).bool(m.statusAlreadyViewed);
            if (m.messageSecret != null && Object.hasOwnProperty.call(m, "messageSecret"))
                w.uint32(394).bytes(m.messageSecret);
            if (m.keepInChat != null && Object.hasOwnProperty.call(m, "keepInChat"))
                $root.proto.KeepInChat.encode(m.keepInChat, w.uint32(402).fork()).ldelim();
            if (m.originalSelfAuthorUserJidString != null && Object.hasOwnProperty.call(m, "originalSelfAuthorUserJidString"))
                w.uint32(410).string(m.originalSelfAuthorUserJidString);
            if (m.revokeMessageTimestamp != null && Object.hasOwnProperty.call(m, "revokeMessageTimestamp"))
                w.uint32(416).uint64(m.revokeMessageTimestamp);
            if (m.pinInChat != null && Object.hasOwnProperty.call(m, "pinInChat"))
                $root.proto.PinInChat.encode(m.pinInChat, w.uint32(434).fork()).ldelim();
            if (m.premiumMessageInfo != null && Object.hasOwnProperty.call(m, "premiumMessageInfo"))
                $root.proto.PremiumMessageInfo.encode(m.premiumMessageInfo, w.uint32(442).fork()).ldelim();
            if (m.is1PBizBotMessage != null && Object.hasOwnProperty.call(m, "is1PBizBotMessage"))
                w.uint32(448).bool(m.is1PBizBotMessage);
            if (m.isGroupHistoryMessage != null && Object.hasOwnProperty.call(m, "isGroupHistoryMessage"))
                w.uint32(456).bool(m.isGroupHistoryMessage);
            if (m.botMessageInvokerJid != null && Object.hasOwnProperty.call(m, "botMessageInvokerJid"))
                w.uint32(466).string(m.botMessageInvokerJid);
            if (m.commentMetadata != null && Object.hasOwnProperty.call(m, "commentMetadata"))
                $root.proto.CommentMetadata.encode(m.commentMetadata, w.uint32(474).fork()).ldelim();
            if (m.eventResponses != null && m.eventResponses.length) {
                for (var i = 0; i < m.eventResponses.length; ++i)
                    $root.proto.EventResponse.encode(m.eventResponses[i], w.uint32(490).fork()).ldelim();
            }
            if (m.reportingTokenInfo != null && Object.hasOwnProperty.call(m, "reportingTokenInfo"))
                $root.proto.ReportingTokenInfo.encode(m.reportingTokenInfo, w.uint32(498).fork()).ldelim();
            if (m.newsletterServerId != null && Object.hasOwnProperty.call(m, "newsletterServerId"))
                w.uint32(504).uint64(m.newsletterServerId);
            if (m.eventAdditionalMetadata != null && Object.hasOwnProperty.call(m, "eventAdditionalMetadata"))
                $root.proto.EventAdditionalMetadata.encode(m.eventAdditionalMetadata, w.uint32(514).fork()).ldelim();
            if (m.isMentionedInStatus != null && Object.hasOwnProperty.call(m, "isMentionedInStatus"))
                w.uint32(520).bool(m.isMentionedInStatus);
            if (m.statusMentions != null && m.statusMentions.length) {
                for (var i = 0; i < m.statusMentions.length; ++i)
                    w.uint32(530).string(m.statusMentions[i]);
            }
            if (m.targetMessageId != null && Object.hasOwnProperty.call(m, "targetMessageId"))
                $root.proto.MessageKey.encode(m.targetMessageId, w.uint32(538).fork()).ldelim();
            if (m.messageAddOns != null && m.messageAddOns.length) {
                for (var i = 0; i < m.messageAddOns.length; ++i)
                    $root.proto.MessageAddOn.encode(m.messageAddOns[i], w.uint32(546).fork()).ldelim();
            }
            if (m.statusMentionMessageInfo != null && Object.hasOwnProperty.call(m, "statusMentionMessageInfo"))
                $root.proto.StatusMentionMessage.encode(m.statusMentionMessageInfo, w.uint32(554).fork()).ldelim();
            if (m.isSupportAiMessage != null && Object.hasOwnProperty.call(m, "isSupportAiMessage"))
                w.uint32(560).bool(m.isSupportAiMessage);
            if (m.statusMentionSources != null && m.statusMentionSources.length) {
                for (var i = 0; i < m.statusMentionSources.length; ++i)
                    w.uint32(570).string(m.statusMentionSources[i]);
            }
            if (m.supportAiCitations != null && m.supportAiCitations.length) {
                for (var i = 0; i < m.supportAiCitations.length; ++i)
                    $root.proto.Citation.encode(m.supportAiCitations[i], w.uint32(578).fork()).ldelim();
            }
            if (m.botTargetId != null && Object.hasOwnProperty.call(m, "botTargetId"))
                w.uint32(586).string(m.botTargetId);
            if (m.groupHistoryIndividualMessageInfo != null && Object.hasOwnProperty.call(m, "groupHistoryIndividualMessageInfo"))
                $root.proto.GroupHistoryIndividualMessageInfo.encode(m.groupHistoryIndividualMessageInfo, w.uint32(594).fork()).ldelim();
            if (m.groupHistoryBundleInfo != null && Object.hasOwnProperty.call(m, "groupHistoryBundleInfo"))
                $root.proto.GroupHistoryBundleInfo.encode(m.groupHistoryBundleInfo, w.uint32(602).fork()).ldelim();
            if (m.interactiveMessageAdditionalMetadata != null && Object.hasOwnProperty.call(m, "interactiveMessageAdditionalMetadata"))
                $root.proto.InteractiveMessageAdditionalMetadata.encode(m.interactiveMessageAdditionalMetadata, w.uint32(610).fork()).ldelim();
            if (m.quarantinedMessage != null && Object.hasOwnProperty.call(m, "quarantinedMessage"))
                $root.proto.QuarantinedMessage.encode(m.quarantinedMessage, w.uint32(618).fork()).ldelim();
            return w;
        };

        WebMessageInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.WebMessageInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 1: {
                        m.key = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 2: {
                        m.message = $root.proto.Message.decode(r, r.uint32());
                        break;
                    }
                case 3: {
                        m.messageTimestamp = r.uint64();
                        break;
                    }
                case 4: {
                        m.status = r.int32();
                        break;
                    }
                case 5: {
                        m.participant = r.string();
                        break;
                    }
                case 6: {
                        m.messageC2STimestamp = r.uint64();
                        break;
                    }
                case 16: {
                        m.ignore = r.bool();
                        break;
                    }
                case 17: {
                        m.starred = r.bool();
                        break;
                    }
                case 18: {
                        m.broadcast = r.bool();
                        break;
                    }
                case 19: {
                        m.pushName = r.string();
                        break;
                    }
                case 20: {
                        m.mediaCiphertextSha256 = r.bytes();
                        break;
                    }
                case 21: {
                        m.multicast = r.bool();
                        break;
                    }
                case 22: {
                        m.urlText = r.bool();
                        break;
                    }
                case 23: {
                        m.urlNumber = r.bool();
                        break;
                    }
                case 24: {
                        m.messageStubType = r.int32();
                        break;
                    }
                case 25: {
                        m.clearMedia = r.bool();
                        break;
                    }
                case 26: {
                        if (!(m.messageStubParameters && m.messageStubParameters.length))
                            m.messageStubParameters = [];
                        m.messageStubParameters.push(r.string());
                        break;
                    }
                case 27: {
                        m.duration = r.uint32();
                        break;
                    }
                case 28: {
                        if (!(m.labels && m.labels.length))
                            m.labels = [];
                        m.labels.push(r.string());
                        break;
                    }
                case 29: {
                        m.paymentInfo = $root.proto.PaymentInfo.decode(r, r.uint32());
                        break;
                    }
                case 30: {
                        m.finalLiveLocation = $root.proto.Message.LiveLocationMessage.decode(r, r.uint32());
                        break;
                    }
                case 31: {
                        m.quotedPaymentInfo = $root.proto.PaymentInfo.decode(r, r.uint32());
                        break;
                    }
                case 32: {
                        m.ephemeralStartTimestamp = r.uint64();
                        break;
                    }
                case 33: {
                        m.ephemeralDuration = r.uint32();
                        break;
                    }
                case 34: {
                        m.ephemeralOffToOn = r.bool();
                        break;
                    }
                case 35: {
                        m.ephemeralOutOfSync = r.bool();
                        break;
                    }
                case 36: {
                        m.bizPrivacyStatus = r.int32();
                        break;
                    }
                case 37: {
                        m.verifiedBizName = r.string();
                        break;
                    }
                case 38: {
                        m.mediaData = $root.proto.MediaData.decode(r, r.uint32());
                        break;
                    }
                case 39: {
                        m.photoChange = $root.proto.PhotoChange.decode(r, r.uint32());
                        break;
                    }
                case 40: {
                        if (!(m.userReceipt && m.userReceipt.length))
                            m.userReceipt = [];
                        m.userReceipt.push($root.proto.UserReceipt.decode(r, r.uint32()));
                        break;
                    }
                case 41: {
                        if (!(m.reactions && m.reactions.length))
                            m.reactions = [];
                        m.reactions.push($root.proto.Reaction.decode(r, r.uint32()));
                        break;
                    }
                case 42: {
                        m.quotedStickerData = $root.proto.MediaData.decode(r, r.uint32());
                        break;
                    }
                case 43: {
                        m.futureproofData = r.bytes();
                        break;
                    }
                case 44: {
                        m.statusPsa = $root.proto.StatusPSA.decode(r, r.uint32());
                        break;
                    }
                case 45: {
                        if (!(m.pollUpdates && m.pollUpdates.length))
                            m.pollUpdates = [];
                        m.pollUpdates.push($root.proto.PollUpdate.decode(r, r.uint32()));
                        break;
                    }
                case 46: {
                        m.pollAdditionalMetadata = $root.proto.PollAdditionalMetadata.decode(r, r.uint32());
                        break;
                    }
                case 47: {
                        m.agentId = r.string();
                        break;
                    }
                case 48: {
                        m.statusAlreadyViewed = r.bool();
                        break;
                    }
                case 49: {
                        m.messageSecret = r.bytes();
                        break;
                    }
                case 50: {
                        m.keepInChat = $root.proto.KeepInChat.decode(r, r.uint32());
                        break;
                    }
                case 51: {
                        m.originalSelfAuthorUserJidString = r.string();
                        break;
                    }
                case 52: {
                        m.revokeMessageTimestamp = r.uint64();
                        break;
                    }
                case 54: {
                        m.pinInChat = $root.proto.PinInChat.decode(r, r.uint32());
                        break;
                    }
                case 55: {
                        m.premiumMessageInfo = $root.proto.PremiumMessageInfo.decode(r, r.uint32());
                        break;
                    }
                case 56: {
                        m.is1PBizBotMessage = r.bool();
                        break;
                    }
                case 57: {
                        m.isGroupHistoryMessage = r.bool();
                        break;
                    }
                case 58: {
                        m.botMessageInvokerJid = r.string();
                        break;
                    }
                case 59: {
                        m.commentMetadata = $root.proto.CommentMetadata.decode(r, r.uint32());
                        break;
                    }
                case 61: {
                        if (!(m.eventResponses && m.eventResponses.length))
                            m.eventResponses = [];
                        m.eventResponses.push($root.proto.EventResponse.decode(r, r.uint32()));
                        break;
                    }
                case 62: {
                        m.reportingTokenInfo = $root.proto.ReportingTokenInfo.decode(r, r.uint32());
                        break;
                    }
                case 63: {
                        m.newsletterServerId = r.uint64();
                        break;
                    }
                case 64: {
                        m.eventAdditionalMetadata = $root.proto.EventAdditionalMetadata.decode(r, r.uint32());
                        break;
                    }
                case 65: {
                        m.isMentionedInStatus = r.bool();
                        break;
                    }
                case 66: {
                        if (!(m.statusMentions && m.statusMentions.length))
                            m.statusMentions = [];
                        m.statusMentions.push(r.string());
                        break;
                    }
                case 67: {
                        m.targetMessageId = $root.proto.MessageKey.decode(r, r.uint32());
                        break;
                    }
                case 68: {
                        if (!(m.messageAddOns && m.messageAddOns.length))
                            m.messageAddOns = [];
                        m.messageAddOns.push($root.proto.MessageAddOn.decode(r, r.uint32()));
                        break;
                    }
                case 69: {
                        m.statusMentionMessageInfo = $root.proto.StatusMentionMessage.decode(r, r.uint32());
                        break;
                    }
                case 70: {
                        m.isSupportAiMessage = r.bool();
                        break;
                    }
                case 71: {
                        if (!(m.statusMentionSources && m.statusMentionSources.length))
                            m.statusMentionSources = [];
                        m.statusMentionSources.push(r.string());
                        break;
                    }
                case 72: {
                        if (!(m.supportAiCitations && m.supportAiCitations.length))
                            m.supportAiCitations = [];
                        m.supportAiCitations.push($root.proto.Citation.decode(r, r.uint32()));
                        break;
                    }
                case 73: {
                        m.botTargetId = r.string();
                        break;
                    }
                case 74: {
                        m.groupHistoryIndividualMessageInfo = $root.proto.GroupHistoryIndividualMessageInfo.decode(r, r.uint32());
                        break;
                    }
                case 75: {
                        m.groupHistoryBundleInfo = $root.proto.GroupHistoryBundleInfo.decode(r, r.uint32());
                        break;
                    }
                case 76: {
                        m.interactiveMessageAdditionalMetadata = $root.proto.InteractiveMessageAdditionalMetadata.decode(r, r.uint32());
                        break;
                    }
                case 77: {
                        m.quarantinedMessage = $root.proto.QuarantinedMessage.decode(r, r.uint32());
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        WebMessageInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.WebMessageInfo)
                return d;
            var m = new $root.proto.WebMessageInfo();
            if (d.key != null) {
                if (typeof d.key !== "object")
                    throw TypeError(".proto.WebMessageInfo.key: object expected");
                m.key = $root.proto.MessageKey.fromObject(d.key);
            }
            if (d.message != null) {
                if (typeof d.message !== "object")
                    throw TypeError(".proto.WebMessageInfo.message: object expected");
                m.message = $root.proto.Message.fromObject(d.message);
            }
            if (d.messageTimestamp != null) {
                if ($util.Long)
                    (m.messageTimestamp = $util.Long.fromValue(d.messageTimestamp)).unsigned = true;
                else if (typeof d.messageTimestamp === "string")
                    m.messageTimestamp = parseInt(d.messageTimestamp, 10);
                else if (typeof d.messageTimestamp === "number")
                    m.messageTimestamp = d.messageTimestamp;
                else if (typeof d.messageTimestamp === "object")
                    m.messageTimestamp = new $util.LongBits(d.messageTimestamp.low >>> 0, d.messageTimestamp.high >>> 0).toNumber(true);
            }
            switch (d.status) {
            default:
                if (typeof d.status === "number") {
                    m.status = d.status;
                    break;
                }
                break;
            case "ERROR":
            case 0:
                m.status = 0;
                break;
            case "PENDING":
            case 1:
                m.status = 1;
                break;
            case "SERVER_ACK":
            case 2:
                m.status = 2;
                break;
            case "DELIVERY_ACK":
            case 3:
                m.status = 3;
                break;
            case "READ":
            case 4:
                m.status = 4;
                break;
            case "PLAYED":
            case 5:
                m.status = 5;
                break;
            }
            if (d.participant != null) {
                m.participant = String(d.participant);
            }
            if (d.messageC2STimestamp != null) {
                if ($util.Long)
                    (m.messageC2STimestamp = $util.Long.fromValue(d.messageC2STimestamp)).unsigned = true;
                else if (typeof d.messageC2STimestamp === "string")
                    m.messageC2STimestamp = parseInt(d.messageC2STimestamp, 10);
                else if (typeof d.messageC2STimestamp === "number")
                    m.messageC2STimestamp = d.messageC2STimestamp;
                else if (typeof d.messageC2STimestamp === "object")
                    m.messageC2STimestamp = new $util.LongBits(d.messageC2STimestamp.low >>> 0, d.messageC2STimestamp.high >>> 0).toNumber(true);
            }
            if (d.ignore != null) {
                m.ignore = Boolean(d.ignore);
            }
            if (d.starred != null) {
                m.starred = Boolean(d.starred);
            }
            if (d.broadcast != null) {
                m.broadcast = Boolean(d.broadcast);
            }
            if (d.pushName != null) {
                m.pushName = String(d.pushName);
            }
            if (d.mediaCiphertextSha256 != null) {
                if (typeof d.mediaCiphertextSha256 === "string")
                    $util.base64.decode(d.mediaCiphertextSha256, m.mediaCiphertextSha256 = $util.newBuffer($util.base64.length(d.mediaCiphertextSha256)), 0);
                else if (d.mediaCiphertextSha256.length >= 0)
                    m.mediaCiphertextSha256 = d.mediaCiphertextSha256;
            }
            if (d.multicast != null) {
                m.multicast = Boolean(d.multicast);
            }
            if (d.urlText != null) {
                m.urlText = Boolean(d.urlText);
            }
            if (d.urlNumber != null) {
                m.urlNumber = Boolean(d.urlNumber);
            }
            switch (d.messageStubType) {
            default:
                if (typeof d.messageStubType === "number") {
                    m.messageStubType = d.messageStubType;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                m.messageStubType = 0;
                break;
            case "REVOKE":
            case 1:
                m.messageStubType = 1;
                break;
            case "CIPHERTEXT":
            case 2:
                m.messageStubType = 2;
                break;
            case "FUTUREPROOF":
            case 3:
                m.messageStubType = 3;
                break;
            case "NON_VERIFIED_TRANSITION":
            case 4:
                m.messageStubType = 4;
                break;
            case "UNVERIFIED_TRANSITION":
            case 5:
                m.messageStubType = 5;
                break;
            case "VERIFIED_TRANSITION":
            case 6:
                m.messageStubType = 6;
                break;
            case "VERIFIED_LOW_UNKNOWN":
            case 7:
                m.messageStubType = 7;
                break;
            case "VERIFIED_HIGH":
            case 8:
                m.messageStubType = 8;
                break;
            case "VERIFIED_INITIAL_UNKNOWN":
            case 9:
                m.messageStubType = 9;
                break;
            case "VERIFIED_INITIAL_LOW":
            case 10:
                m.messageStubType = 10;
                break;
            case "VERIFIED_INITIAL_HIGH":
            case 11:
                m.messageStubType = 11;
                break;
            case "VERIFIED_TRANSITION_ANY_TO_NONE":
            case 12:
                m.messageStubType = 12;
                break;
            case "VERIFIED_TRANSITION_ANY_TO_HIGH":
            case 13:
                m.messageStubType = 13;
                break;
            case "VERIFIED_TRANSITION_HIGH_TO_LOW":
            case 14:
                m.messageStubType = 14;
                break;
            case "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN":
            case 15:
                m.messageStubType = 15;
                break;
            case "VERIFIED_TRANSITION_UNKNOWN_TO_LOW":
            case 16:
                m.messageStubType = 16;
                break;
            case "VERIFIED_TRANSITION_LOW_TO_UNKNOWN":
            case 17:
                m.messageStubType = 17;
                break;
            case "VERIFIED_TRANSITION_NONE_TO_LOW":
            case 18:
                m.messageStubType = 18;
                break;
            case "VERIFIED_TRANSITION_NONE_TO_UNKNOWN":
            case 19:
                m.messageStubType = 19;
                break;
            case "GROUP_CREATE":
            case 20:
                m.messageStubType = 20;
                break;
            case "GROUP_CHANGE_SUBJECT":
            case 21:
                m.messageStubType = 21;
                break;
            case "GROUP_CHANGE_ICON":
            case 22:
                m.messageStubType = 22;
                break;
            case "GROUP_CHANGE_INVITE_LINK":
            case 23:
                m.messageStubType = 23;
                break;
            case "GROUP_CHANGE_DESCRIPTION":
            case 24:
                m.messageStubType = 24;
                break;
            case "GROUP_CHANGE_RESTRICT":
            case 25:
                m.messageStubType = 25;
                break;
            case "GROUP_CHANGE_ANNOUNCE":
            case 26:
                m.messageStubType = 26;
                break;
            case "GROUP_PARTICIPANT_ADD":
            case 27:
                m.messageStubType = 27;
                break;
            case "GROUP_PARTICIPANT_REMOVE":
            case 28:
                m.messageStubType = 28;
                break;
            case "GROUP_PARTICIPANT_PROMOTE":
            case 29:
                m.messageStubType = 29;
                break;
            case "GROUP_PARTICIPANT_DEMOTE":
            case 30:
                m.messageStubType = 30;
                break;
            case "GROUP_PARTICIPANT_INVITE":
            case 31:
                m.messageStubType = 31;
                break;
            case "GROUP_PARTICIPANT_LEAVE":
            case 32:
                m.messageStubType = 32;
                break;
            case "GROUP_PARTICIPANT_CHANGE_NUMBER":
            case 33:
                m.messageStubType = 33;
                break;
            case "BROADCAST_CREATE":
            case 34:
                m.messageStubType = 34;
                break;
            case "BROADCAST_ADD":
            case 35:
                m.messageStubType = 35;
                break;
            case "BROADCAST_REMOVE":
            case 36:
                m.messageStubType = 36;
                break;
            case "GENERIC_NOTIFICATION":
            case 37:
                m.messageStubType = 37;
                break;
            case "E2E_IDENTITY_CHANGED":
            case 38:
                m.messageStubType = 38;
                break;
            case "E2E_ENCRYPTED":
            case 39:
                m.messageStubType = 39;
                break;
            case "CALL_MISSED_VOICE":
            case 40:
                m.messageStubType = 40;
                break;
            case "CALL_MISSED_VIDEO":
            case 41:
                m.messageStubType = 41;
                break;
            case "INDIVIDUAL_CHANGE_NUMBER":
            case 42:
                m.messageStubType = 42;
                break;
            case "GROUP_DELETE":
            case 43:
                m.messageStubType = 43;
                break;
            case "GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE":
            case 44:
                m.messageStubType = 44;
                break;
            case "CALL_MISSED_GROUP_VOICE":
            case 45:
                m.messageStubType = 45;
                break;
            case "CALL_MISSED_GROUP_VIDEO":
            case 46:
                m.messageStubType = 46;
                break;
            case "PAYMENT_CIPHERTEXT":
            case 47:
                m.messageStubType = 47;
                break;
            case "PAYMENT_FUTUREPROOF":
            case 48:
                m.messageStubType = 48;
                break;
            case "PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED":
            case 49:
                m.messageStubType = 49;
                break;
            case "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED":
            case 50:
                m.messageStubType = 50;
                break;
            case "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED":
            case 51:
                m.messageStubType = 51;
                break;
            case "PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP":
            case 52:
                m.messageStubType = 52;
                break;
            case "PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP":
            case 53:
                m.messageStubType = 53;
                break;
            case "PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER":
            case 54:
                m.messageStubType = 54;
                break;
            case "PAYMENT_ACTION_SEND_PAYMENT_REMINDER":
            case 55:
                m.messageStubType = 55;
                break;
            case "PAYMENT_ACTION_SEND_PAYMENT_INVITATION":
            case 56:
                m.messageStubType = 56;
                break;
            case "PAYMENT_ACTION_REQUEST_DECLINED":
            case 57:
                m.messageStubType = 57;
                break;
            case "PAYMENT_ACTION_REQUEST_EXPIRED":
            case 58:
                m.messageStubType = 58;
                break;
            case "PAYMENT_ACTION_REQUEST_CANCELLED":
            case 59:
                m.messageStubType = 59;
                break;
            case "BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM":
            case 60:
                m.messageStubType = 60;
                break;
            case "BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP":
            case 61:
                m.messageStubType = 61;
                break;
            case "BIZ_INTRO_TOP":
            case 62:
                m.messageStubType = 62;
                break;
            case "BIZ_INTRO_BOTTOM":
            case 63:
                m.messageStubType = 63;
                break;
            case "BIZ_NAME_CHANGE":
            case 64:
                m.messageStubType = 64;
                break;
            case "BIZ_MOVE_TO_CONSUMER_APP":
            case 65:
                m.messageStubType = 65;
                break;
            case "BIZ_TWO_TIER_MIGRATION_TOP":
            case 66:
                m.messageStubType = 66;
                break;
            case "BIZ_TWO_TIER_MIGRATION_BOTTOM":
            case 67:
                m.messageStubType = 67;
                break;
            case "OVERSIZED":
            case 68:
                m.messageStubType = 68;
                break;
            case "GROUP_CHANGE_NO_FREQUENTLY_FORWARDED":
            case 69:
                m.messageStubType = 69;
                break;
            case "GROUP_V4_ADD_INVITE_SENT":
            case 70:
                m.messageStubType = 70;
                break;
            case "GROUP_PARTICIPANT_ADD_REQUEST_JOIN":
            case 71:
                m.messageStubType = 71;
                break;
            case "CHANGE_EPHEMERAL_SETTING":
            case 72:
                m.messageStubType = 72;
                break;
            case "E2E_DEVICE_CHANGED":
            case 73:
                m.messageStubType = 73;
                break;
            case "VIEWED_ONCE":
            case 74:
                m.messageStubType = 74;
                break;
            case "E2E_ENCRYPTED_NOW":
            case 75:
                m.messageStubType = 75;
                break;
            case "BLUE_MSG_BSP_FB_TO_BSP_PREMISE":
            case 76:
                m.messageStubType = 76;
                break;
            case "BLUE_MSG_BSP_FB_TO_SELF_FB":
            case 77:
                m.messageStubType = 77;
                break;
            case "BLUE_MSG_BSP_FB_TO_SELF_PREMISE":
            case 78:
                m.messageStubType = 78;
                break;
            case "BLUE_MSG_BSP_FB_UNVERIFIED":
            case 79:
                m.messageStubType = 79;
                break;
            case "BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":
            case 80:
                m.messageStubType = 80;
                break;
            case "BLUE_MSG_BSP_FB_VERIFIED":
            case 81:
                m.messageStubType = 81;
                break;
            case "BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":
            case 82:
                m.messageStubType = 82;
                break;
            case "BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE":
            case 83:
                m.messageStubType = 83;
                break;
            case "BLUE_MSG_BSP_PREMISE_UNVERIFIED":
            case 84:
                m.messageStubType = 84;
                break;
            case "BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":
            case 85:
                m.messageStubType = 85;
                break;
            case "BLUE_MSG_BSP_PREMISE_VERIFIED":
            case 86:
                m.messageStubType = 86;
                break;
            case "BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":
            case 87:
                m.messageStubType = 87;
                break;
            case "BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED":
            case 88:
                m.messageStubType = 88;
                break;
            case "BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED":
            case 89:
                m.messageStubType = 89;
                break;
            case "BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED":
            case 90:
                m.messageStubType = 90;
                break;
            case "BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED":
            case 91:
                m.messageStubType = 91;
                break;
            case "BLUE_MSG_SELF_FB_TO_BSP_PREMISE":
            case 92:
                m.messageStubType = 92;
                break;
            case "BLUE_MSG_SELF_FB_TO_SELF_PREMISE":
            case 93:
                m.messageStubType = 93;
                break;
            case "BLUE_MSG_SELF_FB_UNVERIFIED":
            case 94:
                m.messageStubType = 94;
                break;
            case "BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":
            case 95:
                m.messageStubType = 95;
                break;
            case "BLUE_MSG_SELF_FB_VERIFIED":
            case 96:
                m.messageStubType = 96;
                break;
            case "BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":
            case 97:
                m.messageStubType = 97;
                break;
            case "BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE":
            case 98:
                m.messageStubType = 98;
                break;
            case "BLUE_MSG_SELF_PREMISE_UNVERIFIED":
            case 99:
                m.messageStubType = 99;
                break;
            case "BLUE_MSG_SELF_PREMISE_VERIFIED":
            case 100:
                m.messageStubType = 100;
                break;
            case "BLUE_MSG_TO_BSP_FB":
            case 101:
                m.messageStubType = 101;
                break;
            case "BLUE_MSG_TO_CONSUMER":
            case 102:
                m.messageStubType = 102;
                break;
            case "BLUE_MSG_TO_SELF_FB":
            case 103:
                m.messageStubType = 103;
                break;
            case "BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED":
            case 104:
                m.messageStubType = 104;
                break;
            case "BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":
            case 105:
                m.messageStubType = 105;
                break;
            case "BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED":
            case 106:
                m.messageStubType = 106;
                break;
            case "BLUE_MSG_UNVERIFIED_TO_VERIFIED":
            case 107:
                m.messageStubType = 107;
                break;
            case "BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED":
            case 108:
                m.messageStubType = 108;
                break;
            case "BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":
            case 109:
                m.messageStubType = 109;
                break;
            case "BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED":
            case 110:
                m.messageStubType = 110;
                break;
            case "BLUE_MSG_VERIFIED_TO_UNVERIFIED":
            case 111:
                m.messageStubType = 111;
                break;
            case "BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":
            case 112:
                m.messageStubType = 112;
                break;
            case "BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED":
            case 113:
                m.messageStubType = 113;
                break;
            case "BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":
            case 114:
                m.messageStubType = 114;
                break;
            case "BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED":
            case 115:
                m.messageStubType = 115;
                break;
            case "BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":
            case 116:
                m.messageStubType = 116;
                break;
            case "BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":
            case 117:
                m.messageStubType = 117;
                break;
            case "E2E_IDENTITY_UNAVAILABLE":
            case 118:
                m.messageStubType = 118;
                break;
            case "GROUP_CREATING":
            case 119:
                m.messageStubType = 119;
                break;
            case "GROUP_CREATE_FAILED":
            case 120:
                m.messageStubType = 120;
                break;
            case "GROUP_BOUNCED":
            case 121:
                m.messageStubType = 121;
                break;
            case "BLOCK_CONTACT":
            case 122:
                m.messageStubType = 122;
                break;
            case "EPHEMERAL_SETTING_NOT_APPLIED":
            case 123:
                m.messageStubType = 123;
                break;
            case "SYNC_FAILED":
            case 124:
                m.messageStubType = 124;
                break;
            case "SYNCING":
            case 125:
                m.messageStubType = 125;
                break;
            case "BIZ_PRIVACY_MODE_INIT_FB":
            case 126:
                m.messageStubType = 126;
                break;
            case "BIZ_PRIVACY_MODE_INIT_BSP":
            case 127:
                m.messageStubType = 127;
                break;
            case "BIZ_PRIVACY_MODE_TO_FB":
            case 128:
                m.messageStubType = 128;
                break;
            case "BIZ_PRIVACY_MODE_TO_BSP":
            case 129:
                m.messageStubType = 129;
                break;
            case "DISAPPEARING_MODE":
            case 130:
                m.messageStubType = 130;
                break;
            case "E2E_DEVICE_FETCH_FAILED":
            case 131:
                m.messageStubType = 131;
                break;
            case "ADMIN_REVOKE":
            case 132:
                m.messageStubType = 132;
                break;
            case "GROUP_INVITE_LINK_GROWTH_LOCKED":
            case 133:
                m.messageStubType = 133;
                break;
            case "COMMUNITY_LINK_PARENT_GROUP":
            case 134:
                m.messageStubType = 134;
                break;
            case "COMMUNITY_LINK_SIBLING_GROUP":
            case 135:
                m.messageStubType = 135;
                break;
            case "COMMUNITY_LINK_SUB_GROUP":
            case 136:
                m.messageStubType = 136;
                break;
            case "COMMUNITY_UNLINK_PARENT_GROUP":
            case 137:
                m.messageStubType = 137;
                break;
            case "COMMUNITY_UNLINK_SIBLING_GROUP":
            case 138:
                m.messageStubType = 138;
                break;
            case "COMMUNITY_UNLINK_SUB_GROUP":
            case 139:
                m.messageStubType = 139;
                break;
            case "GROUP_PARTICIPANT_ACCEPT":
            case 140:
                m.messageStubType = 140;
                break;
            case "GROUP_PARTICIPANT_LINKED_GROUP_JOIN":
            case 141:
                m.messageStubType = 141;
                break;
            case "COMMUNITY_CREATE":
            case 142:
                m.messageStubType = 142;
                break;
            case "EPHEMERAL_KEEP_IN_CHAT":
            case 143:
                m.messageStubType = 143;
                break;
            case "GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST":
            case 144:
                m.messageStubType = 144;
                break;
            case "GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE":
            case 145:
                m.messageStubType = 145;
                break;
            case "INTEGRITY_UNLINK_PARENT_GROUP":
            case 146:
                m.messageStubType = 146;
                break;
            case "COMMUNITY_PARTICIPANT_PROMOTE":
            case 147:
                m.messageStubType = 147;
                break;
            case "COMMUNITY_PARTICIPANT_DEMOTE":
            case 148:
                m.messageStubType = 148;
                break;
            case "COMMUNITY_PARENT_GROUP_DELETED":
            case 149:
                m.messageStubType = 149;
                break;
            case "COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL":
            case 150:
                m.messageStubType = 150;
                break;
            case "GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP":
            case 151:
                m.messageStubType = 151;
                break;
            case "MASKED_THREAD_CREATED":
            case 152:
                m.messageStubType = 152;
                break;
            case "MASKED_THREAD_UNMASKED":
            case 153:
                m.messageStubType = 153;
                break;
            case "BIZ_CHAT_ASSIGNMENT":
            case 154:
                m.messageStubType = 154;
                break;
            case "CHAT_PSA":
            case 155:
                m.messageStubType = 155;
                break;
            case "CHAT_POLL_CREATION_MESSAGE":
            case 156:
                m.messageStubType = 156;
                break;
            case "CAG_MASKED_THREAD_CREATED":
            case 157:
                m.messageStubType = 157;
                break;
            case "COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED":
            case 158:
                m.messageStubType = 158;
                break;
            case "CAG_INVITE_AUTO_ADD":
            case 159:
                m.messageStubType = 159;
                break;
            case "BIZ_CHAT_ASSIGNMENT_UNASSIGN":
            case 160:
                m.messageStubType = 160;
                break;
            case "CAG_INVITE_AUTO_JOINED":
            case 161:
                m.messageStubType = 161;
                break;
            case "SCHEDULED_CALL_START_MESSAGE":
            case 162:
                m.messageStubType = 162;
                break;
            case "COMMUNITY_INVITE_RICH":
            case 163:
                m.messageStubType = 163;
                break;
            case "COMMUNITY_INVITE_AUTO_ADD_RICH":
            case 164:
                m.messageStubType = 164;
                break;
            case "SUB_GROUP_INVITE_RICH":
            case 165:
                m.messageStubType = 165;
                break;
            case "SUB_GROUP_PARTICIPANT_ADD_RICH":
            case 166:
                m.messageStubType = 166;
                break;
            case "COMMUNITY_LINK_PARENT_GROUP_RICH":
            case 167:
                m.messageStubType = 167;
                break;
            case "COMMUNITY_PARTICIPANT_ADD_RICH":
            case 168:
                m.messageStubType = 168;
                break;
            case "SILENCED_UNKNOWN_CALLER_AUDIO":
            case 169:
                m.messageStubType = 169;
                break;
            case "SILENCED_UNKNOWN_CALLER_VIDEO":
            case 170:
                m.messageStubType = 170;
                break;
            case "GROUP_MEMBER_ADD_MODE":
            case 171:
                m.messageStubType = 171;
                break;
            case "GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD":
            case 172:
                m.messageStubType = 172;
                break;
            case "COMMUNITY_CHANGE_DESCRIPTION":
            case 173:
                m.messageStubType = 173;
                break;
            case "SENDER_INVITE":
            case 174:
                m.messageStubType = 174;
                break;
            case "RECEIVER_INVITE":
            case 175:
                m.messageStubType = 175;
                break;
            case "COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS":
            case 176:
                m.messageStubType = 176;
                break;
            case "PINNED_MESSAGE_IN_CHAT":
            case 177:
                m.messageStubType = 177;
                break;
            case "PAYMENT_INVITE_SETUP_INVITER":
            case 178:
                m.messageStubType = 178;
                break;
            case "PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY":
            case 179:
                m.messageStubType = 179;
                break;
            case "PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE":
            case 180:
                m.messageStubType = 180;
                break;
            case "LINKED_GROUP_CALL_START":
            case 181:
                m.messageStubType = 181;
                break;
            case "REPORT_TO_ADMIN_ENABLED_STATUS":
            case 182:
                m.messageStubType = 182;
                break;
            case "EMPTY_SUBGROUP_CREATE":
            case 183:
                m.messageStubType = 183;
                break;
            case "SCHEDULED_CALL_CANCEL":
            case 184:
                m.messageStubType = 184;
                break;
            case "SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH":
            case 185:
                m.messageStubType = 185;
                break;
            case "GROUP_CHANGE_RECENT_HISTORY_SHARING":
            case 186:
                m.messageStubType = 186;
                break;
            case "PAID_MESSAGE_SERVER_CAMPAIGN_ID":
            case 187:
                m.messageStubType = 187;
                break;
            case "GENERAL_CHAT_CREATE":
            case 188:
                m.messageStubType = 188;
                break;
            case "GENERAL_CHAT_ADD":
            case 189:
                m.messageStubType = 189;
                break;
            case "GENERAL_CHAT_AUTO_ADD_DISABLED":
            case 190:
                m.messageStubType = 190;
                break;
            case "SUGGESTED_SUBGROUP_ANNOUNCE":
            case 191:
                m.messageStubType = 191;
                break;
            case "BIZ_BOT_1P_MESSAGING_ENABLED":
            case 192:
                m.messageStubType = 192;
                break;
            case "CHANGE_USERNAME":
            case 193:
                m.messageStubType = 193;
                break;
            case "BIZ_COEX_PRIVACY_INIT_SELF":
            case 194:
                m.messageStubType = 194;
                break;
            case "BIZ_COEX_PRIVACY_TRANSITION_SELF":
            case 195:
                m.messageStubType = 195;
                break;
            case "SUPPORT_AI_EDUCATION":
            case 196:
                m.messageStubType = 196;
                break;
            case "BIZ_BOT_3P_MESSAGING_ENABLED":
            case 197:
                m.messageStubType = 197;
                break;
            case "REMINDER_SETUP_MESSAGE":
            case 198:
                m.messageStubType = 198;
                break;
            case "REMINDER_SENT_MESSAGE":
            case 199:
                m.messageStubType = 199;
                break;
            case "REMINDER_CANCEL_MESSAGE":
            case 200:
                m.messageStubType = 200;
                break;
            case "BIZ_COEX_PRIVACY_INIT":
            case 201:
                m.messageStubType = 201;
                break;
            case "BIZ_COEX_PRIVACY_TRANSITION":
            case 202:
                m.messageStubType = 202;
                break;
            case "GROUP_DEACTIVATED":
            case 203:
                m.messageStubType = 203;
                break;
            case "COMMUNITY_DEACTIVATE_SIBLING_GROUP":
            case 204:
                m.messageStubType = 204;
                break;
            case "EVENT_UPDATED":
            case 205:
                m.messageStubType = 205;
                break;
            case "EVENT_CANCELED":
            case 206:
                m.messageStubType = 206;
                break;
            case "COMMUNITY_OWNER_UPDATED":
            case 207:
                m.messageStubType = 207;
                break;
            case "COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN":
            case 208:
                m.messageStubType = 208;
                break;
            case "CAPI_GROUP_NE2EE_SYSTEM_MESSAGE":
            case 209:
                m.messageStubType = 209;
                break;
            case "STATUS_MENTION":
            case 210:
                m.messageStubType = 210;
                break;
            case "USER_CONTROLS_SYSTEM_MESSAGE":
            case 211:
                m.messageStubType = 211;
                break;
            case "SUPPORT_SYSTEM_MESSAGE":
            case 212:
                m.messageStubType = 212;
                break;
            case "CHANGE_LID":
            case 213:
                m.messageStubType = 213;
                break;
            case "BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE":
            case 214:
                m.messageStubType = 214;
                break;
            case "BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE":
            case 215:
                m.messageStubType = 215;
                break;
            case "CHANGE_LIMIT_SHARING":
            case 216:
                m.messageStubType = 216;
                break;
            case "GROUP_MEMBER_LINK_MODE":
            case 217:
                m.messageStubType = 217;
                break;
            case "BIZ_AUTOMATICALLY_LABELED_CHAT_SYSTEM_MESSAGE":
            case 218:
                m.messageStubType = 218;
                break;
            case "PHONE_NUMBER_HIDING_CHAT_DEPRECATED_MESSAGE":
            case 219:
                m.messageStubType = 219;
                break;
            case "QUARANTINED_MESSAGE":
            case 220:
                m.messageStubType = 220;
                break;
            case "GROUP_MEMBER_SHARE_GROUP_HISTORY_MODE":
            case 221:
                m.messageStubType = 221;
                break;
            }
            if (d.clearMedia != null) {
                m.clearMedia = Boolean(d.clearMedia);
            }
            if (d.messageStubParameters) {
                if (!Array.isArray(d.messageStubParameters))
                    throw TypeError(".proto.WebMessageInfo.messageStubParameters: array expected");
                m.messageStubParameters = [];
                for (var i = 0; i < d.messageStubParameters.length; ++i) {
                    m.messageStubParameters[i] = String(d.messageStubParameters[i]);
                }
            }
            if (d.duration != null) {
                m.duration = d.duration >>> 0;
            }
            if (d.labels) {
                if (!Array.isArray(d.labels))
                    throw TypeError(".proto.WebMessageInfo.labels: array expected");
                m.labels = [];
                for (var i = 0; i < d.labels.length; ++i) {
                    m.labels[i] = String(d.labels[i]);
                }
            }
            if (d.paymentInfo != null) {
                if (typeof d.paymentInfo !== "object")
                    throw TypeError(".proto.WebMessageInfo.paymentInfo: object expected");
                m.paymentInfo = $root.proto.PaymentInfo.fromObject(d.paymentInfo);
            }
            if (d.finalLiveLocation != null) {
                if (typeof d.finalLiveLocation !== "object")
                    throw TypeError(".proto.WebMessageInfo.finalLiveLocation: object expected");
                m.finalLiveLocation = $root.proto.Message.LiveLocationMessage.fromObject(d.finalLiveLocation);
            }
            if (d.quotedPaymentInfo != null) {
                if (typeof d.quotedPaymentInfo !== "object")
                    throw TypeError(".proto.WebMessageInfo.quotedPaymentInfo: object expected");
                m.quotedPaymentInfo = $root.proto.PaymentInfo.fromObject(d.quotedPaymentInfo);
            }
            if (d.ephemeralStartTimestamp != null) {
                if ($util.Long)
                    (m.ephemeralStartTimestamp = $util.Long.fromValue(d.ephemeralStartTimestamp)).unsigned = true;
                else if (typeof d.ephemeralStartTimestamp === "string")
                    m.ephemeralStartTimestamp = parseInt(d.ephemeralStartTimestamp, 10);
                else if (typeof d.ephemeralStartTimestamp === "number")
                    m.ephemeralStartTimestamp = d.ephemeralStartTimestamp;
                else if (typeof d.ephemeralStartTimestamp === "object")
                    m.ephemeralStartTimestamp = new $util.LongBits(d.ephemeralStartTimestamp.low >>> 0, d.ephemeralStartTimestamp.high >>> 0).toNumber(true);
            }
            if (d.ephemeralDuration != null) {
                m.ephemeralDuration = d.ephemeralDuration >>> 0;
            }
            if (d.ephemeralOffToOn != null) {
                m.ephemeralOffToOn = Boolean(d.ephemeralOffToOn);
            }
            if (d.ephemeralOutOfSync != null) {
                m.ephemeralOutOfSync = Boolean(d.ephemeralOutOfSync);
            }
            switch (d.bizPrivacyStatus) {
            default:
                if (typeof d.bizPrivacyStatus === "number") {
                    m.bizPrivacyStatus = d.bizPrivacyStatus;
                    break;
                }
                break;
            case "E2EE":
            case 0:
                m.bizPrivacyStatus = 0;
                break;
            case "FB":
            case 2:
                m.bizPrivacyStatus = 2;
                break;
            case "BSP":
            case 1:
                m.bizPrivacyStatus = 1;
                break;
            case "BSP_AND_FB":
            case 3:
                m.bizPrivacyStatus = 3;
                break;
            }
            if (d.verifiedBizName != null) {
                m.verifiedBizName = String(d.verifiedBizName);
            }
            if (d.mediaData != null) {
                if (typeof d.mediaData !== "object")
                    throw TypeError(".proto.WebMessageInfo.mediaData: object expected");
                m.mediaData = $root.proto.MediaData.fromObject(d.mediaData);
            }
            if (d.photoChange != null) {
                if (typeof d.photoChange !== "object")
                    throw TypeError(".proto.WebMessageInfo.photoChange: object expected");
                m.photoChange = $root.proto.PhotoChange.fromObject(d.photoChange);
            }
            if (d.userReceipt) {
                if (!Array.isArray(d.userReceipt))
                    throw TypeError(".proto.WebMessageInfo.userReceipt: array expected");
                m.userReceipt = [];
                for (var i = 0; i < d.userReceipt.length; ++i) {
                    if (typeof d.userReceipt[i] !== "object")
                        throw TypeError(".proto.WebMessageInfo.userReceipt: object expected");
                    m.userReceipt[i] = $root.proto.UserReceipt.fromObject(d.userReceipt[i]);
                }
            }
            if (d.reactions) {
                if (!Array.isArray(d.reactions))
                    throw TypeError(".proto.WebMessageInfo.reactions: array expected");
                m.reactions = [];
                for (var i = 0; i < d.reactions.length; ++i) {
                    if (typeof d.reactions[i] !== "object")
                        throw TypeError(".proto.WebMessageInfo.reactions: object expected");
                    m.reactions[i] = $root.proto.Reaction.fromObject(d.reactions[i]);
                }
            }
            if (d.quotedStickerData != null) {
                if (typeof d.quotedStickerData !== "object")
                    throw TypeError(".proto.WebMessageInfo.quotedStickerData: object expected");
                m.quotedStickerData = $root.proto.MediaData.fromObject(d.quotedStickerData);
            }
            if (d.futureproofData != null) {
                if (typeof d.futureproofData === "string")
                    $util.base64.decode(d.futureproofData, m.futureproofData = $util.newBuffer($util.base64.length(d.futureproofData)), 0);
                else if (d.futureproofData.length >= 0)
                    m.futureproofData = d.futureproofData;
            }
            if (d.statusPsa != null) {
                if (typeof d.statusPsa !== "object")
                    throw TypeError(".proto.WebMessageInfo.statusPsa: object expected");
                m.statusPsa = $root.proto.StatusPSA.fromObject(d.statusPsa);
            }
            if (d.pollUpdates) {
                if (!Array.isArray(d.pollUpdates))
                    throw TypeError(".proto.WebMessageInfo.pollUpdates: array expected");
                m.pollUpdates = [];
                for (var i = 0; i < d.pollUpdates.length; ++i) {
                    if (typeof d.pollUpdates[i] !== "object")
                        throw TypeError(".proto.WebMessageInfo.pollUpdates: object expected");
                    m.pollUpdates[i] = $root.proto.PollUpdate.fromObject(d.pollUpdates[i]);
                }
            }
            if (d.pollAdditionalMetadata != null) {
                if (typeof d.pollAdditionalMetadata !== "object")
                    throw TypeError(".proto.WebMessageInfo.pollAdditionalMetadata: object expected");
                m.pollAdditionalMetadata = $root.proto.PollAdditionalMetadata.fromObject(d.pollAdditionalMetadata);
            }
            if (d.agentId != null) {
                m.agentId = String(d.agentId);
            }
            if (d.statusAlreadyViewed != null) {
                m.statusAlreadyViewed = Boolean(d.statusAlreadyViewed);
            }
            if (d.messageSecret != null) {
                if (typeof d.messageSecret === "string")
                    $util.base64.decode(d.messageSecret, m.messageSecret = $util.newBuffer($util.base64.length(d.messageSecret)), 0);
                else if (d.messageSecret.length >= 0)
                    m.messageSecret = d.messageSecret;
            }
            if (d.keepInChat != null) {
                if (typeof d.keepInChat !== "object")
                    throw TypeError(".proto.WebMessageInfo.keepInChat: object expected");
                m.keepInChat = $root.proto.KeepInChat.fromObject(d.keepInChat);
            }
            if (d.originalSelfAuthorUserJidString != null) {
                m.originalSelfAuthorUserJidString = String(d.originalSelfAuthorUserJidString);
            }
            if (d.revokeMessageTimestamp != null) {
                if ($util.Long)
                    (m.revokeMessageTimestamp = $util.Long.fromValue(d.revokeMessageTimestamp)).unsigned = true;
                else if (typeof d.revokeMessageTimestamp === "string")
                    m.revokeMessageTimestamp = parseInt(d.revokeMessageTimestamp, 10);
                else if (typeof d.revokeMessageTimestamp === "number")
                    m.revokeMessageTimestamp = d.revokeMessageTimestamp;
                else if (typeof d.revokeMessageTimestamp === "object")
                    m.revokeMessageTimestamp = new $util.LongBits(d.revokeMessageTimestamp.low >>> 0, d.revokeMessageTimestamp.high >>> 0).toNumber(true);
            }
            if (d.pinInChat != null) {
                if (typeof d.pinInChat !== "object")
                    throw TypeError(".proto.WebMessageInfo.pinInChat: object expected");
                m.pinInChat = $root.proto.PinInChat.fromObject(d.pinInChat);
            }
            if (d.premiumMessageInfo != null) {
                if (typeof d.premiumMessageInfo !== "object")
                    throw TypeError(".proto.WebMessageInfo.premiumMessageInfo: object expected");
                m.premiumMessageInfo = $root.proto.PremiumMessageInfo.fromObject(d.premiumMessageInfo);
            }
            if (d.is1PBizBotMessage != null) {
                m.is1PBizBotMessage = Boolean(d.is1PBizBotMessage);
            }
            if (d.isGroupHistoryMessage != null) {
                m.isGroupHistoryMessage = Boolean(d.isGroupHistoryMessage);
            }
            if (d.botMessageInvokerJid != null) {
                m.botMessageInvokerJid = String(d.botMessageInvokerJid);
            }
            if (d.commentMetadata != null) {
                if (typeof d.commentMetadata !== "object")
                    throw TypeError(".proto.WebMessageInfo.commentMetadata: object expected");
                m.commentMetadata = $root.proto.CommentMetadata.fromObject(d.commentMetadata);
            }
            if (d.eventResponses) {
                if (!Array.isArray(d.eventResponses))
                    throw TypeError(".proto.WebMessageInfo.eventResponses: array expected");
                m.eventResponses = [];
                for (var i = 0; i < d.eventResponses.length; ++i) {
                    if (typeof d.eventResponses[i] !== "object")
                        throw TypeError(".proto.WebMessageInfo.eventResponses: object expected");
                    m.eventResponses[i] = $root.proto.EventResponse.fromObject(d.eventResponses[i]);
                }
            }
            if (d.reportingTokenInfo != null) {
                if (typeof d.reportingTokenInfo !== "object")
                    throw TypeError(".proto.WebMessageInfo.reportingTokenInfo: object expected");
                m.reportingTokenInfo = $root.proto.ReportingTokenInfo.fromObject(d.reportingTokenInfo);
            }
            if (d.newsletterServerId != null) {
                if ($util.Long)
                    (m.newsletterServerId = $util.Long.fromValue(d.newsletterServerId)).unsigned = true;
                else if (typeof d.newsletterServerId === "string")
                    m.newsletterServerId = parseInt(d.newsletterServerId, 10);
                else if (typeof d.newsletterServerId === "number")
                    m.newsletterServerId = d.newsletterServerId;
                else if (typeof d.newsletterServerId === "object")
                    m.newsletterServerId = new $util.LongBits(d.newsletterServerId.low >>> 0, d.newsletterServerId.high >>> 0).toNumber(true);
            }
            if (d.eventAdditionalMetadata != null) {
                if (typeof d.eventAdditionalMetadata !== "object")
                    throw TypeError(".proto.WebMessageInfo.eventAdditionalMetadata: object expected");
                m.eventAdditionalMetadata = $root.proto.EventAdditionalMetadata.fromObject(d.eventAdditionalMetadata);
            }
            if (d.isMentionedInStatus != null) {
                m.isMentionedInStatus = Boolean(d.isMentionedInStatus);
            }
            if (d.statusMentions) {
                if (!Array.isArray(d.statusMentions))
                    throw TypeError(".proto.WebMessageInfo.statusMentions: array expected");
                m.statusMentions = [];
                for (var i = 0; i < d.statusMentions.length; ++i) {
                    m.statusMentions[i] = String(d.statusMentions[i]);
                }
            }
            if (d.targetMessageId != null) {
                if (typeof d.targetMessageId !== "object")
                    throw TypeError(".proto.WebMessageInfo.targetMessageId: object expected");
                m.targetMessageId = $root.proto.MessageKey.fromObject(d.targetMessageId);
            }
            if (d.messageAddOns) {
                if (!Array.isArray(d.messageAddOns))
                    throw TypeError(".proto.WebMessageInfo.messageAddOns: array expected");
                m.messageAddOns = [];
                for (var i = 0; i < d.messageAddOns.length; ++i) {
                    if (typeof d.messageAddOns[i] !== "object")
                        throw TypeError(".proto.WebMessageInfo.messageAddOns: object expected");
                    m.messageAddOns[i] = $root.proto.MessageAddOn.fromObject(d.messageAddOns[i]);
                }
            }
            if (d.statusMentionMessageInfo != null) {
                if (typeof d.statusMentionMessageInfo !== "object")
                    throw TypeError(".proto.WebMessageInfo.statusMentionMessageInfo: object expected");
                m.statusMentionMessageInfo = $root.proto.StatusMentionMessage.fromObject(d.statusMentionMessageInfo);
            }
            if (d.isSupportAiMessage != null) {
                m.isSupportAiMessage = Boolean(d.isSupportAiMessage);
            }
            if (d.statusMentionSources) {
                if (!Array.isArray(d.statusMentionSources))
                    throw TypeError(".proto.WebMessageInfo.statusMentionSources: array expected");
                m.statusMentionSources = [];
                for (var i = 0; i < d.statusMentionSources.length; ++i) {
                    m.statusMentionSources[i] = String(d.statusMentionSources[i]);
                }
            }
            if (d.supportAiCitations) {
                if (!Array.isArray(d.supportAiCitations))
                    throw TypeError(".proto.WebMessageInfo.supportAiCitations: array expected");
                m.supportAiCitations = [];
                for (var i = 0; i < d.supportAiCitations.length; ++i) {
                    if (typeof d.supportAiCitations[i] !== "object")
                        throw TypeError(".proto.WebMessageInfo.supportAiCitations: object expected");
                    m.supportAiCitations[i] = $root.proto.Citation.fromObject(d.supportAiCitations[i]);
                }
            }
            if (d.botTargetId != null) {
                m.botTargetId = String(d.botTargetId);
            }
            if (d.groupHistoryIndividualMessageInfo != null) {
                if (typeof d.groupHistoryIndividualMessageInfo !== "object")
                    throw TypeError(".proto.WebMessageInfo.groupHistoryIndividualMessageInfo: object expected");
                m.groupHistoryIndividualMessageInfo = $root.proto.GroupHistoryIndividualMessageInfo.fromObject(d.groupHistoryIndividualMessageInfo);
            }
            if (d.groupHistoryBundleInfo != null) {
                if (typeof d.groupHistoryBundleInfo !== "object")
                    throw TypeError(".proto.WebMessageInfo.groupHistoryBundleInfo: object expected");
                m.groupHistoryBundleInfo = $root.proto.GroupHistoryBundleInfo.fromObject(d.groupHistoryBundleInfo);
            }
            if (d.interactiveMessageAdditionalMetadata != null) {
                if (typeof d.interactiveMessageAdditionalMetadata !== "object")
                    throw TypeError(".proto.WebMessageInfo.interactiveMessageAdditionalMetadata: object expected");
                m.interactiveMessageAdditionalMetadata = $root.proto.InteractiveMessageAdditionalMetadata.fromObject(d.interactiveMessageAdditionalMetadata);
            }
            if (d.quarantinedMessage != null) {
                if (typeof d.quarantinedMessage !== "object")
                    throw TypeError(".proto.WebMessageInfo.quarantinedMessage: object expected");
                m.quarantinedMessage = $root.proto.QuarantinedMessage.fromObject(d.quarantinedMessage);
            }
            return m;
        };

        WebMessageInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.messageStubParameters = [];
                d.labels = [];
                d.userReceipt = [];
                d.reactions = [];
                d.pollUpdates = [];
                d.eventResponses = [];
                d.statusMentions = [];
                d.messageAddOns = [];
                d.statusMentionSources = [];
                d.supportAiCitations = [];
            }
            if (o.defaults) {
                d.key = null;
            }
            if (m.key != null && m.hasOwnProperty("key")) {
                d.key = $root.proto.MessageKey.toObject(m.key, o);
            }
            if (m.message != null && m.hasOwnProperty("message")) {
                d.message = $root.proto.Message.toObject(m.message, o);
                if (o.oneofs)
                    d._message = "message";
            }
            if (m.messageTimestamp != null && m.hasOwnProperty("messageTimestamp")) {
                if (typeof m.messageTimestamp === "number")
                    d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp;
                else
                    d.messageTimestamp = o.longs === String ? longToString(m.messageTimestamp, true) : o.longs === Number ? longToNumber(m.messageTimestamp, true) : m.messageTimestamp;
                if (o.oneofs)
                    d._messageTimestamp = "messageTimestamp";
            }
            if (m.status != null && m.hasOwnProperty("status")) {
                d.status = o.enums === String ? $root.proto.WebMessageInfo.Status[m.status] === undefined ? m.status : $root.proto.WebMessageInfo.Status[m.status] : m.status;
                if (o.oneofs)
                    d._status = "status";
            }
            if (m.participant != null && m.hasOwnProperty("participant")) {
                d.participant = m.participant;
                if (o.oneofs)
                    d._participant = "participant";
            }
            if (m.messageC2STimestamp != null && m.hasOwnProperty("messageC2STimestamp")) {
                if (typeof m.messageC2STimestamp === "number")
                    d.messageC2STimestamp = o.longs === String ? String(m.messageC2STimestamp) : m.messageC2STimestamp;
                else
                    d.messageC2STimestamp = o.longs === String ? longToString(m.messageC2STimestamp, true) : o.longs === Number ? longToNumber(m.messageC2STimestamp, true) : m.messageC2STimestamp;
                if (o.oneofs)
                    d._messageC2STimestamp = "messageC2STimestamp";
            }
            if (m.ignore != null && m.hasOwnProperty("ignore")) {
                d.ignore = m.ignore;
                if (o.oneofs)
                    d._ignore = "ignore";
            }
            if (m.starred != null && m.hasOwnProperty("starred")) {
                d.starred = m.starred;
                if (o.oneofs)
                    d._starred = "starred";
            }
            if (m.broadcast != null && m.hasOwnProperty("broadcast")) {
                d.broadcast = m.broadcast;
                if (o.oneofs)
                    d._broadcast = "broadcast";
            }
            if (m.pushName != null && m.hasOwnProperty("pushName")) {
                d.pushName = m.pushName;
                if (o.oneofs)
                    d._pushName = "pushName";
            }
            if (m.mediaCiphertextSha256 != null && m.hasOwnProperty("mediaCiphertextSha256")) {
                d.mediaCiphertextSha256 = o.bytes === String ? $util.base64.encode(m.mediaCiphertextSha256, 0, m.mediaCiphertextSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaCiphertextSha256) : m.mediaCiphertextSha256;
                if (o.oneofs)
                    d._mediaCiphertextSha256 = "mediaCiphertextSha256";
            }
            if (m.multicast != null && m.hasOwnProperty("multicast")) {
                d.multicast = m.multicast;
                if (o.oneofs)
                    d._multicast = "multicast";
            }
            if (m.urlText != null && m.hasOwnProperty("urlText")) {
                d.urlText = m.urlText;
                if (o.oneofs)
                    d._urlText = "urlText";
            }
            if (m.urlNumber != null && m.hasOwnProperty("urlNumber")) {
                d.urlNumber = m.urlNumber;
                if (o.oneofs)
                    d._urlNumber = "urlNumber";
            }
            if (m.messageStubType != null && m.hasOwnProperty("messageStubType")) {
                d.messageStubType = o.enums === String ? $root.proto.WebMessageInfo.StubType[m.messageStubType] === undefined ? m.messageStubType : $root.proto.WebMessageInfo.StubType[m.messageStubType] : m.messageStubType;
                if (o.oneofs)
                    d._messageStubType = "messageStubType";
            }
            if (m.clearMedia != null && m.hasOwnProperty("clearMedia")) {
                d.clearMedia = m.clearMedia;
                if (o.oneofs)
                    d._clearMedia = "clearMedia";
            }
            if (m.messageStubParameters && m.messageStubParameters.length) {
                d.messageStubParameters = [];
                for (var j = 0; j < m.messageStubParameters.length; ++j) {
                    d.messageStubParameters[j] = m.messageStubParameters[j];
                }
            }
            if (m.duration != null && m.hasOwnProperty("duration")) {
                d.duration = m.duration;
                if (o.oneofs)
                    d._duration = "duration";
            }
            if (m.labels && m.labels.length) {
                d.labels = [];
                for (var j = 0; j < m.labels.length; ++j) {
                    d.labels[j] = m.labels[j];
                }
            }
            if (m.paymentInfo != null && m.hasOwnProperty("paymentInfo")) {
                d.paymentInfo = $root.proto.PaymentInfo.toObject(m.paymentInfo, o);
                if (o.oneofs)
                    d._paymentInfo = "paymentInfo";
            }
            if (m.finalLiveLocation != null && m.hasOwnProperty("finalLiveLocation")) {
                d.finalLiveLocation = $root.proto.Message.LiveLocationMessage.toObject(m.finalLiveLocation, o);
                if (o.oneofs)
                    d._finalLiveLocation = "finalLiveLocation";
            }
            if (m.quotedPaymentInfo != null && m.hasOwnProperty("quotedPaymentInfo")) {
                d.quotedPaymentInfo = $root.proto.PaymentInfo.toObject(m.quotedPaymentInfo, o);
                if (o.oneofs)
                    d._quotedPaymentInfo = "quotedPaymentInfo";
            }
            if (m.ephemeralStartTimestamp != null && m.hasOwnProperty("ephemeralStartTimestamp")) {
                if (typeof m.ephemeralStartTimestamp === "number")
                    d.ephemeralStartTimestamp = o.longs === String ? String(m.ephemeralStartTimestamp) : m.ephemeralStartTimestamp;
                else
                    d.ephemeralStartTimestamp = o.longs === String ? longToString(m.ephemeralStartTimestamp, true) : o.longs === Number ? longToNumber(m.ephemeralStartTimestamp, true) : m.ephemeralStartTimestamp;
                if (o.oneofs)
                    d._ephemeralStartTimestamp = "ephemeralStartTimestamp";
            }
            if (m.ephemeralDuration != null && m.hasOwnProperty("ephemeralDuration")) {
                d.ephemeralDuration = m.ephemeralDuration;
                if (o.oneofs)
                    d._ephemeralDuration = "ephemeralDuration";
            }
            if (m.ephemeralOffToOn != null && m.hasOwnProperty("ephemeralOffToOn")) {
                d.ephemeralOffToOn = m.ephemeralOffToOn;
                if (o.oneofs)
                    d._ephemeralOffToOn = "ephemeralOffToOn";
            }
            if (m.ephemeralOutOfSync != null && m.hasOwnProperty("ephemeralOutOfSync")) {
                d.ephemeralOutOfSync = m.ephemeralOutOfSync;
                if (o.oneofs)
                    d._ephemeralOutOfSync = "ephemeralOutOfSync";
            }
            if (m.bizPrivacyStatus != null && m.hasOwnProperty("bizPrivacyStatus")) {
                d.bizPrivacyStatus = o.enums === String ? $root.proto.WebMessageInfo.BizPrivacyStatus[m.bizPrivacyStatus] === undefined ? m.bizPrivacyStatus : $root.proto.WebMessageInfo.BizPrivacyStatus[m.bizPrivacyStatus] : m.bizPrivacyStatus;
                if (o.oneofs)
                    d._bizPrivacyStatus = "bizPrivacyStatus";
            }
            if (m.verifiedBizName != null && m.hasOwnProperty("verifiedBizName")) {
                d.verifiedBizName = m.verifiedBizName;
                if (o.oneofs)
                    d._verifiedBizName = "verifiedBizName";
            }
            if (m.mediaData != null && m.hasOwnProperty("mediaData")) {
                d.mediaData = $root.proto.MediaData.toObject(m.mediaData, o);
                if (o.oneofs)
                    d._mediaData = "mediaData";
            }
            if (m.photoChange != null && m.hasOwnProperty("photoChange")) {
                d.photoChange = $root.proto.PhotoChange.toObject(m.photoChange, o);
                if (o.oneofs)
                    d._photoChange = "photoChange";
            }
            if (m.userReceipt && m.userReceipt.length) {
                d.userReceipt = [];
                for (var j = 0; j < m.userReceipt.length; ++j) {
                    d.userReceipt[j] = $root.proto.UserReceipt.toObject(m.userReceipt[j], o);
                }
            }
            if (m.reactions && m.reactions.length) {
                d.reactions = [];
                for (var j = 0; j < m.reactions.length; ++j) {
                    d.reactions[j] = $root.proto.Reaction.toObject(m.reactions[j], o);
                }
            }
            if (m.quotedStickerData != null && m.hasOwnProperty("quotedStickerData")) {
                d.quotedStickerData = $root.proto.MediaData.toObject(m.quotedStickerData, o);
                if (o.oneofs)
                    d._quotedStickerData = "quotedStickerData";
            }
            if (m.futureproofData != null && m.hasOwnProperty("futureproofData")) {
                d.futureproofData = o.bytes === String ? $util.base64.encode(m.futureproofData, 0, m.futureproofData.length) : o.bytes === Array ? Array.prototype.slice.call(m.futureproofData) : m.futureproofData;
                if (o.oneofs)
                    d._futureproofData = "futureproofData";
            }
            if (m.statusPsa != null && m.hasOwnProperty("statusPsa")) {
                d.statusPsa = $root.proto.StatusPSA.toObject(m.statusPsa, o);
                if (o.oneofs)
                    d._statusPsa = "statusPsa";
            }
            if (m.pollUpdates && m.pollUpdates.length) {
                d.pollUpdates = [];
                for (var j = 0; j < m.pollUpdates.length; ++j) {
                    d.pollUpdates[j] = $root.proto.PollUpdate.toObject(m.pollUpdates[j], o);
                }
            }
            if (m.pollAdditionalMetadata != null && m.hasOwnProperty("pollAdditionalMetadata")) {
                d.pollAdditionalMetadata = $root.proto.PollAdditionalMetadata.toObject(m.pollAdditionalMetadata, o);
                if (o.oneofs)
                    d._pollAdditionalMetadata = "pollAdditionalMetadata";
            }
            if (m.agentId != null && m.hasOwnProperty("agentId")) {
                d.agentId = m.agentId;
                if (o.oneofs)
                    d._agentId = "agentId";
            }
            if (m.statusAlreadyViewed != null && m.hasOwnProperty("statusAlreadyViewed")) {
                d.statusAlreadyViewed = m.statusAlreadyViewed;
                if (o.oneofs)
                    d._statusAlreadyViewed = "statusAlreadyViewed";
            }
            if (m.messageSecret != null && m.hasOwnProperty("messageSecret")) {
                d.messageSecret = o.bytes === String ? $util.base64.encode(m.messageSecret, 0, m.messageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.messageSecret) : m.messageSecret;
                if (o.oneofs)
                    d._messageSecret = "messageSecret";
            }
            if (m.keepInChat != null && m.hasOwnProperty("keepInChat")) {
                d.keepInChat = $root.proto.KeepInChat.toObject(m.keepInChat, o);
                if (o.oneofs)
                    d._keepInChat = "keepInChat";
            }
            if (m.originalSelfAuthorUserJidString != null && m.hasOwnProperty("originalSelfAuthorUserJidString")) {
                d.originalSelfAuthorUserJidString = m.originalSelfAuthorUserJidString;
                if (o.oneofs)
                    d._originalSelfAuthorUserJidString = "originalSelfAuthorUserJidString";
            }
            if (m.revokeMessageTimestamp != null && m.hasOwnProperty("revokeMessageTimestamp")) {
                if (typeof m.revokeMessageTimestamp === "number")
                    d.revokeMessageTimestamp = o.longs === String ? String(m.revokeMessageTimestamp) : m.revokeMessageTimestamp;
                else
                    d.revokeMessageTimestamp = o.longs === String ? longToString(m.revokeMessageTimestamp, true) : o.longs === Number ? longToNumber(m.revokeMessageTimestamp, true) : m.revokeMessageTimestamp;
                if (o.oneofs)
                    d._revokeMessageTimestamp = "revokeMessageTimestamp";
            }
            if (m.pinInChat != null && m.hasOwnProperty("pinInChat")) {
                d.pinInChat = $root.proto.PinInChat.toObject(m.pinInChat, o);
                if (o.oneofs)
                    d._pinInChat = "pinInChat";
            }
            if (m.premiumMessageInfo != null && m.hasOwnProperty("premiumMessageInfo")) {
                d.premiumMessageInfo = $root.proto.PremiumMessageInfo.toObject(m.premiumMessageInfo, o);
                if (o.oneofs)
                    d._premiumMessageInfo = "premiumMessageInfo";
            }
            if (m.is1PBizBotMessage != null && m.hasOwnProperty("is1PBizBotMessage")) {
                d.is1PBizBotMessage = m.is1PBizBotMessage;
                if (o.oneofs)
                    d._is1PBizBotMessage = "is1PBizBotMessage";
            }
            if (m.isGroupHistoryMessage != null && m.hasOwnProperty("isGroupHistoryMessage")) {
                d.isGroupHistoryMessage = m.isGroupHistoryMessage;
                if (o.oneofs)
                    d._isGroupHistoryMessage = "isGroupHistoryMessage";
            }
            if (m.botMessageInvokerJid != null && m.hasOwnProperty("botMessageInvokerJid")) {
                d.botMessageInvokerJid = m.botMessageInvokerJid;
                if (o.oneofs)
                    d._botMessageInvokerJid = "botMessageInvokerJid";
            }
            if (m.commentMetadata != null && m.hasOwnProperty("commentMetadata")) {
                d.commentMetadata = $root.proto.CommentMetadata.toObject(m.commentMetadata, o);
                if (o.oneofs)
                    d._commentMetadata = "commentMetadata";
            }
            if (m.eventResponses && m.eventResponses.length) {
                d.eventResponses = [];
                for (var j = 0; j < m.eventResponses.length; ++j) {
                    d.eventResponses[j] = $root.proto.EventResponse.toObject(m.eventResponses[j], o);
                }
            }
            if (m.reportingTokenInfo != null && m.hasOwnProperty("reportingTokenInfo")) {
                d.reportingTokenInfo = $root.proto.ReportingTokenInfo.toObject(m.reportingTokenInfo, o);
                if (o.oneofs)
                    d._reportingTokenInfo = "reportingTokenInfo";
            }
            if (m.newsletterServerId != null && m.hasOwnProperty("newsletterServerId")) {
                if (typeof m.newsletterServerId === "number")
                    d.newsletterServerId = o.longs === String ? String(m.newsletterServerId) : m.newsletterServerId;
                else
                    d.newsletterServerId = o.longs === String ? longToString(m.newsletterServerId, true) : o.longs === Number ? longToNumber(m.newsletterServerId, true) : m.newsletterServerId;
                if (o.oneofs)
                    d._newsletterServerId = "newsletterServerId";
            }
            if (m.eventAdditionalMetadata != null && m.hasOwnProperty("eventAdditionalMetadata")) {
                d.eventAdditionalMetadata = $root.proto.EventAdditionalMetadata.toObject(m.eventAdditionalMetadata, o);
                if (o.oneofs)
                    d._eventAdditionalMetadata = "eventAdditionalMetadata";
            }
            if (m.isMentionedInStatus != null && m.hasOwnProperty("isMentionedInStatus")) {
                d.isMentionedInStatus = m.isMentionedInStatus;
                if (o.oneofs)
                    d._isMentionedInStatus = "isMentionedInStatus";
            }
            if (m.statusMentions && m.statusMentions.length) {
                d.statusMentions = [];
                for (var j = 0; j < m.statusMentions.length; ++j) {
                    d.statusMentions[j] = m.statusMentions[j];
                }
            }
            if (m.targetMessageId != null && m.hasOwnProperty("targetMessageId")) {
                d.targetMessageId = $root.proto.MessageKey.toObject(m.targetMessageId, o);
                if (o.oneofs)
                    d._targetMessageId = "targetMessageId";
            }
            if (m.messageAddOns && m.messageAddOns.length) {
                d.messageAddOns = [];
                for (var j = 0; j < m.messageAddOns.length; ++j) {
                    d.messageAddOns[j] = $root.proto.MessageAddOn.toObject(m.messageAddOns[j], o);
                }
            }
            if (m.statusMentionMessageInfo != null && m.hasOwnProperty("statusMentionMessageInfo")) {
                d.statusMentionMessageInfo = $root.proto.StatusMentionMessage.toObject(m.statusMentionMessageInfo, o);
                if (o.oneofs)
                    d._statusMentionMessageInfo = "statusMentionMessageInfo";
            }
            if (m.isSupportAiMessage != null && m.hasOwnProperty("isSupportAiMessage")) {
                d.isSupportAiMessage = m.isSupportAiMessage;
                if (o.oneofs)
                    d._isSupportAiMessage = "isSupportAiMessage";
            }
            if (m.statusMentionSources && m.statusMentionSources.length) {
                d.statusMentionSources = [];
                for (var j = 0; j < m.statusMentionSources.length; ++j) {
                    d.statusMentionSources[j] = m.statusMentionSources[j];
                }
            }
            if (m.supportAiCitations && m.supportAiCitations.length) {
                d.supportAiCitations = [];
                for (var j = 0; j < m.supportAiCitations.length; ++j) {
                    d.supportAiCitations[j] = $root.proto.Citation.toObject(m.supportAiCitations[j], o);
                }
            }
            if (m.botTargetId != null && m.hasOwnProperty("botTargetId")) {
                d.botTargetId = m.botTargetId;
                if (o.oneofs)
                    d._botTargetId = "botTargetId";
            }
            if (m.groupHistoryIndividualMessageInfo != null && m.hasOwnProperty("groupHistoryIndividualMessageInfo")) {
                d.groupHistoryIndividualMessageInfo = $root.proto.GroupHistoryIndividualMessageInfo.toObject(m.groupHistoryIndividualMessageInfo, o);
                if (o.oneofs)
                    d._groupHistoryIndividualMessageInfo = "groupHistoryIndividualMessageInfo";
            }
            if (m.groupHistoryBundleInfo != null && m.hasOwnProperty("groupHistoryBundleInfo")) {
                d.groupHistoryBundleInfo = $root.proto.GroupHistoryBundleInfo.toObject(m.groupHistoryBundleInfo, o);
                if (o.oneofs)
                    d._groupHistoryBundleInfo = "groupHistoryBundleInfo";
            }
            if (m.interactiveMessageAdditionalMetadata != null && m.hasOwnProperty("interactiveMessageAdditionalMetadata")) {
                d.interactiveMessageAdditionalMetadata = $root.proto.InteractiveMessageAdditionalMetadata.toObject(m.interactiveMessageAdditionalMetadata, o);
                if (o.oneofs)
                    d._interactiveMessageAdditionalMetadata = "interactiveMessageAdditionalMetadata";
            }
            if (m.quarantinedMessage != null && m.hasOwnProperty("quarantinedMessage")) {
                d.quarantinedMessage = $root.proto.QuarantinedMessage.toObject(m.quarantinedMessage, o);
                if (o.oneofs)
                    d._quarantinedMessage = "quarantinedMessage";
            }
            return d;
        };

        WebMessageInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        WebMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.WebMessageInfo";
        };

        WebMessageInfo.BizPrivacyStatus = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "E2EE"] = 0;
            values[valuesById[2] = "FB"] = 2;
            values[valuesById[1] = "BSP"] = 1;
            values[valuesById[3] = "BSP_AND_FB"] = 3;
            return values;
        })();

        WebMessageInfo.Status = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "ERROR"] = 0;
            values[valuesById[1] = "PENDING"] = 1;
            values[valuesById[2] = "SERVER_ACK"] = 2;
            values[valuesById[3] = "DELIVERY_ACK"] = 3;
            values[valuesById[4] = "READ"] = 4;
            values[valuesById[5] = "PLAYED"] = 5;
            return values;
        })();

        WebMessageInfo.StubType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "REVOKE"] = 1;
            values[valuesById[2] = "CIPHERTEXT"] = 2;
            values[valuesById[3] = "FUTUREPROOF"] = 3;
            values[valuesById[4] = "NON_VERIFIED_TRANSITION"] = 4;
            values[valuesById[5] = "UNVERIFIED_TRANSITION"] = 5;
            values[valuesById[6] = "VERIFIED_TRANSITION"] = 6;
            values[valuesById[7] = "VERIFIED_LOW_UNKNOWN"] = 7;
            values[valuesById[8] = "VERIFIED_HIGH"] = 8;
            values[valuesById[9] = "VERIFIED_INITIAL_UNKNOWN"] = 9;
            values[valuesById[10] = "VERIFIED_INITIAL_LOW"] = 10;
            values[valuesById[11] = "VERIFIED_INITIAL_HIGH"] = 11;
            values[valuesById[12] = "VERIFIED_TRANSITION_ANY_TO_NONE"] = 12;
            values[valuesById[13] = "VERIFIED_TRANSITION_ANY_TO_HIGH"] = 13;
            values[valuesById[14] = "VERIFIED_TRANSITION_HIGH_TO_LOW"] = 14;
            values[valuesById[15] = "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN"] = 15;
            values[valuesById[16] = "VERIFIED_TRANSITION_UNKNOWN_TO_LOW"] = 16;
            values[valuesById[17] = "VERIFIED_TRANSITION_LOW_TO_UNKNOWN"] = 17;
            values[valuesById[18] = "VERIFIED_TRANSITION_NONE_TO_LOW"] = 18;
            values[valuesById[19] = "VERIFIED_TRANSITION_NONE_TO_UNKNOWN"] = 19;
            values[valuesById[20] = "GROUP_CREATE"] = 20;
            values[valuesById[21] = "GROUP_CHANGE_SUBJECT"] = 21;
            values[valuesById[22] = "GROUP_CHANGE_ICON"] = 22;
            values[valuesById[23] = "GROUP_CHANGE_INVITE_LINK"] = 23;
            values[valuesById[24] = "GROUP_CHANGE_DESCRIPTION"] = 24;
            values[valuesById[25] = "GROUP_CHANGE_RESTRICT"] = 25;
            values[valuesById[26] = "GROUP_CHANGE_ANNOUNCE"] = 26;
            values[valuesById[27] = "GROUP_PARTICIPANT_ADD"] = 27;
            values[valuesById[28] = "GROUP_PARTICIPANT_REMOVE"] = 28;
            values[valuesById[29] = "GROUP_PARTICIPANT_PROMOTE"] = 29;
            values[valuesById[30] = "GROUP_PARTICIPANT_DEMOTE"] = 30;
            values[valuesById[31] = "GROUP_PARTICIPANT_INVITE"] = 31;
            values[valuesById[32] = "GROUP_PARTICIPANT_LEAVE"] = 32;
            values[valuesById[33] = "GROUP_PARTICIPANT_CHANGE_NUMBER"] = 33;
            values[valuesById[34] = "BROADCAST_CREATE"] = 34;
            values[valuesById[35] = "BROADCAST_ADD"] = 35;
            values[valuesById[36] = "BROADCAST_REMOVE"] = 36;
            values[valuesById[37] = "GENERIC_NOTIFICATION"] = 37;
            values[valuesById[38] = "E2E_IDENTITY_CHANGED"] = 38;
            values[valuesById[39] = "E2E_ENCRYPTED"] = 39;
            values[valuesById[40] = "CALL_MISSED_VOICE"] = 40;
            values[valuesById[41] = "CALL_MISSED_VIDEO"] = 41;
            values[valuesById[42] = "INDIVIDUAL_CHANGE_NUMBER"] = 42;
            values[valuesById[43] = "GROUP_DELETE"] = 43;
            values[valuesById[44] = "GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE"] = 44;
            values[valuesById[45] = "CALL_MISSED_GROUP_VOICE"] = 45;
            values[valuesById[46] = "CALL_MISSED_GROUP_VIDEO"] = 46;
            values[valuesById[47] = "PAYMENT_CIPHERTEXT"] = 47;
            values[valuesById[48] = "PAYMENT_FUTUREPROOF"] = 48;
            values[valuesById[49] = "PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED"] = 49;
            values[valuesById[50] = "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED"] = 50;
            values[valuesById[51] = "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED"] = 51;
            values[valuesById[52] = "PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP"] = 52;
            values[valuesById[53] = "PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP"] = 53;
            values[valuesById[54] = "PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER"] = 54;
            values[valuesById[55] = "PAYMENT_ACTION_SEND_PAYMENT_REMINDER"] = 55;
            values[valuesById[56] = "PAYMENT_ACTION_SEND_PAYMENT_INVITATION"] = 56;
            values[valuesById[57] = "PAYMENT_ACTION_REQUEST_DECLINED"] = 57;
            values[valuesById[58] = "PAYMENT_ACTION_REQUEST_EXPIRED"] = 58;
            values[valuesById[59] = "PAYMENT_ACTION_REQUEST_CANCELLED"] = 59;
            values[valuesById[60] = "BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM"] = 60;
            values[valuesById[61] = "BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP"] = 61;
            values[valuesById[62] = "BIZ_INTRO_TOP"] = 62;
            values[valuesById[63] = "BIZ_INTRO_BOTTOM"] = 63;
            values[valuesById[64] = "BIZ_NAME_CHANGE"] = 64;
            values[valuesById[65] = "BIZ_MOVE_TO_CONSUMER_APP"] = 65;
            values[valuesById[66] = "BIZ_TWO_TIER_MIGRATION_TOP"] = 66;
            values[valuesById[67] = "BIZ_TWO_TIER_MIGRATION_BOTTOM"] = 67;
            values[valuesById[68] = "OVERSIZED"] = 68;
            values[valuesById[69] = "GROUP_CHANGE_NO_FREQUENTLY_FORWARDED"] = 69;
            values[valuesById[70] = "GROUP_V4_ADD_INVITE_SENT"] = 70;
            values[valuesById[71] = "GROUP_PARTICIPANT_ADD_REQUEST_JOIN"] = 71;
            values[valuesById[72] = "CHANGE_EPHEMERAL_SETTING"] = 72;
            values[valuesById[73] = "E2E_DEVICE_CHANGED"] = 73;
            values[valuesById[74] = "VIEWED_ONCE"] = 74;
            values[valuesById[75] = "E2E_ENCRYPTED_NOW"] = 75;
            values[valuesById[76] = "BLUE_MSG_BSP_FB_TO_BSP_PREMISE"] = 76;
            values[valuesById[77] = "BLUE_MSG_BSP_FB_TO_SELF_FB"] = 77;
            values[valuesById[78] = "BLUE_MSG_BSP_FB_TO_SELF_PREMISE"] = 78;
            values[valuesById[79] = "BLUE_MSG_BSP_FB_UNVERIFIED"] = 79;
            values[valuesById[80] = "BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED"] = 80;
            values[valuesById[81] = "BLUE_MSG_BSP_FB_VERIFIED"] = 81;
            values[valuesById[82] = "BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED"] = 82;
            values[valuesById[83] = "BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE"] = 83;
            values[valuesById[84] = "BLUE_MSG_BSP_PREMISE_UNVERIFIED"] = 84;
            values[valuesById[85] = "BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED"] = 85;
            values[valuesById[86] = "BLUE_MSG_BSP_PREMISE_VERIFIED"] = 86;
            values[valuesById[87] = "BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED"] = 87;
            values[valuesById[88] = "BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED"] = 88;
            values[valuesById[89] = "BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED"] = 89;
            values[valuesById[90] = "BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED"] = 90;
            values[valuesById[91] = "BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED"] = 91;
            values[valuesById[92] = "BLUE_MSG_SELF_FB_TO_BSP_PREMISE"] = 92;
            values[valuesById[93] = "BLUE_MSG_SELF_FB_TO_SELF_PREMISE"] = 93;
            values[valuesById[94] = "BLUE_MSG_SELF_FB_UNVERIFIED"] = 94;
            values[valuesById[95] = "BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED"] = 95;
            values[valuesById[96] = "BLUE_MSG_SELF_FB_VERIFIED"] = 96;
            values[valuesById[97] = "BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED"] = 97;
            values[valuesById[98] = "BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE"] = 98;
            values[valuesById[99] = "BLUE_MSG_SELF_PREMISE_UNVERIFIED"] = 99;
            values[valuesById[100] = "BLUE_MSG_SELF_PREMISE_VERIFIED"] = 100;
            values[valuesById[101] = "BLUE_MSG_TO_BSP_FB"] = 101;
            values[valuesById[102] = "BLUE_MSG_TO_CONSUMER"] = 102;
            values[valuesById[103] = "BLUE_MSG_TO_SELF_FB"] = 103;
            values[valuesById[104] = "BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED"] = 104;
            values[valuesById[105] = "BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED"] = 105;
            values[valuesById[106] = "BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED"] = 106;
            values[valuesById[107] = "BLUE_MSG_UNVERIFIED_TO_VERIFIED"] = 107;
            values[valuesById[108] = "BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED"] = 108;
            values[valuesById[109] = "BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED"] = 109;
            values[valuesById[110] = "BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED"] = 110;
            values[valuesById[111] = "BLUE_MSG_VERIFIED_TO_UNVERIFIED"] = 111;
            values[valuesById[112] = "BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED"] = 112;
            values[valuesById[113] = "BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED"] = 113;
            values[valuesById[114] = "BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED"] = 114;
            values[valuesById[115] = "BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED"] = 115;
            values[valuesById[116] = "BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED"] = 116;
            values[valuesById[117] = "BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED"] = 117;
            values[valuesById[118] = "E2E_IDENTITY_UNAVAILABLE"] = 118;
            values[valuesById[119] = "GROUP_CREATING"] = 119;
            values[valuesById[120] = "GROUP_CREATE_FAILED"] = 120;
            values[valuesById[121] = "GROUP_BOUNCED"] = 121;
            values[valuesById[122] = "BLOCK_CONTACT"] = 122;
            values[valuesById[123] = "EPHEMERAL_SETTING_NOT_APPLIED"] = 123;
            values[valuesById[124] = "SYNC_FAILED"] = 124;
            values[valuesById[125] = "SYNCING"] = 125;
            values[valuesById[126] = "BIZ_PRIVACY_MODE_INIT_FB"] = 126;
            values[valuesById[127] = "BIZ_PRIVACY_MODE_INIT_BSP"] = 127;
            values[valuesById[128] = "BIZ_PRIVACY_MODE_TO_FB"] = 128;
            values[valuesById[129] = "BIZ_PRIVACY_MODE_TO_BSP"] = 129;
            values[valuesById[130] = "DISAPPEARING_MODE"] = 130;
            values[valuesById[131] = "E2E_DEVICE_FETCH_FAILED"] = 131;
            values[valuesById[132] = "ADMIN_REVOKE"] = 132;
            values[valuesById[133] = "GROUP_INVITE_LINK_GROWTH_LOCKED"] = 133;
            values[valuesById[134] = "COMMUNITY_LINK_PARENT_GROUP"] = 134;
            values[valuesById[135] = "COMMUNITY_LINK_SIBLING_GROUP"] = 135;
            values[valuesById[136] = "COMMUNITY_LINK_SUB_GROUP"] = 136;
            values[valuesById[137] = "COMMUNITY_UNLINK_PARENT_GROUP"] = 137;
            values[valuesById[138] = "COMMUNITY_UNLINK_SIBLING_GROUP"] = 138;
            values[valuesById[139] = "COMMUNITY_UNLINK_SUB_GROUP"] = 139;
            values[valuesById[140] = "GROUP_PARTICIPANT_ACCEPT"] = 140;
            values[valuesById[141] = "GROUP_PARTICIPANT_LINKED_GROUP_JOIN"] = 141;
            values[valuesById[142] = "COMMUNITY_CREATE"] = 142;
            values[valuesById[143] = "EPHEMERAL_KEEP_IN_CHAT"] = 143;
            values[valuesById[144] = "GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST"] = 144;
            values[valuesById[145] = "GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE"] = 145;
            values[valuesById[146] = "INTEGRITY_UNLINK_PARENT_GROUP"] = 146;
            values[valuesById[147] = "COMMUNITY_PARTICIPANT_PROMOTE"] = 147;
            values[valuesById[148] = "COMMUNITY_PARTICIPANT_DEMOTE"] = 148;
            values[valuesById[149] = "COMMUNITY_PARENT_GROUP_DELETED"] = 149;
            values[valuesById[150] = "COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL"] = 150;
            values[valuesById[151] = "GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP"] = 151;
            values[valuesById[152] = "MASKED_THREAD_CREATED"] = 152;
            values[valuesById[153] = "MASKED_THREAD_UNMASKED"] = 153;
            values[valuesById[154] = "BIZ_CHAT_ASSIGNMENT"] = 154;
            values[valuesById[155] = "CHAT_PSA"] = 155;
            values[valuesById[156] = "CHAT_POLL_CREATION_MESSAGE"] = 156;
            values[valuesById[157] = "CAG_MASKED_THREAD_CREATED"] = 157;
            values[valuesById[158] = "COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED"] = 158;
            values[valuesById[159] = "CAG_INVITE_AUTO_ADD"] = 159;
            values[valuesById[160] = "BIZ_CHAT_ASSIGNMENT_UNASSIGN"] = 160;
            values[valuesById[161] = "CAG_INVITE_AUTO_JOINED"] = 161;
            values[valuesById[162] = "SCHEDULED_CALL_START_MESSAGE"] = 162;
            values[valuesById[163] = "COMMUNITY_INVITE_RICH"] = 163;
            values[valuesById[164] = "COMMUNITY_INVITE_AUTO_ADD_RICH"] = 164;
            values[valuesById[165] = "SUB_GROUP_INVITE_RICH"] = 165;
            values[valuesById[166] = "SUB_GROUP_PARTICIPANT_ADD_RICH"] = 166;
            values[valuesById[167] = "COMMUNITY_LINK_PARENT_GROUP_RICH"] = 167;
            values[valuesById[168] = "COMMUNITY_PARTICIPANT_ADD_RICH"] = 168;
            values[valuesById[169] = "SILENCED_UNKNOWN_CALLER_AUDIO"] = 169;
            values[valuesById[170] = "SILENCED_UNKNOWN_CALLER_VIDEO"] = 170;
            values[valuesById[171] = "GROUP_MEMBER_ADD_MODE"] = 171;
            values[valuesById[172] = "GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD"] = 172;
            values[valuesById[173] = "COMMUNITY_CHANGE_DESCRIPTION"] = 173;
            values[valuesById[174] = "SENDER_INVITE"] = 174;
            values[valuesById[175] = "RECEIVER_INVITE"] = 175;
            values[valuesById[176] = "COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS"] = 176;
            values[valuesById[177] = "PINNED_MESSAGE_IN_CHAT"] = 177;
            values[valuesById[178] = "PAYMENT_INVITE_SETUP_INVITER"] = 178;
            values[valuesById[179] = "PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY"] = 179;
            values[valuesById[180] = "PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE"] = 180;
            values[valuesById[181] = "LINKED_GROUP_CALL_START"] = 181;
            values[valuesById[182] = "REPORT_TO_ADMIN_ENABLED_STATUS"] = 182;
            values[valuesById[183] = "EMPTY_SUBGROUP_CREATE"] = 183;
            values[valuesById[184] = "SCHEDULED_CALL_CANCEL"] = 184;
            values[valuesById[185] = "SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH"] = 185;
            values[valuesById[186] = "GROUP_CHANGE_RECENT_HISTORY_SHARING"] = 186;
            values[valuesById[187] = "PAID_MESSAGE_SERVER_CAMPAIGN_ID"] = 187;
            values[valuesById[188] = "GENERAL_CHAT_CREATE"] = 188;
            values[valuesById[189] = "GENERAL_CHAT_ADD"] = 189;
            values[valuesById[190] = "GENERAL_CHAT_AUTO_ADD_DISABLED"] = 190;
            values[valuesById[191] = "SUGGESTED_SUBGROUP_ANNOUNCE"] = 191;
            values[valuesById[192] = "BIZ_BOT_1P_MESSAGING_ENABLED"] = 192;
            values[valuesById[193] = "CHANGE_USERNAME"] = 193;
            values[valuesById[194] = "BIZ_COEX_PRIVACY_INIT_SELF"] = 194;
            values[valuesById[195] = "BIZ_COEX_PRIVACY_TRANSITION_SELF"] = 195;
            values[valuesById[196] = "SUPPORT_AI_EDUCATION"] = 196;
            values[valuesById[197] = "BIZ_BOT_3P_MESSAGING_ENABLED"] = 197;
            values[valuesById[198] = "REMINDER_SETUP_MESSAGE"] = 198;
            values[valuesById[199] = "REMINDER_SENT_MESSAGE"] = 199;
            values[valuesById[200] = "REMINDER_CANCEL_MESSAGE"] = 200;
            values[valuesById[201] = "BIZ_COEX_PRIVACY_INIT"] = 201;
            values[valuesById[202] = "BIZ_COEX_PRIVACY_TRANSITION"] = 202;
            values[valuesById[203] = "GROUP_DEACTIVATED"] = 203;
            values[valuesById[204] = "COMMUNITY_DEACTIVATE_SIBLING_GROUP"] = 204;
            values[valuesById[205] = "EVENT_UPDATED"] = 205;
            values[valuesById[206] = "EVENT_CANCELED"] = 206;
            values[valuesById[207] = "COMMUNITY_OWNER_UPDATED"] = 207;
            values[valuesById[208] = "COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN"] = 208;
            values[valuesById[209] = "CAPI_GROUP_NE2EE_SYSTEM_MESSAGE"] = 209;
            values[valuesById[210] = "STATUS_MENTION"] = 210;
            values[valuesById[211] = "USER_CONTROLS_SYSTEM_MESSAGE"] = 211;
            values[valuesById[212] = "SUPPORT_SYSTEM_MESSAGE"] = 212;
            values[valuesById[213] = "CHANGE_LID"] = 213;
            values[valuesById[214] = "BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE"] = 214;
            values[valuesById[215] = "BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE"] = 215;
            values[valuesById[216] = "CHANGE_LIMIT_SHARING"] = 216;
            values[valuesById[217] = "GROUP_MEMBER_LINK_MODE"] = 217;
            values[valuesById[218] = "BIZ_AUTOMATICALLY_LABELED_CHAT_SYSTEM_MESSAGE"] = 218;
            values[valuesById[219] = "PHONE_NUMBER_HIDING_CHAT_DEPRECATED_MESSAGE"] = 219;
            values[valuesById[220] = "QUARANTINED_MESSAGE"] = 220;
            values[valuesById[221] = "GROUP_MEMBER_SHARE_GROUP_HISTORY_MODE"] = 221;
            return values;
        })();

        return WebMessageInfo;
    })();

    proto.WebNotificationsInfo = (function() {

        function WebNotificationsInfo(p) {
            this.notifyMessages = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        WebNotificationsInfo.prototype.timestamp = null;
        WebNotificationsInfo.prototype.unreadChats = null;
        WebNotificationsInfo.prototype.notifyMessageCount = null;
        WebNotificationsInfo.prototype.notifyMessages = $util.emptyArray;

        let $oneOfFields;

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebNotificationsInfo.prototype, "_timestamp", {
            get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebNotificationsInfo.prototype, "_unreadChats", {
            get: $util.oneOfGetter($oneOfFields = ["unreadChats"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        // Virtual OneOf for proto3 optional field
        Object.defineProperty(WebNotificationsInfo.prototype, "_notifyMessageCount", {
            get: $util.oneOfGetter($oneOfFields = ["notifyMessageCount"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        WebNotificationsInfo.create = function create(properties) {
            return new WebNotificationsInfo(properties);
        };

        WebNotificationsInfo.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp"))
                w.uint32(16).uint64(m.timestamp);
            if (m.unreadChats != null && Object.hasOwnProperty.call(m, "unreadChats"))
                w.uint32(24).uint32(m.unreadChats);
            if (m.notifyMessageCount != null && Object.hasOwnProperty.call(m, "notifyMessageCount"))
                w.uint32(32).uint32(m.notifyMessageCount);
            if (m.notifyMessages != null && m.notifyMessages.length) {
                for (var i = 0; i < m.notifyMessages.length; ++i)
                    $root.proto.WebMessageInfo.encode(m.notifyMessages[i], w.uint32(42).fork()).ldelim();
            }
            return w;
        };

        WebNotificationsInfo.decode = function decode(r, l, e) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.WebNotificationsInfo();
            while (r.pos < c) {
                var t = r.uint32();
                if (t === e)
                    break;
                switch (t >>> 3) {
                case 2: {
                        m.timestamp = r.uint64();
                        break;
                    }
                case 3: {
                        m.unreadChats = r.uint32();
                        break;
                    }
                case 4: {
                        m.notifyMessageCount = r.uint32();
                        break;
                    }
                case 5: {
                        if (!(m.notifyMessages && m.notifyMessages.length))
                            m.notifyMessages = [];
                        m.notifyMessages.push($root.proto.WebMessageInfo.decode(r, r.uint32()));
                        break;
                    }
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        WebNotificationsInfo.fromObject = function fromObject(d) {
            if (d instanceof $root.proto.WebNotificationsInfo)
                return d;
            var m = new $root.proto.WebNotificationsInfo();
            if (d.timestamp != null) {
                if ($util.Long)
                    (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = true;
                else if (typeof d.timestamp === "string")
                    m.timestamp = parseInt(d.timestamp, 10);
                else if (typeof d.timestamp === "number")
                    m.timestamp = d.timestamp;
                else if (typeof d.timestamp === "object")
                    m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(true);
            }
            if (d.unreadChats != null) {
                m.unreadChats = d.unreadChats >>> 0;
            }
            if (d.notifyMessageCount != null) {
                m.notifyMessageCount = d.notifyMessageCount >>> 0;
            }
            if (d.notifyMessages) {
                if (!Array.isArray(d.notifyMessages))
                    throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected");
                m.notifyMessages = [];
                for (var i = 0; i < d.notifyMessages.length; ++i) {
                    if (typeof d.notifyMessages[i] !== "object")
                        throw TypeError(".proto.WebNotificationsInfo.notifyMessages: object expected");
                    m.notifyMessages[i] = $root.proto.WebMessageInfo.fromObject(d.notifyMessages[i]);
                }
            }
            return m;
        };

        WebNotificationsInfo.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.notifyMessages = [];
            }
            if (m.timestamp != null && m.hasOwnProperty("timestamp")) {
                if (typeof m.timestamp === "number")
                    d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp;
                else
                    d.timestamp = o.longs === String ? longToString(m.timestamp, true) : o.longs === Number ? longToNumber(m.timestamp, true) : m.timestamp;
                if (o.oneofs)
                    d._timestamp = "timestamp";
            }
            if (m.unreadChats != null && m.hasOwnProperty("unreadChats")) {
                d.unreadChats = m.unreadChats;
                if (o.oneofs)
                    d._unreadChats = "unreadChats";
            }
            if (m.notifyMessageCount != null && m.hasOwnProperty("notifyMessageCount")) {
                d.notifyMessageCount = m.notifyMessageCount;
                if (o.oneofs)
                    d._notifyMessageCount = "notifyMessageCount";
            }
            if (m.notifyMessages && m.notifyMessages.length) {
                d.notifyMessages = [];
                for (var j = 0; j < m.notifyMessages.length; ++j) {
                    d.notifyMessages[j] = $root.proto.WebMessageInfo.toObject(m.notifyMessages[j], o);
                }
            }
            return d;
        };

        WebNotificationsInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        WebNotificationsInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/proto.WebNotificationsInfo";
        };

        return WebNotificationsInfo;
    })();

    return proto;
})();

export { $root as default };
