# Path: pyhindsight/lib/ccl_chrome_indexeddb/ccl_v8_value_deserializer.py
# __DEBUG = False
#     STRUCT_LOOKUP = types.MappingProxyType({
#         tag_kInt8Array: "b",
#         tag_kUint8Array: "B",
#         tag_kUint8ClampedArray: "B",
#         tag_kInt16Array: "h",
#         tag_kUint16Array: "H",
#         tag_kInt32Array: "i",
#         tag_kUint32Array: "I",
#         tag_kFloat32Array: "f",
#         tag_kFloat64Array: "d",
#         tag_kBigInt64Array: "q",
#         tag_kBigUint64Array: "Q",
#         tag_kDataView: "c"
#     })
#     __ODDBALLS = {
#         Constants.token_kUndefined: Undefined,
#         Constants.token_kTheHole: Undefined,
#         Constants.token_kNull: None,
#         Constants.token_kTrue: True,
#         Constants.token_kFalse: False,
#     }
#     __WRAPPED_PRIMITIVES = {
#         Constants.token_kTrueObject,
#         Constants.token_kFalseObject,
#         Constants.token_kNumberObject,
#         Constants.token_kBigIntObject,
#         Constants.token_kStringObject
#     }
# def log(msg, debug_only=True):
# def read_le_varint(stream: typing.BinaryIO) -> typing.Optional[typing.Tuple[int, bytes]]:
#     def __bool__(self):
#     def __eq__(self, other):
#     def __repr__(self):
#     def __str__(self):
#     def __init__(self, stream: typing.BinaryIO, host_object_delegate: typing.Callable,
#                  *, is_little_endian=True, is_64bit=True):
#     def _read_raw(self, length: int) -> bytes:
#     def _read_le_varint(self) -> typing.Optional[typing.Tuple[int, bytes]]:
#     def _read_zigzag(self) -> int:
#     def _read_double(self) -> float:
#     def _read_bigint(self) -> int:
#     def _read_utf8_string(self) -> str:
#     def _read_one_byte_string(self) -> typing.AnyStr:
#     def _read_two_byte_string(self) -> str:
#     def _read_string(self) -> str:
#     def _read_object_by_reference(self) -> typing.Any:
#     def _read_tag(self) -> bytes:
#     def _peek_tag(self) -> bytes:
#     def _read_date(self) -> datetime.datetime:
#     def _read_js_regex(self) -> typing.Pattern:
#     def _read_js_object_properties(self, end_tag) -> typing.Iterable[typing.Tuple[typing.Any, typing.Any]]:
#     def _read_js_object(self) -> dict:
#     def _read_js_sparse_array(self) -> list:
#     def _read_js_dense_array(self) -> list:
#     def _read_js_map(self) -> dict:
#     def _read_js_set(self) -> set:
#     def _read_js_arraybuffer(self) -> bytes:
#     def _wrap_js_array_buffer_view(self, raw: bytes) -> tuple:
#     def _read_host_object(self) -> typing.Any:
#     def _not_implemented(self):
#     def _read_object_internal(self) -> typing.Tuple[bytes, typing.Any]:
#     def _read_object(self) -> typing.Any:
#     def _read_header(self) -> int:
#     def read(self) -> typing.Any:
# class _Undefined:
# class Constants:
# class ArrayBufferViewTag:
# class Deserializer:


import sys
import enum
import typing
from dataclasses import dataclass
from pyhindsight.lib.ccl_chrome_indexeddb import ccl_v8_value_deserializer
    #                 If subtag=HmacKeyTag:
    #                     props = keyLengthBytes:uint32_t, hashId:uint32_t
    #                 If subtag=RsaHashedKeyTag:
    #                     props = algorithmId:uint32_t, type:uint32_t,
    #                     modulusLengthBits:uint32_t,
    #                     publicExponentLength:uint32_t,
    #                     publicExponent:byte[publicExponentLength],
    #                     hashId:uint32_t
    #                 If subtag=EcKeyTag:
    #                     props = algorithmId:uint32_t, type:uint32_t,
    #                     namedCurve:uint32_t
    tag_kRTCCertificateTag = b"k"  # length:uint32_t, pemPrivateKey:WebCoreString,
    # pemCertificate:WebCoreString
    tag_kRTCEncodedAudioFrameTag = b"A"  # uint32_t -> transferred audio frame ID
    tag_kRTCEncodedVideoFrameTag = b"V"  # uint32_t -> transferred video frame ID
    tag_kVideoFrameTag = b"v"            # uint32_t -> transferred video frame ID

    # The following tags were used by the Shape Detection API implementation
    # between M71 and M81. During these milestones, the API was always behind
    # a flag. Usage was removed in https:#crrev.com/c/2040378.
    tag_kDeprecatedDetectedBarcodeTag = b"B"
    tag_kDeprecatedDetectedFaceTag = b"F"
    tag_kDeprecatedDetectedTextTag = b"t"

    tag_kDOMExceptionTag = b"x"  # name:String,message:String,stack:String
    tag_kVersionTag = b"\xff"  # version:uint32_t -> Uses this as the file version.


class BlinkV8Deserializer:
    def _read_varint(self, stream) -> int:

# Path: pyhindsight/lib/ccl_chrome_indexeddb/ccl_v8_value_deserializer.py
# __DEBUG = False
#     STRUCT_LOOKUP = types.MappingProxyType({
#         tag_kInt8Array: "b",
#         tag_kUint8Array: "B",
#         tag_kUint8ClampedArray: "B",
#         tag_kInt16Array: "h",
#         tag_kUint16Array: "H",
#         tag_kInt32Array: "i",
#         tag_kUint32Array: "I",
#         tag_kFloat32Array: "f",
#         tag_kFloat64Array: "d",
#         tag_kBigInt64Array: "q",
#         tag_kBigUint64Array: "Q",
#         tag_kDataView: "c"
#     })
#     __ODDBALLS = {
#         Constants.token_kUndefined: Undefined,
#         Constants.token_kTheHole: Undefined,
#         Constants.token_kNull: None,
#         Constants.token_kTrue: True,
#         Constants.token_kFalse: False,
#     }
#     __WRAPPED_PRIMITIVES = {
#         Constants.token_kTrueObject,
#         Constants.token_kFalseObject,
#         Constants.token_kNumberObject,
#         Constants.token_kBigIntObject,
#         Constants.token_kStringObject
#     }
# def log(msg, debug_only=True):
# def read_le_varint(stream: typing.BinaryIO) -> typing.Optional[typing.Tuple[int, bytes]]:
#     def __bool__(self):
#     def __eq__(self, other):
#     def __repr__(self):
#     def __str__(self):
#     def __init__(self, stream: typing.BinaryIO, host_object_delegate: typing.Callable,
#                  *, is_little_endian=True, is_64bit=True):
#     def _read_raw(self, length: int) -> bytes:
#     def _read_le_varint(self) -> typing.Optional[typing.Tuple[int, bytes]]:
#     def _read_zigzag(self) -> int:
#     def _read_double(self) -> float:
#     def _read_bigint(self) -> int:
#     def _read_utf8_string(self) -> str:
#     def _read_one_byte_string(self) -> typing.AnyStr:
#     def _read_two_byte_string(self) -> str:
#     def _read_string(self) -> str:
#     def _read_object_by_reference(self) -> typing.Any:
#     def _read_tag(self) -> bytes:
#     def _peek_tag(self) -> bytes:
#     def _read_date(self) -> datetime.datetime:
#     def _read_js_regex(self) -> typing.Pattern:
#     def _read_js_object_properties(self, end_tag) -> typing.Iterable[typing.Tuple[typing.Any, typing.Any]]:
#     def _read_js_object(self) -> dict:
#     def _read_js_sparse_array(self) -> list:
#     def _read_js_dense_array(self) -> list:
#     def _read_js_map(self) -> dict:
#     def _read_js_set(self) -> set:
#     def _read_js_arraybuffer(self) -> bytes:
#     def _wrap_js_array_buffer_view(self, raw: bytes) -> tuple:
#     def _read_host_object(self) -> typing.Any:
#     def _not_implemented(self):
#     def _read_object_internal(self) -> typing.Tuple[bytes, typing.Any]:
#     def _read_object(self) -> typing.Any:
#     def _read_header(self) -> int:
#     def read(self) -> typing.Any:
# class _Undefined:
# class Constants:
# class ArrayBufferViewTag:
# class Deserializer:


# Path: pyhindsight/lib/ccl_chrome_indexeddb/ccl_blink_value_deserializer.py
import sys
import enum
import typing
from dataclasses import dataclass
from pyhindsight.lib.ccl_chrome_indexeddb import ccl_v8_value_deserializer

    #                 If subtag=HmacKeyTag:
    #                     props = keyLengthBytes:uint32_t, hashId:uint32_t
    #                 If subtag=RsaHashedKeyTag:
    #                     props = algorithmId:uint32_t, type:uint32_t,
    #                     modulusLengthBits:uint32_t,
    #                     publicExponentLength:uint32_t,
    #                     publicExponent:byte[publicExponentLength],
    #                     hashId:uint32_t
    #                 If subtag=EcKeyTag:
    #                     props = algorithmId:uint32_t, type:uint32_t,
    #                     namedCurve:uint32_t
    tag_kRTCCertificateTag = b"k"  # length:uint32_t, pemPrivateKey:WebCoreString,
    # pemCertificate:WebCoreString
    tag_kRTCEncodedAudioFrameTag = b"A"  # uint32_t -> transferred audio frame ID
    tag_kRTCEncodedVideoFrameTag = b"V"  # uint32_t -> transferred video frame ID
    tag_kVideoFrameTag = b"v"            # uint32_t -> transferred video frame ID

    # The following tags were used by the Shape Detection API implementation
    # between M71 and M81. During these milestones, the API was always behind
    # a flag. Usage was removed in https:#crrev.com/c/2040378.
    tag_kDeprecatedDetectedBarcodeTag = b"B"
    tag_kDeprecatedDetectedFaceTag = b"F"
    tag_kDeprecatedDetectedTextTag = b"t"

    tag_kDOMExceptionTag = b"x"  # name:String,message:String,stack:String
    tag_kVersionTag = b"\xff"  # version:uint32_t -> Uses this as the file version.


class BlinkV8Deserializer:
    def _read_varint(self, stream) -> int:

        return ccl_v8_value_deserializer.read_le_varint(stream)[0]