import os
import random
import struct
import time
from collections import OrderedDict


class TypeTags:
    UINT6_BASE = 0
    UINT14_BASE = 64
    NINT4_BASE = 128
    BARRAY4_BASE = 144
    ARRAY5_BASE = 160
    STR5_BASE = 192
    FALSE = 224
    TRUE = 225
    NULL = 226
    UNDEFINED = 227
    UINT16 = 228
    UINT24 = 229
    UINT32 = 230
    UINT64 = 231
    NINT8 = 232
    NINT16 = 233
    NINT32 = 234
    NINT64 = 235
    FLOAT32 = 236
    DOUBLE64 = 237
    TIMESTAMP = 238
    BINARY_ = 239
    CSTRING = 240
    STR8 = 241
    STR_ = 242
    STRREF = 243
    ARRAY8 = 244
    ARRAY_ = 245
    BARRAY8 = 246
    BARRAY_ = 247
    MAP_ = 248
    BMAP_ = 249
    MAPL_ = 250
    BMAPL_ = 251
    STRLUT = 254
    EXTENSION = 255


def bytefrombools(x):
    y = []
    for i in range(0, len(x), 8):
        a, j = 0, 0
        while j < 8 and j < (len(x) - i):
            a |= int(x[i + j]) << (7 - j)
            j += 1
        y.append(a)
    return y


def int32tobytes(x):
    return [x >> 24, x >> 16 & 0xFF, x >> 8 & 0xFF, x & 0xFF]


class Encoder:
    def __init__(self):
        self.keysets = []
        self.keysetsindex = 0
        self.stringhist = {}
        self.output = []

    def createstringhist(self, obj):
        if type(obj) == str:
            obj = obj.encode('utf-8')
            self.stringhist[obj] = self.stringhist.get(obj, 0) + 1
            return
        if type(obj) == list:
            for p in obj:
                self.createstringhist(p)
        elif type(obj) == dict:
            for p in obj:
                self.createstringhist(obj[p])

    def encode(self, obj, keysetstoomit=None):
        if keysetstoomit == None: keysetstoomit = []
        self.keysets = [tuple(p) for p in keysetstoomit]
        self.keysetsindex = len(self.keysets)
        self.output = []
        self.stringhist = OrderedDict()
        self.createstringhist(obj)
        self.stringhist = [(p, ((len(p) + 1) * self.stringhist[p]) - (len(p) + 2 + self.stringhist[p])) for p in
                           self.stringhist]
        self.stringhist = [(-q, p) for (p, q) in self.stringhist if q > 0]
        self.stringhist = [p for (q, p) in sorted(self.stringhist)]
        q = self.stringhist
        if len(self.stringhist) > 255:
            self.stringhist = self.stringhist[:255]
        self.write(obj)
        x = self.output
        self.output = []
        self.stringhist = []
        self.output.append(TypeTags.STRLUT)
        self.output.append(len(q))
        for p in q:
            self.writeStr(p)
        self.writeArray(self.keysets[self.keysetsindex:])
        return self.output + x

    def write(self, x):
        if type(x) == type(None):
            self.output.append(TypeTags.NULL)
        elif x == NULL:
            self.output.append(TypeTags.NULL)
        elif x == UNDEFINED:
            self.output.append(TypeTags.UNDEFINED)
        elif x == DEFAULT:
            self.output += [TypeTags.EXTENSION, 0, TypeTags.UNDEFINED]
        elif x == INFINITY:
            self.output += [TypeTags.FLOAT32, 0x7F, 0x80, 0x00, 0x00]
        elif x == NEGINFINITY:
            self.output += [TypeTags.FLOAT32, 0xFF, 0x80, 0x00, 0x00]
        elif x == NAN:
            self.output += [TypeTags.FLOAT32, 0x7F, 0xC0, 0x00, 0x00]
        else:
            ENCODERS[type(x)](self, x)

    def writeBoolean(self, x):
        if x:
            self.output.append(TypeTags.TRUE)
        else:
            self.output.append(TypeTags.FALSE)

    def writeInt(self, x):
        if abs(x) > 0xFFFFFFFFFFFFFFFF:
            return self.writeFloat(x)
        if x >= 0:
            if x < 64:
                self.output.append(x)
            elif x <= 0x3FFF:
                self.output += [TypeTags.UINT14_BASE | x >> 8, x & 0xFF]
            elif x <= 0xFFFF:
                self.output += [TypeTags.UINT16, x >> 8, x & 0xFF]
            elif x <= 0xFFFFFF:
                self.output += [TypeTags.UINT24, x >> 16, x >> 8 & 0xFF, x & 0xFF]
            elif x <= 0xFFFFFFFF:
                self.output.append(TypeTags.UINT32)
                self.output += int32tobytes(x)
            else:
                self.output.append(TypeTags.UINT64)
                self.output += int32tobytes(x >> 32 & 0xFFFFFFFF)
                self.output += int32tobytes(x & 0xFFFFFFFF)
        else:
            x = -x
            if x <= 15:
                self.output.push(TypeTags.NINT4_BASE | x)
            elif x <= 0xFF:
                self.output += [TypeTags.NINT8, x]
            elif x <= 0xFFFF:
                self.output += [TypeTags.NINT16, x >> 8, x & 0xFF]
            elif x <= 0xFFFFFFFF:
                self.output.append(TypeTags.NINT32)
                self.output += int32tobytes(x)
            else:
                self.output.append(TypeTags.NINT64)
                self.output += int32tobytes(x >> 32 & 0xFFFFFFFF)
                self.output += int32tobytes(x & 0xFFFFFFFF)

    def writeFloat(self, x):
        m = struct.pack("f", x)
        if x == struct.unpack("f", m)[0]:
            self.output.append(TypeTags.FLOAT32)
        else:
            self.output.append(TypeTags.DOUBLE64)
            m = struct.pack("d", x)
        self.output += [m[i] for i in range(len(m) - 1, -1, -1)]

    def writeStr(self, x):
        if isinstance(x, str):
            x = x.encode('utf-8')
        if x in self.stringhist:
            self.output += [TypeTags.STRREF, self.stringhist.index(x)]
            return
        z = False
        xe = []
        for p in x:
            if p == 0:
                z = True
            xe.append(p)
        x = xe
        y = len(x)
        if y < 32:
            self.output.append(TypeTags.STR5_BASE | y)
            self.output += x
        else:
            if not z:
                self.output.append(TypeTags.CSTRING)
                self.output += x
                self.output.append(0)
            else:
                if y <= 255:
                    self.output += [TypeTags.STR8, y]
                else:
                    self.output.append(TypeTags.STR_)
                    self.writeInt(y)
                self.output += x

    def writeArray(self, x):
        isboolarray = True
        for p in x:
            if type(x) != bool:
                isboolarray = False
                break
        if isboolarray:
            if len(x) < 16:
                self.output.append(TypeTags.BARRAY4_BASE | len(x))
            elif len(x) < 256:
                self.output.append(TypeTags.BARRAY8)
                self.output.append(len(x))
            else:
                self.output.append(TypeTags.BARRAY_)
                self.writeInt(len(x))
            self.output += bytefrombools(x)
        else:
            if len(x) < 32:
                self.output.append(TypeTags.ARRAY5_BASE | len(x))
            elif len(x) <= 255:
                self.output.append(TypeTags.ARRAY8)
                self.output.append(len(x))
            else:
                self.output.append(TypeTags.ARRAY_)
                self.writeInt(len(x))
            for p in x:
                self.write(p)

    def writeDict(self, x):
        y = tuple(sorted(x.keys()))
        try:
            k = self.keysets.index(y)
        except:
            self.keysets.append(y)
            k = len(self.keysets) - 1
        isbool = True
        for p in y:
            if type(x[p]) != bool:
                isbool = False
                break
        if isbool:
            self.output.append(TypeTags.BMAP_)
            self.writeInt(k)
            self.output += bytefrombools([x[p] for p in y])
        else:
            self.output.append(TypeTags.MAP_)
            self.writeInt(k)
            for p in y:
                self.write(x[p])


ENCODERS = {
    list: Encoder.writeArray,
    dict: Encoder.writeDict,
    str: Encoder.writeStr,
    # unicode:Encoder.writeStr,
    bool: Encoder.writeBoolean,
    float: Encoder.writeFloat,
    # long:Encoder.writeInt,
    int: Encoder.writeInt,
    tuple: Encoder.writeArray
}


class NULL: pass


class UNDEFINED: pass


class NAN: pass


class INFINITY: pass


class NEGINFINITY: pass


# not using extensions unnecessarily for this
class DEFAULT: pass


__all__ = ['NULL', 'UNDEFINED', 'NAN', 'INFINITY', 'NEGINFINITY', 'DEFAULT', 'Encoder']


def mhash(x, z):
    z = '"' + z + '"'
    x = x & 4294967295
    for p in z:
        x = x ^ ord(p)
        x = x + ((x << 1) + (x << 4) + (x << 7) + (x << 8) + (x << 24))
        x = x & 4294967295
    return "{:08x}".format(x)


def simplehash(x):
    if type(x) != list:
        xx = []
        i = -2
        for i in range(0, len(x) - 1, 2):
            xx.append(ord(x[i]) << 16 | ord(x[i + 1]))
        if i < (len(x) - 2):
            xx.append(ord(x[-1]) << 16)
        x = xx
    y = 0
    for p in x:
        y = ((y << 5) - y + p) & 4294967295
    if y >> 31 == 1:
        return -(4294967296 - int(y))
    else:
        return int(y)


STORAGE_OK = 3
UUID_TOKEN_KEY = "f"
INTEGRITY_KEY = "b"
BUNDLE_SEED_KEY = "c"
BUNDLE_ID_KEY = "d"
FIRMWARE_KEY = "z"
PAYLOAD_KEY = "a"
# GRAPHICSDRIVER=open('graphicsdrivers.txt','r').read().strip().split("\n")
# GRAPHICSDRIVER=[p.strip() for p in GRAPHICSDRIVER]
PIXELDATAS = [(1920, 1040, 937), (2560, 1400, 1297)]

consoleproperties = 'assert\x00clear\x00context\x00count\x00countReset\x00debug\x00dir\x00dirxml\x00error\x00group\x00groupCollapsed\x00groupEnd\x00info\x00log\x00memory\x00profile\x00profileEnd\x00table\x00time\x00timeEnd\x00timeLog\x00timeStamp\x00trace\x00warn'


def test():
    # x = json.loads(open("superpacktest", 'rb').read())
    uuidtoken = 'A97nfY-IAQAAqoWs8TokCGd4ge9wiJWEtTySE7C1pLSDjEe4tzAzwKGvkJ2QASZebdKucn0ewH9eCOfvosJeCA=='

    inittime = int(time.time() * 1000)
    timezonedata = random.choice(["Sun Aug 05 1945 19:16:00 GMT-0400 (Eastern Daylight Time)",
                                  "Sun Aug 05 1945 13:46:00 GMT-0930 (Hawaii-Aleutian Standard Time)",
                                  "Sun Aug 05 1945 14:16:00 GMT-0900 (Alaska Daylight Time)",
                                  "Sun Aug 05 1945 16:16:00 GMT-0700 (Pacific Daylight Time)",
                                  "Sun Aug 05 1945 18:16:00 GMT-0500 (Central Daylight Time)",
                                  "Sun Aug 05 1945 20:16:00 GMT-0300 (Atlantic Daylight Time)",
                                  "Mon Aug 06 1945 02:16:00 GMT+0300 (Central European Summer Time)",
                                  "Mon Aug 06 1945 03:16:00 GMT+0400 (Gulf Standard Time)",
                                  "Mon Aug 06 1945 05:46:00 GMT+0630 (India Standard Time)",
                                  "Mon Aug 06 1945 06:16:00 GMT+0700 (Indochina Time)",
                                  "Mon Aug 06 1945 08:16:00 GMT+0900 (Singapore Standard Time)",
                                  "Mon Aug 06 1945 08:16:00 GMT+0900 (Japan Standard Time)"])
    fonts = [False, True, False, False, False, False, False, True, False, True, True, False, False, False, False, False,
             False, False, False, False, False, False, False, False, False, False, True, False, False, True, False,
             True, False, True, False, False, False, False, False, False, False, False, False, True, True, False, False]

    timestamps = [inittime + random.randint(40, 80), 0, random.randint(500, 800), random.randint(1000, 1500)]
    plugins = [-482629523, 916307581, 1078363890]
    timestamps[-1] = int(time.time() * 1000) - inittime
    signals = []
    signals.append(["0", {"timestamp": inittime}])
    signals.append(["5", 18446744073709550000])  # parseInt('0xFFFFFFFFFFFFFBFF',16)
    signals.append(["7", {"hasDefaultBrowserHelper": False, "hasWidevinePlugin": False,
                          "plugins": plugins}])  # plugin data for chrome
    signals.append(["11", {"dataFragment": 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwA',
                           "hashcode": 1037736760}])  # canvas fingerprint, text 'Hel$&?6%){mZ+#@'
    signals.append(["12", False])  # chrome.webstore
    signals.append(["13", False])  # checking window.Image
    signals.append(["14", simplehash(consoleproperties)])  # checking properties of the object window.console
    signals.append(["15", {"hasToSource": False, "sourceHash": 0, "stringHash": simplehash(
        "function createElement() { [native code] }")}])  # hash of document.createElement.toString()
    signals.append(["21", timezonedata])  # new Date(-770172240000).toString()
    signals.append(["24", {"fonts": fonts, "version": 5}])
    signals.append(["25", {"callable": True, "documentElement": True, "exists": True, "falsy": True, "nullish": True,
                           "type": "undefined"}])  # properties of document.documentElement
    signals.append(["29",
                    [True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True,
                     True, True, True, True]])
    signals.append(["32", {"emptyReferrer": True, "historyLength": 2}])
    signals.append(["34", True])  # typeof indexedDB.open == "function"
    keyevents = []
    signals.append(["39", keyevents])
    mathproperties = ['abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'atan2', 'ceil', 'cbrt', 'expm1',
                      'clz32', 'cos', 'cosh', 'exp', 'floor', 'fround', 'hypot', 'imul', 'log', 'log1p', 'log2',
                      'log10', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan',
                      'tanh', 'trunc', 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2']

    signals.append(
        ["42", {"hash": simplehash("\x00".join(mathproperties)), "mathProperties": mathproperties}])
    mediadeviceids = ["communications", os.urandom(32).hex(), "communications", os.urandom(32).hex(),
                      os.urandom(32).hex(), os.urandom(32).hex(), os.urandom(32).hex(), os.urandom(32).hex()]

    signals.append(["45", [simplehash(p) for p in mediadeviceids]])
    mousemoveevents = {"recent": [], "throttled": []}
    mmoves = mousemoveevents.copy()
    mousebuttonevents = []
    mmoves["throttled"] = [p for p in mmoves["throttled"] if p["timestamp"] < mmoves["recent"][0]["timestamp"]]
    signals.append(["47", {"mouseButtonEvents": mousebuttonevents, "mouseMoveEvents": mmoves}])
    signals.append(["48", {"argumentsValue": '{"0":{"isTrusted":false}}', "hasArguments": True, "hasGlobal": False,
                           "hasProcess": False}])
    signals.append(["51",
                    {"avgAlpha": None, "avgBeta": None, "avgGamma": None, "avgInterval": 0, "numOrientationEvents": 1,
                     "stdDevAlpha": 0, "stdDevBeta": 0, "stdDevGamma": 0, "stdDevInterval": 0}])
    signals.append(["57", {"statuscode": STORAGE_OK, "value": uuidtoken}])
    signals.append(["59", {
        "global": {"ActiveXObject": False, "ApplePaySession": False, "File": True, "MutationObserver": True,
                   "Notification": True, "SharedWorker": True, "TouchEvent": True, "XDomainRequest": False,
                   "_phantom": False, "attachEvent": False, "callPhantom": False, "createPopup": False,
                   "detachEvent": False, "event": True, "external": True, "fireEvent": False, "frameElement": True,
                   "globalStorage": False, "localStorage": True, "mozRTCPeerConnection": False,
                   "mozRequestAnimationFrame": False, "phantom": False, "postMessage": True, "PushManager": True,
                   "registerProtocolHandler": False, "requestAnimationFrame": True, "sessionStorage": True,
                   "sidebar": False, "webkitRequestAnimationFrame": True, "webkitResolveLocalFileSystemURL": True,
                   "webkitRTCPeerConnection": True, "BluetoothUUID": True, "netscape": False,
                   "__fxdriver_unwrapped": False, "_Selenium_IDE_Recorder": False},
        "document": {"_Selenium_IDE_Recorder": False, "all": True, "characterSet": True, "charset": True,
                     "compatMode": True, "documentMode": False, "images": True, "layers": False,
                     "$cdc_asdjflasutopfhvcZLmcfl_": False, "__fxdriver_unwrapped": False,
                     "__webdriver_script_fn": False},
        "documentBody": {"contextMenu": False, "innerText": False, "mozRequestFullScreen": False,
                         "requestFullScreen": False, "webkitRequestFullScreen": False},
        "navigator": {"vibrate": True, "webdriver": False, "credentials": True, "storage": True,
                      "requestMediaKeySystemAccess": True, "bluetooth": True}, "crypto": {"subtle": True},
        "external": {"Sequentum": False}}])
    pixeldata = (2560, 1400, 1297)
    browserdata = {"global": {"innerHeight": pixeldata[2], "innerWidth": pixeldata[0], "outerHeight": pixeldata[1],
                              "outerWidth": pixeldata[0], "screenX": 0, "screenY": 0, "isSecureContext": True,
                              "devicePixelRatio": 1},
                   "screen": {"height": (pixeldata[1] + 40), "width": pixeldata[0], "availHeight": pixeldata[1],
                              "availWidth": pixeldata[1], "pixelDepth": 24, "colorDepth": 24},
                   "navigator": {"appCodeName": "Mozilla", "appName": "Netscape",
                                 "appVersion": "5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
                                 "buildID": None, "cpuClass": None, "hardwareConcurrency": random.choice([12, 24]),
                                 "maxTouchPoints": 0, "platform": "Win32", "product": "Gecko", "productSub": "20030107",
                                 "oscpu": None,
                                 "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
                                 "vendor": "Google Inc.", "vendorSub": "", "doNotTrack": None, "webdriver": False},
                   "operaVersion": None, "toolbar": True, "locationbar": True}
    animationframetimes = []
    k = random.randint(820000, 900000)
    for i in range(0, 10):
        animationframetimes.append(round(float(k) / 1000, 3))
        k += random.randint(16660, 16700)
    signals.append(["60", browserdata])
    signals.append(["61", animationframetimes])  # 10 consecutive requestAnimationFrame
    signals.append(["97", {"afterReady": {"InstallTrigger": True, "controllers": True},
                           "immediately": {"InstallTrigger": True, "controllers": True},
                           "lastChance": {"InstallTrigger": True, "controllers": True}}])
    signals.append(["99", {"bodyAttribute": False, "scriptPresent": False}])
    signals.append(["102",
                    {"description": UNDEFINED, "message": "Cannot read property '0' of null", "name": "TypeError",
                     "num": UNDEFINED, "stack": "TypeError: Cannot read property '0' of null\n    at URL",
                     "stacktrace": UNDEFINED}])
    scriptdata = {"length": 111, "whitespace": 12, "punctuators": 12}
    signals.append(["104", scriptdata])
    signals.append(["106", timestamps])
    signals.append(["109", []])
    signals.append(["110", False])
    signals.append(["111", {"mpeg": "probably", "x-mpeg": "", "x-mpegurl": "", "mp4": "maybe",
                            "mp4; codecs=mp4a.40.2": "probably", "ogg; codecs=opus": "probably",
                            "ogg; codecs=speex": "", "webm; codecs=vorbis": "probably", "wav; codecs=\"0\"": "",
                            "wav; codecs=\"1\"": "probably", "wav; codecs=\"2\"": "", "wave": "", "wave; codecs=0": "",
                            "wave; codecs=1": "", "wave; codecs=2": "", "3gpp; codecs=\"mp4v.20.8, samr\"": "",
                            "webm; codecs=\"vorbis,vp9\"": "probably", "mp4; codecs=\"avc1.42c00d\"": "probably",
                            "webm; codecs=\"vp8, vorbis\"": "probably", "ogg; codecs=theora": "probably",
                            "ogg; codecs=\"theora, speex\"": "", "mp4; codecs=\"avc1.64001E, mp4a.40.2\"": "probably",
                            "mp4; codecs=\"mp4v.20.8, mp4a.40.2\"": "", "mp4; codecs=bogus": "",
                            "mp2t; codecs=\"avc1.42E01E,mp4a.40.2\"": ""}])
    visibilityevents = []
    signals.append(["112", {"events": visibilityevents, "finalState": True, "initialState": True,
                            "visibilityEventCount": len(visibilityevents)}])
    devicedata = {
        "parameters": {"antialias": True, "maxAnisotropy": 16, "dimensions": ["11", "11024", "3276732767"],
                       "params": {"alphaBits": 8, "blueBits": 8, "greenBits": 8, "redBits": 8, "depthBits": 24,
                                  "maxCombinedTextureImageUnits": 32, "maxCubeMapTextureSize": 16384,
                                  "maxFragmentUniformVectors": 1024, "maxRenderbufferSize": 16384,
                                  "maxTextureImageUnits": 16, "maxTextureSize": 16384, "maxVaryingVectors": 30,
                                  "maxVertexAttribs": 16, "maxVertexTextureImageUnits": 16,
                                  "maxVertexUniformVectors": 4096, "renderer": "WebKit WebGL",
                                  "shadingLanguageVersion": "WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)",
                                  "stencilBits": 0, "vendor": "WebKit",
                                  "version": "WebGL 1.0 (OpenGL ES 2.0 Chromium)"},
                       "debugInfo": {"vendor": "Google Inc.", "renderer": "xianka"}},
        "shaderPrecisions": ["23127127", "23127127", "23127127", "23127127", "23127127", "23127127", "03130", "03130",
                             "03130", "03130", "03130", "03130"],
        "supportedExtensions": ["ANGLE_instanced_arrays", "EXT_blend_minmax", "EXT_color_buffer_half_float",
                                "EXT_disjoint_timer_query", "EXT_float_blend", "EXT_frag_depth",
                                "EXT_shader_texture_lod", "EXT_texture_filter_anisotropic",
                                "WEBKIT_EXT_texture_filter_anisotropic", "EXT_sRGB", "KHR_parallel_shader_compile",
                                "OES_element_index_uint", "OES_standard_derivatives", "OES_texture_float",
                                "OES_texture_float_linear", "OES_texture_half_float", "OES_texture_half_float_linear",
                                "OES_vertex_array_object", "WEBGL_color_buffer_float", "WEBGL_compressed_texture_s3tc",
                                "WEBKIT_WEBGL_compressed_texture_s3tc", "WEBGL_compressed_texture_s3tc_srgb",
                                "WEBGL_debug_renderer_info", "WEBGL_debug_shaders", "WEBGL_depth_texture",
                                "WEBKIT_WEBGL_depth_texture", "WEBGL_draw_buffers", "WEBGL_lose_context",
                                "WEBKIT_WEBGL_lose_context"], "contextProperties": -368668372}
    signals.append(["113", devicedata])
    signals.append(["116", DEFAULT])
    signals.append(["custom_ChromeConsole", False])
    signals.append(["custom_webRTC", []])
    signals.append(["m", mhash(2166136261, "199" + "3w5e11264sg00" + uuidtoken[
                                                                     7:20])])  # Object.keys(window).length=199, parseInt('0xFFFFFFFFFFFFFBFF').toString(36)="3w5e11264sg00", 784054202+1382082059=2166136261
    signals.append(["r", "199"])
    data = Encoder().encode({"errors": [], "signals": signals}, [["timestamp"], ["channelCount", "channelCountMod",
                                                                                 "channelInterpretation", "fftSize",
                                                                                 "frequencyBinCount", "maxChannelCount",
                                                                                 "maxDecibels", "minDecibels",
                                                                                 "numberOfInputs", "numberOfOutputs",
                                                                                 "sampleRate", "smoothingTimeConstant",
                                                                                 "state"], ["hash", "max", "min"],
                                                                 ["audio/mpeg", "audio/ogg", "audio/wav", "audio/wave",
                                                                  "audio/webm"],
                                                                 ["hasDefaultBrowserHelper", "hasWidevinePlugin",
                                                                  "plugins"], ["dataFragment", "hashcode"],
                                                                 ["hasToSource", "sourceHash", "stringHash"],
                                                                 ["computedStyleHash"],
                                                                 ["background-repeat: round space;",
                                                                  "border-image: none;", "border-radius: 4px;",
                                                                  "color: var(companyblue);", "display: run-in;",
                                                                  "filter: blur(2px);", "flow-into: main-thread;",
                                                                  "grid-columns: auto 1fr;", "hyphens: auto;",
                                                                  "inline-block: none;", "mask-repeat: repeat-x;",
                                                                  "mask: auto;", "object-fit: contain;",
                                                                  "overflow-scrolling: touch;", "position: sticky;",
                                                                  "resize: both;", "tab-size: 4;",
                                                                  "text-stroke: 2.0px;", "user-select: none;",
                                                                  "word-break: auto;"],
                                                                 ["", "-moz-", "-ms-", "-webkit-"],
                                                                 ["-moz-osx-font-smoothing", "-webkit-app-region",
                                                                  "-webkit-text-size-adjust", "animation",
                                                                  "column-count", "hyphens", "justify-items",
                                                                  "text-align-last", "text-emphasis",
                                                                  "text-orientation"],
                                                                 ["caughtException", "userAgentStyleHash"], [],
                                                                 ["global"], ["pageXOffset", "pageYOffset"],
                                                                 ["fonts", "version"],
                                                                 ["callable", "documentElement", "exists", "falsy",
                                                                  "nullish", "type"], ["foreignElements", "links"],
                                                                 ["innerText", "tagName", "xpath"], [
                                                                     "d83d-dc69-d83c-dffb-200d-2764-fe0f-200d-d83d-dc69-d83c-dffe",
                                                                     "d83d-dd2b", "d83d-ddfe", "d83d-decd", "d83e-dd16",
                                                                     "d83e-dd8b"], ["alpha", "colors"],
                                                                 ["avg", "count", "volume"], ["b", "g", "r"],
                                                                 ["emptyReferrer", "historyLength"],
                                                                 ["completeness", "id", "seen"],
                                                                 ["keyDown", "keyPress", "keyUp"],
                                                                 ["altKey", "ctrlKey", "eventType", "instanceOfUIEvent",
                                                                  "keyCode", "markedAsTrusted", "metaKey",
                                                                  "sequenceNumber", "shiftKey", "target", "timestamp"],
                                                                 ["eventType", "keyCode", "modifierKeys",
                                                                  "sequenceNumber", "target", "timestamp"],
                                                                 ["language", "languages"], ["hash", "mathProperties"],
                                                                 ["mouseClick", "mouseDown", "mouseMove", "mouseUp"],
                                                                 ["button", "eventType", "instanceOfUIEvent",
                                                                  "markedAsTrusted", "oX", "oY", "sequenceNumber",
                                                                  "target", "timestamp", "x", "y"],
                                                                 ["button", "eventType", "instanceOfUIEvent",
                                                                  "markedAsTrusted", "target", "timestamp", "x", "y"],
                                                                 ["mouseButtonEvents", "mouseMoveEvents"],
                                                                 ["button", "eventType", "sequenceNumber", "target",
                                                                  "timestamp", "x", "y"], ["recent", "throttled"],
                                                                 ["eventType", "timestamp", "x", "y"],
                                                                 ["argumentsValue", "hasArguments", "hasGlobal",
                                                                  "hasProcess"], ["nonce"],
                                                                 ["avgAlpha", "avgBeta", "avgGamma", "avgInterval",
                                                                  "numOrientationEvents", "stdDevAlpha", "stdDevBeta",
                                                                  "stdDevGamma", "stdDevInterval"],
                                                                 ["connectStart", "domComplete",
                                                                  "domContentLoadedEventEnd",
                                                                  "domContentLoadedEventStart", "domInteractive",
                                                                  "domLoading", "loadEventEnd", "loadEventStart",
                                                                  "requestStart", "responseEnd", "responseStart"],
                                                                 ["statuscode", "value"],
                                                                 ["document", "documentBody", "external", "global",
                                                                  "navigator"],
                                                                 ["ActiveXObject", "ApplePaySession", "File",
                                                                  "Int8Array", "MutationObserver", "Notification",
                                                                  "PushManager", "SharedWorker", "TouchEvent",
                                                                  "XDomainRequest", "_Selenium_IDE_Recorder",
                                                                  "__fxdriver_unwrapped", "_phantom",
                                                                  "addEventListener", "attachEvent", "awesomium",
                                                                  "callPhantom", "createPopup", "detachEvent",
                                                                  "dispatchEvent", "domAutomationController", "event",
                                                                  "external", "fireEvent", "frames", "getComputedStyle",
                                                                  "globalStorage", "localStorage",
                                                                  "mozRTCPeerConnection", "mozRequestAnimationFrame",
                                                                  "phantom", "postMessage", "registerProtocolHandler",
                                                                  "removeEventListener", "requestAnimationFrame",
                                                                  "sessionStorage", "sidebar",
                                                                  "webkitRTCPeerConnection",
                                                                  "webkitRequestAnimationFrame",
                                                                  "webkitResolveLocalFileSystemURL"],
                                                                 ["$cdc_asdjflasutopfhvcZLmcfl_",
                                                                  "_Selenium_IDE_Recorder", "__fxdriver_unwrapped",
                                                                  "__webdriver_script_fn", "all", "characterSet",
                                                                  "charset", "compatMode", "documentMode",
                                                                  "getElementById", "getElementsByClassName",
                                                                  "hasAttributes", "images", "layers", "querySelector"],
                                                                 ["contextMenu", "innerHTML", "innerText",
                                                                  "mozRequestFullScreen", "requestFullScreen",
                                                                  "webdriver", "webkitRequestFullScreen"], ["vibrate"],
                                                                 ["Sequentum"],
                                                                 ["crypto", "document", "documentBody", "external",
                                                                  "global", "navigator"],
                                                                 ["ActiveXObject", "ApplePaySession", "BluetoothUUID",
                                                                  "File", "MutationObserver", "Notification",
                                                                  "PushManager", "SharedWorker", "TouchEvent",
                                                                  "XDomainRequest", "_Selenium_IDE_Recorder",
                                                                  "__fxdriver_unwrapped", "_phantom", "attachEvent",
                                                                  "callPhantom", "createPopup", "detachEvent", "event",
                                                                  "external", "fireEvent", "frameElement",
                                                                  "globalStorage", "localStorage",
                                                                  "mozRTCPeerConnection", "mozRequestAnimationFrame",
                                                                  "netscape", "phantom", "postMessage",
                                                                  "registerProtocolHandler", "requestAnimationFrame",
                                                                  "sessionStorage", "sidebar",
                                                                  "webkitRTCPeerConnection",
                                                                  "webkitRequestAnimationFrame",
                                                                  "webkitResolveLocalFileSystemURL"],
                                                                 ["$cdc_asdjflasutopfhvcZLmcfl_",
                                                                  "_Selenium_IDE_Recorder", "__fxdriver_unwrapped",
                                                                  "__webdriver_script_fn", "all", "characterSet",
                                                                  "charset", "compatMode", "documentMode", "images",
                                                                  "layers"],
                                                                 ["contextMenu", "innerText", "mozRequestFullScreen",
                                                                  "requestFullScreen", "webkitRequestFullScreen"],
                                                                 ["bluetooth", "credentials",
                                                                  "requestMediaKeySystemAccess", "storage", "vibrate",
                                                                  "webdriver"], ["subtle"],
                                                                 ["global", "locationbar", "navigator", "operaVersion",
                                                                  "screen", "toolbar"],
                                                                 ["devicePixelRatio", "innerHeight", "innerWidth",
                                                                  "isSecureContext", "outerHeight", "outerWidth",
                                                                  "screenX", "screenY"],
                                                                 ["availHeight", "availWidth", "colorDepth", "height",
                                                                  "pixelDepth", "width"],
                                                                 ["appCodeName", "appName", "appVersion", "buildID",
                                                                  "cpuClass", "doNotTrack", "hardwareConcurrency",
                                                                  "maxTouchPoints", "oscpu", "platform", "product",
                                                                  "productSub", "userAgent", "vendor", "vendorSub",
                                                                  "webdriver"], ["ip", "model"],
                                                                 ["constructor", "lastChance"], ["events"],
                                                                 ["accuracy", "timestamp", "x", "y", "z"],
                                                                 ["level", "powerSource", "status", "technology",
                                                                  "temp", "voltage"],
                                                                 ["androidId", "board", "deviceBrand", "deviceModel",
                                                                  "deviceModelNumber", "hardware", "hardwareName",
                                                                  "manufacturer", "osBuildFingerprint", "osBuildNumber",
                                                                  "osName", "osVersion", "product", "serial"],
                                                                 ["availableRam", "availableStorage", "totalRam",
                                                                  "totalStorage"],
                                                                 ["bignox", "bluestacks", "genymotion", "superuser"],
                                                                 ["kernelPatch"],
                                                                 ["country", "currency", "language", "timezone"],
                                                                 ["accuracy", "distance", "timestamp"],
                                                                 ["density", "height", "width"],
                                                                 ["configId", "errorArray", "kernelId", "kernelURI",
                                                                  "kernelUpdateHeaderName", "lastErrorCount",
                                                                  "lastErrorId", "lastErrorTimestamp",
                                                                  "timeSinceLastRequest"],
                                                                 ["jvmVersion", "osArch", "osName", "osVersion"],
                                                                 ["timestamp", "x", "y", "z"], ["level", "status"],
                                                                 ["appBundleName", "appInstallId", "appVersion",
                                                                  "cfBundleInfo", "deviceBrand", "deviceModel",
                                                                  "deviceModelNumber", "intAppVersion", "osType",
                                                                  "osVersion", "sdkVersion"],
                                                                 ["availableStorage", "numCores", "timestamp",
                                                                  "totalRam", "uptimeSinceBoot"],
                                                                 ["brightness", "density", "height", "width"],
                                                                 ["hw.cputype", "hw.model", "hw.physicalcpu",
                                                                  "kern.boottime", "kern.hostname", "kern.proc",
                                                                  "kern.version"], ["appdir"], ["jailbreak"],
                                                                 ["data", "mnt", "storage"], ["eth0", "p2p0", "wlan0"],
                                                                 ["root"], ["cpuinfo", "date", "uname", "whoami"],
                                                                 ["net.hostname", "ro.boot.boottime",
                                                                  "ro.build.date.utc", "ro.build.fingerprint",
                                                                  "ro.runtime.firstboot", "serialno"],
                                                                 ["afterReady", "immediately", "lastChance"],
                                                                 ["InstallTrigger", "controllers"], ["status", "value"],
                                                                 ["bodyAttribute", "scriptPresent"], ["hash"],
                                                                 ["description", "message", "name", "num", "stack",
                                                                  "stacktrace"],
                                                                 ["length", "punctuators", "whitespace"],
                                                                 ["touchEnd", "touchMove", "touchStart"],
                                                                 ["eventType", "timestamp", "touches"],
                                                                 ["oX", "oY", "x", "y"], ["x", "y"],
                                                                 ["3gpp; codecs=\"mp4v.20.8, samr\"",
                                                                  "mp2t; codecs=\"avc1.42E01E,mp4a.40.2\"", "mp4",
                                                                  "mp4; codecs=\"avc1.42c00d\"",
                                                                  "mp4; codecs=\"avc1.64001E, mp4a.40.2\"",
                                                                  "mp4; codecs=\"mp4v.20.8, mp4a.40.2\"",
                                                                  "mp4; codecs=bogus", "mp4; codecs=mp4a.40.2", "mpeg",
                                                                  "ogg; codecs=\"theora, speex\"", "ogg; codecs=opus",
                                                                  "ogg; codecs=speex", "ogg; codecs=theora",
                                                                  "wav; codecs=\"0\"", "wav; codecs=\"1\"",
                                                                  "wav; codecs=\"2\"", "wave", "wave; codecs=0",
                                                                  "wave; codecs=1", "wave; codecs=2",
                                                                  "webm; codecs=\"vorbis,vp9\"",
                                                                  "webm; codecs=\"vp8, vorbis\"", "webm; codecs=vorbis",
                                                                  "x-mpeg", "x-mpegurl"],
                                                                 ["events", "finalState", "initialState",
                                                                  "visibilityEventCount"], ["timestamp", "visible"],
                                                                 ["contextProperties", "parameters", "shaderPrecisions",
                                                                  "supportedExtensions"],
                                                                 ["antialias", "debugInfo", "dimensions",
                                                                  "maxAnisotropy", "params"],
                                                                 ["alphaBits", "blueBits", "depthBits", "greenBits",
                                                                  "maxCombinedTextureImageUnits",
                                                                  "maxCubeMapTextureSize", "maxFragmentUniformVectors",
                                                                  "maxRenderbufferSize", "maxTextureImageUnits",
                                                                  "maxTextureSize", "maxVaryingVectors",
                                                                  "maxVertexAttribs", "maxVertexTextureImageUnits",
                                                                  "maxVertexUniformVectors", "redBits", "renderer",
                                                                  "shadingLanguageVersion", "stencilBits", "vendor",
                                                                  "version"], ["renderer", "vendor"],
                                                                 ["candidate", "ip"],
                                                                 ["hasSpeechSynthesis", "voiceData"],
                                                                 ["hash", "match", "noOfDefaultVoices", "noOfVoices",
                                                                  "relLang", "relVoiceUri"], ["bursts", "events"],
                                                                 ["errors", "signals"]])
    print(data)
    x = Encoder().encode(data, [["timestamp"], ["channelCount", "channelCountMod", "channelInterpretation", "fftSize",
                                                "frequencyBinCount", "maxChannelCount", "maxDecibels", "minDecibels",
                                                "numberOfInputs", "numberOfOutputs", "sampleRate",
                                                "smoothingTimeConstant",
                                                "state"], ["hash", "max", "min"],
                                ["audio/mpeg", "audio/ogg", "audio/wav", "audio/wave", "audio/webm"],
                                ["hasDefaultBrowserHelper", "hasWidevinePlugin", "plugins"],
                                ["dataFragment", "hashcode"],
                                ["hasToSource", "sourceHash", "stringHash"], ["computedStyleHash"],
                                ["background-repeat: round space;", "border-image: none;", "border-radius: 4px;",
                                 "color: var(companyblue);", "display: run-in;", "filter: blur(2px);",
                                 "flow-into: main-thread;", "grid-columns: auto 1fr;", "hyphens: auto;",
                                 "inline-block: none;", "mask-repeat: repeat-x;", "mask: auto;", "object-fit: contain;",
                                 "overflow-scrolling: touch;", "position: sticky;", "resize: both;", "tab-size: 4;",
                                 "text-stroke: 2.0px;", "user-select: none;", "word-break: auto;"],
                                ["", "-moz-", "-ms-", "-webkit-"],
                                ["-moz-osx-font-smoothing", "-webkit-app-region", "-webkit-text-size-adjust",
                                 "animation",
                                 "column-count", "hyphens", "justify-items", "text-align-last", "text-emphasis",
                                 "text-orientation"], ["caughtException", "userAgentStyleHash"], [], ["global"],
                                ["pageXOffset", "pageYOffset"], ["fonts", "version"],
                                ["callable", "documentElement", "exists", "falsy", "nullish", "type"],
                                ["foreignElements", "links"], ["innerText", "tagName", "xpath"],
                                ["d83d-dc69-d83c-dffb-200d-2764-fe0f-200d-d83d-dc69-d83c-dffe", "d83d-dd2b",
                                 "d83d-ddfe",
                                 "d83d-decd", "d83e-dd16", "d83e-dd8b"], ["alpha", "colors"],
                                ["avg", "count", "volume"],
                                ["b", "g", "r"], ["emptyReferrer", "historyLength"], ["completeness", "id", "seen"],
                                ["keyDown", "keyPress", "keyUp"],
                                ["altKey", "ctrlKey", "eventType", "instanceOfUIEvent", "keyCode", "markedAsTrusted",
                                 "metaKey", "sequenceNumber", "shiftKey", "target", "timestamp"],
                                ["eventType", "keyCode", "modifierKeys", "sequenceNumber", "target", "timestamp"],
                                ["language", "languages"], ["hash", "mathProperties"],
                                ["mouseClick", "mouseDown", "mouseMove", "mouseUp"],
                                ["button", "eventType", "instanceOfUIEvent", "markedAsTrusted", "oX", "oY",
                                 "sequenceNumber", "target", "timestamp", "x", "y"],
                                ["button", "eventType", "instanceOfUIEvent", "markedAsTrusted", "target", "timestamp",
                                 "x",
                                 "y"], ["mouseButtonEvents", "mouseMoveEvents"],
                                ["button", "eventType", "sequenceNumber", "target", "timestamp", "x", "y"],
                                ["recent", "throttled"], ["eventType", "timestamp", "x", "y"],
                                ["argumentsValue", "hasArguments", "hasGlobal", "hasProcess"], ["nonce"],
                                ["avgAlpha", "avgBeta", "avgGamma", "avgInterval", "numOrientationEvents",
                                 "stdDevAlpha",
                                 "stdDevBeta", "stdDevGamma", "stdDevInterval"],
                                ["connectStart", "domComplete", "domContentLoadedEventEnd",
                                 "domContentLoadedEventStart",
                                 "domInteractive", "domLoading", "loadEventEnd", "loadEventStart", "requestStart",
                                 "responseEnd", "responseStart"], ["statuscode", "value"],
                                ["document", "documentBody", "external", "global", "navigator"],
                                ["ActiveXObject", "ApplePaySession", "File", "Int8Array", "MutationObserver",
                                 "Notification", "PushManager", "SharedWorker", "TouchEvent", "XDomainRequest",
                                 "_Selenium_IDE_Recorder", "__fxdriver_unwrapped", "_phantom", "addEventListener",
                                 "attachEvent", "awesomium", "callPhantom", "createPopup", "detachEvent",
                                 "dispatchEvent",
                                 "domAutomationController", "event", "external", "fireEvent", "frames",
                                 "getComputedStyle",
                                 "globalStorage", "localStorage", "mozRTCPeerConnection", "mozRequestAnimationFrame",
                                 "phantom", "postMessage", "registerProtocolHandler", "removeEventListener",
                                 "requestAnimationFrame", "sessionStorage", "sidebar", "webkitRTCPeerConnection",
                                 "webkitRequestAnimationFrame", "webkitResolveLocalFileSystemURL"],
                                ["$cdc_asdjflasutopfhvcZLmcfl_", "_Selenium_IDE_Recorder", "__fxdriver_unwrapped",
                                 "__webdriver_script_fn", "all", "characterSet", "charset", "compatMode",
                                 "documentMode",
                                 "getElementById", "getElementsByClassName", "hasAttributes", "images", "layers",
                                 "querySelector"],
                                ["contextMenu", "innerHTML", "innerText", "mozRequestFullScreen", "requestFullScreen",
                                 "webdriver", "webkitRequestFullScreen"], ["vibrate"], ["Sequentum"],
                                ["crypto", "document", "documentBody", "external", "global", "navigator"],
                                ["ActiveXObject", "ApplePaySession", "BluetoothUUID", "File", "MutationObserver",
                                 "Notification", "PushManager", "SharedWorker", "TouchEvent", "XDomainRequest",
                                 "_Selenium_IDE_Recorder", "__fxdriver_unwrapped", "_phantom", "attachEvent",
                                 "callPhantom", "createPopup", "detachEvent", "event", "external", "fireEvent",
                                 "frameElement", "globalStorage", "localStorage", "mozRTCPeerConnection",
                                 "mozRequestAnimationFrame", "netscape", "phantom", "postMessage",
                                 "registerProtocolHandler", "requestAnimationFrame", "sessionStorage", "sidebar",
                                 "webkitRTCPeerConnection", "webkitRequestAnimationFrame",
                                 "webkitResolveLocalFileSystemURL"],
                                ["$cdc_asdjflasutopfhvcZLmcfl_", "_Selenium_IDE_Recorder", "__fxdriver_unwrapped",
                                 "__webdriver_script_fn", "all", "characterSet", "charset", "compatMode",
                                 "documentMode",
                                 "images", "layers"],
                                ["contextMenu", "innerText", "mozRequestFullScreen", "requestFullScreen",
                                 "webkitRequestFullScreen"],
                                ["bluetooth", "credentials", "requestMediaKeySystemAccess", "storage", "vibrate",
                                 "webdriver"], ["subtle"],
                                ["global", "locationbar", "navigator", "operaVersion", "screen", "toolbar"],
                                ["devicePixelRatio", "innerHeight", "innerWidth", "isSecureContext", "outerHeight",
                                 "outerWidth", "screenX", "screenY"],
                                ["availHeight", "availWidth", "colorDepth", "height", "pixelDepth", "width"],
                                ["appCodeName", "appName", "appVersion", "buildID", "cpuClass", "doNotTrack",
                                 "hardwareConcurrency", "maxTouchPoints", "oscpu", "platform", "product", "productSub",
                                 "userAgent", "vendor", "vendorSub", "webdriver"], ["ip", "model"],
                                ["constructor", "lastChance"], ["events"], ["accuracy", "timestamp", "x", "y", "z"],
                                ["level", "powerSource", "status", "technology", "temp", "voltage"],
                                ["androidId", "board", "deviceBrand", "deviceModel", "deviceModelNumber", "hardware",
                                 "hardwareName", "manufacturer", "osBuildFingerprint", "osBuildNumber", "osName",
                                 "osVersion", "product", "serial"],
                                ["availableRam", "availableStorage", "totalRam", "totalStorage"],
                                ["bignox", "bluestacks", "genymotion", "superuser"], ["kernelPatch"],
                                ["country", "currency", "language", "timezone"], ["accuracy", "distance", "timestamp"],
                                ["density", "height", "width"],
                                ["configId", "errorArray", "kernelId", "kernelURI", "kernelUpdateHeaderName",
                                 "lastErrorCount", "lastErrorId", "lastErrorTimestamp", "timeSinceLastRequest"],
                                ["jvmVersion", "osArch", "osName", "osVersion"], ["timestamp", "x", "y", "z"],
                                ["level", "status"],
                                ["appBundleName", "appInstallId", "appVersion", "cfBundleInfo", "deviceBrand",
                                 "deviceModel", "deviceModelNumber", "intAppVersion", "osType", "osVersion",
                                 "sdkVersion"],
                                ["availableStorage", "numCores", "timestamp", "totalRam", "uptimeSinceBoot"],
                                ["brightness", "density", "height", "width"],
                                ["hw.cputype", "hw.model", "hw.physicalcpu", "kern.boottime", "kern.hostname",
                                 "kern.proc",
                                 "kern.version"], ["appdir"], ["jailbreak"], ["data", "mnt", "storage"],
                                ["eth0", "p2p0", "wlan0"], ["root"], ["cpuinfo", "date", "uname", "whoami"],
                                ["net.hostname", "ro.boot.boottime", "ro.build.date.utc", "ro.build.fingerprint",
                                 "ro.runtime.firstboot", "serialno"], ["afterReady", "immediately", "lastChance"],
                                ["InstallTrigger", "controllers"], ["status", "value"],
                                ["bodyAttribute", "scriptPresent"],
                                ["hash"], ["description", "message", "name", "num", "stack", "stacktrace"],
                                ["length", "punctuators", "whitespace"], ["touchEnd", "touchMove", "touchStart"],
                                ["eventType", "timestamp", "touches"], ["oX", "oY", "x", "y"], ["x", "y"],
                                ["3gpp; codecs=\"mp4v.20.8, samr\"", "mp2t; codecs=\"avc1.42E01E,mp4a.40.2\"", "mp4",
                                 "mp4; codecs=\"avc1.42c00d\"", "mp4; codecs=\"avc1.64001E, mp4a.40.2\"",
                                 "mp4; codecs=\"mp4v.20.8, mp4a.40.2\"", "mp4; codecs=bogus", "mp4; codecs=mp4a.40.2",
                                 "mpeg", "ogg; codecs=\"theora, speex\"", "ogg; codecs=opus", "ogg; codecs=speex",
                                 "ogg; codecs=theora", "wav; codecs=\"0\"", "wav; codecs=\"1\"", "wav; codecs=\"2\"",
                                 "wave", "wave; codecs=0", "wave; codecs=1", "wave; codecs=2",
                                 "webm; codecs=\"vorbis,vp9\"", "webm; codecs=\"vp8, vorbis\"", "webm; codecs=vorbis",
                                 "x-mpeg", "x-mpegurl"],
                                ["events", "finalState", "initialState", "visibilityEventCount"],
                                ["timestamp", "visible"],
                                ["contextProperties", "parameters", "shaderPrecisions", "supportedExtensions"],
                                ["antialias", "debugInfo", "dimensions", "maxAnisotropy", "params"],
                                ["alphaBits", "blueBits", "depthBits", "greenBits", "maxCombinedTextureImageUnits",
                                 "maxCubeMapTextureSize", "maxFragmentUniformVectors", "maxRenderbufferSize",
                                 "maxTextureImageUnits", "maxTextureSize", "maxVaryingVectors", "maxVertexAttribs",
                                 "maxVertexTextureImageUnits", "maxVertexUniformVectors", "redBits", "renderer",
                                 "shadingLanguageVersion", "stencilBits", "vendor", "version"], ["renderer", "vendor"],
                                ["candidate", "ip"], ["hasSpeechSynthesis", "voiceData"],
                                ["hash", "match", "noOfDefaultVoices", "noOfVoices", "relLang", "relVoiceUri"],
                                ["bursts", "events"], ["errors", "signals"]])
    print(x)
    print(len(x))


print(test())
