// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.7.7
//   protoc               v6.33.5
// source: youtube/api/pfiinnertube/playback_context.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "youtube.api.pfiinnertube";
function createBasePlaybackContext() {
    return { contentPlaybackContext: undefined };
}
export const PlaybackContext = {
    encode(message, writer = new BinaryWriter()) {
        if (message.contentPlaybackContext !== undefined) {
            PlaybackContext_ContentPlaybackContext.encode(message.contentPlaybackContext, writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBasePlaybackContext();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.contentPlaybackContext = PlaybackContext_ContentPlaybackContext.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBasePlaybackContext_ContentPlaybackContext() {
    return {
        deviceSignals: undefined,
        revShareClientId: undefined,
        timeSinceLastAdSeconds: undefined,
        lactMilliseconds: undefined,
        autoplaysSinceLastAd: undefined,
        vis: undefined,
        fling: undefined,
        splay: undefined,
        autoplay: undefined,
        timeOfLastInstreamPrerollAd: undefined,
        currentUrl: undefined,
        referer: undefined,
        loadAnnotationsByDemand: undefined,
        autoCaptionsDefaultOn: undefined,
        slicedBread: undefined,
        autonav: undefined,
        trailer: undefined,
        playerWidthPixels: undefined,
        playerHeightPixels: undefined,
        snd: undefined,
        vnd: undefined,
        uao: undefined,
        mutedAutoplay: undefined,
        enablePrivacyFilter: undefined,
        isLivingRoomDeeplink: undefined,
        signatureTimestamp: undefined,
        isInlinePlaybackNoAd: undefined,
        isInlineUnmutedPlayback: undefined,
        playPackageVersion: undefined,
        isSequenceEntry: undefined,
    };
}
export const PlaybackContext_ContentPlaybackContext = {
    encode(message, writer = new BinaryWriter()) {
        if (message.deviceSignals !== undefined) {
            writer.uint32(10).string(message.deviceSignals);
        }
        if (message.revShareClientId !== undefined) {
            writer.uint32(26).string(message.revShareClientId);
        }
        if (message.timeSinceLastAdSeconds !== undefined) {
            writer.uint32(32).uint32(message.timeSinceLastAdSeconds);
        }
        if (message.lactMilliseconds !== undefined) {
            writer.uint32(40).int64(message.lactMilliseconds);
        }
        if (message.autoplaysSinceLastAd !== undefined) {
            writer.uint32(48).uint32(message.autoplaysSinceLastAd);
        }
        if (message.vis !== undefined) {
            writer.uint32(64).uint32(message.vis);
        }
        if (message.fling !== undefined) {
            writer.uint32(72).bool(message.fling);
        }
        if (message.splay !== undefined) {
            writer.uint32(80).bool(message.splay);
        }
        if (message.autoplay !== undefined) {
            writer.uint32(88).bool(message.autoplay);
        }
        if (message.timeOfLastInstreamPrerollAd !== undefined) {
            writer.uint32(104).uint64(message.timeOfLastInstreamPrerollAd);
        }
        if (message.currentUrl !== undefined) {
            writer.uint32(122).string(message.currentUrl);
        }
        if (message.referer !== undefined) {
            writer.uint32(130).string(message.referer);
        }
        if (message.loadAnnotationsByDemand !== undefined) {
            writer.uint32(184).bool(message.loadAnnotationsByDemand);
        }
        if (message.autoCaptionsDefaultOn !== undefined) {
            writer.uint32(192).bool(message.autoCaptionsDefaultOn);
        }
        if (message.slicedBread !== undefined) {
            writer.uint32(216).bool(message.slicedBread);
        }
        if (message.autonav !== undefined) {
            writer.uint32(232).bool(message.autonav);
        }
        if (message.trailer !== undefined) {
            writer.uint32(240).bool(message.trailer);
        }
        if (message.playerWidthPixels !== undefined) {
            writer.uint32(272).int32(message.playerWidthPixels);
        }
        if (message.playerHeightPixels !== undefined) {
            writer.uint32(280).int32(message.playerHeightPixels);
        }
        if (message.snd !== undefined) {
            writer.uint32(296).int32(message.snd);
        }
        if (message.vnd !== undefined) {
            writer.uint32(304).int32(message.vnd);
        }
        if (message.uao !== undefined) {
            writer.uint32(328).int32(message.uao);
        }
        if (message.mutedAutoplay !== undefined) {
            writer.uint32(352).bool(message.mutedAutoplay);
        }
        if (message.enablePrivacyFilter !== undefined) {
            writer.uint32(368).bool(message.enablePrivacyFilter);
        }
        if (message.isLivingRoomDeeplink !== undefined) {
            writer.uint32(376).bool(message.isLivingRoomDeeplink);
        }
        if (message.signatureTimestamp !== undefined) {
            writer.uint32(384).uint32(message.signatureTimestamp);
        }
        if (message.isInlinePlaybackNoAd !== undefined) {
            writer.uint32(400).bool(message.isInlinePlaybackNoAd);
        }
        if (message.isInlineUnmutedPlayback !== undefined) {
            writer.uint32(408).bool(message.isInlineUnmutedPlayback);
        }
        if (message.playPackageVersion !== undefined) {
            writer.uint32(440).int64(message.playPackageVersion);
        }
        if (message.isSequenceEntry !== undefined) {
            writer.uint32(480).bool(message.isSequenceEntry);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBasePlaybackContext_ContentPlaybackContext();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.deviceSignals = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.revShareClientId = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 32) {
                        break;
                    }
                    message.timeSinceLastAdSeconds = reader.uint32();
                    continue;
                }
                case 5: {
                    if (tag !== 40) {
                        break;
                    }
                    message.lactMilliseconds = longToNumber(reader.int64());
                    continue;
                }
                case 6: {
                    if (tag !== 48) {
                        break;
                    }
                    message.autoplaysSinceLastAd = reader.uint32();
                    continue;
                }
                case 8: {
                    if (tag !== 64) {
                        break;
                    }
                    message.vis = reader.uint32();
                    continue;
                }
                case 9: {
                    if (tag !== 72) {
                        break;
                    }
                    message.fling = reader.bool();
                    continue;
                }
                case 10: {
                    if (tag !== 80) {
                        break;
                    }
                    message.splay = reader.bool();
                    continue;
                }
                case 11: {
                    if (tag !== 88) {
                        break;
                    }
                    message.autoplay = reader.bool();
                    continue;
                }
                case 13: {
                    if (tag !== 104) {
                        break;
                    }
                    message.timeOfLastInstreamPrerollAd = longToNumber(reader.uint64());
                    continue;
                }
                case 15: {
                    if (tag !== 122) {
                        break;
                    }
                    message.currentUrl = reader.string();
                    continue;
                }
                case 16: {
                    if (tag !== 130) {
                        break;
                    }
                    message.referer = reader.string();
                    continue;
                }
                case 23: {
                    if (tag !== 184) {
                        break;
                    }
                    message.loadAnnotationsByDemand = reader.bool();
                    continue;
                }
                case 24: {
                    if (tag !== 192) {
                        break;
                    }
                    message.autoCaptionsDefaultOn = reader.bool();
                    continue;
                }
                case 27: {
                    if (tag !== 216) {
                        break;
                    }
                    message.slicedBread = reader.bool();
                    continue;
                }
                case 29: {
                    if (tag !== 232) {
                        break;
                    }
                    message.autonav = reader.bool();
                    continue;
                }
                case 30: {
                    if (tag !== 240) {
                        break;
                    }
                    message.trailer = reader.bool();
                    continue;
                }
                case 34: {
                    if (tag !== 272) {
                        break;
                    }
                    message.playerWidthPixels = reader.int32();
                    continue;
                }
                case 35: {
                    if (tag !== 280) {
                        break;
                    }
                    message.playerHeightPixels = reader.int32();
                    continue;
                }
                case 37: {
                    if (tag !== 296) {
                        break;
                    }
                    message.snd = reader.int32();
                    continue;
                }
                case 38: {
                    if (tag !== 304) {
                        break;
                    }
                    message.vnd = reader.int32();
                    continue;
                }
                case 41: {
                    if (tag !== 328) {
                        break;
                    }
                    message.uao = reader.int32();
                    continue;
                }
                case 44: {
                    if (tag !== 352) {
                        break;
                    }
                    message.mutedAutoplay = reader.bool();
                    continue;
                }
                case 46: {
                    if (tag !== 368) {
                        break;
                    }
                    message.enablePrivacyFilter = reader.bool();
                    continue;
                }
                case 47: {
                    if (tag !== 376) {
                        break;
                    }
                    message.isLivingRoomDeeplink = reader.bool();
                    continue;
                }
                case 48: {
                    if (tag !== 384) {
                        break;
                    }
                    message.signatureTimestamp = reader.uint32();
                    continue;
                }
                case 50: {
                    if (tag !== 400) {
                        break;
                    }
                    message.isInlinePlaybackNoAd = reader.bool();
                    continue;
                }
                case 51: {
                    if (tag !== 408) {
                        break;
                    }
                    message.isInlineUnmutedPlayback = reader.bool();
                    continue;
                }
                case 55: {
                    if (tag !== 440) {
                        break;
                    }
                    message.playPackageVersion = longToNumber(reader.int64());
                    continue;
                }
                case 60: {
                    if (tag !== 480) {
                        break;
                    }
                    message.isSequenceEntry = reader.bool();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function longToNumber(int64) {
    const num = globalThis.Number(int64.toString());
    if (num > globalThis.Number.MAX_SAFE_INTEGER) {
        throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
    }
    if (num < globalThis.Number.MIN_SAFE_INTEGER) {
        throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
    }
    return num;
}
//# sourceMappingURL=playback_context.js.map