awv3
Version:
⚡ AWV3 embedded CAD
1,457 lines (1,456 loc) • 931 kB
JSON
{
"type": "File",
"start": 0,
"end": 4837,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 127,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 4837,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 127,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 11
},
"identifierName": "pako"
},
"name": "pako"
}
}
],
"source": {
"type": "StringLiteral",
"start": 17,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 23
}
},
"extra": {
"rawValue": "pako",
"raw": "'pako'"
},
"value": "pako"
}
},
{
"type": "ImportDeclaration",
"start": 25,
"end": 65,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 40
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 32,
"end": 38,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 32,
"end": 38,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
},
"identifierName": "base64"
},
"name": "base64"
}
}
],
"source": {
"type": "StringLiteral",
"start": 44,
"end": 64,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 39
}
},
"extra": {
"rawValue": "base64-arraybuffer",
"raw": "'base64-arraybuffer'"
},
"value": "base64-arraybuffer"
},
"trailingComments": [
{
"type": "CommentLine",
"value": " Packs ArrayBuffer into deflated base64 for ClassCAD stream consumption",
"start": 67,
"end": 140,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 73
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 141,
"end": 222,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 81
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "VariableDeclaration",
"start": 148,
"end": 222,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 81
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 154,
"end": 221,
"loc": {
"start": {
"line": 5,
"column": 13
},
"end": {
"line": 5,
"column": 80
}
},
"id": {
"type": "Identifier",
"start": 154,
"end": 158,
"loc": {
"start": {
"line": 5,
"column": 13
},
"end": {
"line": 5,
"column": 17
},
"identifierName": "pack"
},
"name": "pack",
"leadingComments": null
},
"init": {
"type": "ArrowFunctionExpression",
"start": 161,
"end": 221,
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 80
}
},
"id": {
"type": "Identifier",
"start": 154,
"end": 158,
"loc": {
"start": {
"line": 5,
"column": 13
},
"end": {
"line": 5,
"column": 17
},
"identifierName": "pack"
},
"name": "pack",
"leadingComments": null
},
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 161,
"end": 167,
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 26
},
"identifierName": "buffer"
},
"name": "buffer"
}
],
"body": {
"type": "CallExpression",
"start": 171,
"end": 221,
"loc": {
"start": {
"line": 5,
"column": 30
},
"end": {
"line": 5,
"column": 80
}
},
"callee": {
"type": "MemberExpression",
"start": 171,
"end": 184,
"loc": {
"start": {
"line": 5,
"column": 30
},
"end": {
"line": 5,
"column": 43
}
},
"object": {
"type": "Identifier",
"start": 171,
"end": 177,
"loc": {
"start": {
"line": 5,
"column": 30
},
"end": {
"line": 5,
"column": 36
},
"identifierName": "base64"
},
"name": "base64"
},
"property": {
"type": "Identifier",
"start": 178,
"end": 184,
"loc": {
"start": {
"line": 5,
"column": 37
},
"end": {
"line": 5,
"column": 43
},
"identifierName": "encode"
},
"name": "encode"
},
"computed": false
},
"arguments": [
{
"type": "CallExpression",
"start": 185,
"end": 220,
"loc": {
"start": {
"line": 5,
"column": 44
},
"end": {
"line": 5,
"column": 79
}
},
"callee": {
"type": "MemberExpression",
"start": 185,
"end": 197,
"loc": {
"start": {
"line": 5,
"column": 44
},
"end": {
"line": 5,
"column": 56
}
},
"object": {
"type": "Identifier",
"start": 185,
"end": 189,
"loc": {
"start": {
"line": 5,
"column": 44
},
"end": {
"line": 5,
"column": 48
},
"identifierName": "pako"
},
"name": "pako"
},
"property": {
"type": "Identifier",
"start": 190,
"end": 197,
"loc": {
"start": {
"line": 5,
"column": 49
},
"end": {
"line": 5,
"column": 56
},
"identifierName": "deflate"
},
"name": "deflate"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 198,
"end": 204,
"loc": {
"start": {
"line": 5,
"column": 57
},
"end": {
"line": 5,
"column": 63
},
"identifierName": "buffer"
},
"name": "buffer"
},
{
"type": "ObjectExpression",
"start": 206,
"end": 219,
"loc": {
"start": {
"line": 5,
"column": 65
},
"end": {
"line": 5,
"column": 78
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 208,
"end": 217,
"loc": {
"start": {
"line": 5,
"column": 67
},
"end": {
"line": 5,
"column": 76
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 208,
"end": 211,
"loc": {
"start": {
"line": 5,
"column": 67
},
"end": {
"line": 5,
"column": 70
},
"identifierName": "raw"
},
"name": "raw"
},
"value": {
"type": "BooleanLiteral",
"start": 213,
"end": 217,
"loc": {
"start": {
"line": 5,
"column": 72
},
"end": {
"line": 5,
"column": 76
}
},
"value": true
}
}
]
}
]
}
]
}
},
"leadingComments": null
}
],
"kind": "const",
"leadingComments": [
{
"type": "CommentLine",
"value": " Packs ArrayBuffer into deflated base64 for ClassCAD stream consumption",
"start": 67,
"end": 140,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 73
}
}
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": " Helps detecting changes in two array-states",
"start": 224,
"end": 270,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 46
}
}
}
]
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Packs ArrayBuffer into deflated base64 for ClassCAD stream consumption",
"start": 67,
"end": 140,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 73
}
}
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": " Helps detecting changes in two array-states",
"start": 224,
"end": 270,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 46
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 271,
"end": 934,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 27,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "VariableDeclaration",
"start": 278,
"end": 934,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 27,
"column": 1
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 284,
"end": 934,
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 27,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 284,
"end": 293,
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 8,
"column": 22
},
"identifierName": "arrayDiff"
},
"name": "arrayDiff",
"leadingComments": null
},
"init": {
"type": "ArrowFunctionExpression",
"start": 296,
"end": 934,
"loc": {
"start": {
"line": 8,
"column": 25
},
"end": {
"line": 27,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 284,
"end": 293,
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 8,
"column": 22
},
"identifierName": "arrayDiff"
},
"name": "arrayDiff",
"leadingComments": null
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start": 297,
"end": 306,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 35
}
},
"left": {
"type": "Identifier",
"start": 297,
"end": 301,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 30
},
"identifierName": "next"
},
"name": "next"
},
"right": {
"type": "ArrayExpression",
"start": 304,
"end": 306,
"loc": {
"start": {
"line": 8,
"column": 33
},
"end": {
"line": 8,
"column": 35
}
},
"elements": []
}
},
{
"type": "AssignmentPattern",
"start": 308,
"end": 320,
"loc": {
"start": {
"line": 8,
"column": 37
},
"end": {
"line": 8,
"column": 49
}
},
"left": {
"type": "Identifier",
"start": 308,
"end": 315,
"loc": {
"start": {
"line": 8,
"column": 37
},
"end": {
"line": 8,
"column": 44
},
"identifierName": "current"
},
"name": "current"
},
"right": {
"type": "ArrayExpression",
"start": 318,
"end": 320,
"loc": {
"start": {
"line": 8,
"column": 47
},
"end": {
"line": 8,
"column": 49
}
},
"elements": []
}
},
{
"type": "Identifier",
"start": 322,
"end": 333,
"loc": {
"start": {
"line": 8,
"column": 51
},
"end": {
"line": 8,
"column": 62
},
"identifierName": "callbackNew"
},
"name": "callbackNew"
},
{
"type": "Identifier",
"start": 335,
"end": 350,
"loc": {
"start": {
"line": 8,
"column": 64
},
"end": {
"line": 8,
"column": 79
},
"identifierName": "callbackDeleted"
},
"name": "callbackDeleted"
}
],
"body": {
"type": "BlockStatement",
"start": 355,
"end": 934,
"loc": {
"start": {
"line": 8,
"column": 84
},
"end": {
"line": 27,
"column": 1
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 361,
"end": 389,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 32
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 365,
"end": 388,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 31
}
},
"id": {
"type": "Identifier",
"start": 365,
"end": 372,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 15
},
"identifierName": "nextSet"
},
"name": "nextSet"
},
"init": {
"type": "NewExpression",
"start": 375,
"end": 388,
"loc": {
"start": {
"line": 9,
"column": 18
},
"end": {
"line": 9,
"column": 31
}
},
"callee": {
"type": "Identifier",
"start": 379,
"end": 382,
"loc": {
"start": {
"line": 9,
"column": 22
},
"end": {
"line": 9,
"column": 25
},
"identifierName": "Set"
},
"name": "Set"
},
"arguments": [
{
"type": "Identifier",
"start": 383,
"end": 387,
"loc": {
"start": {
"line": 9,
"column": 26
},
"end": {
"line": 9,
"column": 30
},
"identifierName": "next"
},
"name": "next"
}
]
}
}
],
"kind": "let"
},
{
"type": "VariableDeclaration",
"start": 394,
"end": 428,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 38
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 398,
"end": 427,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 37
}
},
"id": {
"type": "Identifier",
"start": 398,
"end": 408,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 18
},
"identifierName": "currentSet"
},
"name": "currentSet"
},
"init": {
"type": "NewExpression",
"start": 411,
"end": 427,
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 37
}
},
"callee": {
"type": "Identifier",
"start": 415,
"end": 418,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 28
},
"identifierName": "Set"
},
"name": "Set"
},
"arguments": [
{
"type": "Identifier",
"start": 419,
"end": 426,
"loc": {
"start": {
"line": 10,
"column": 29
},
"end": {
"line": 10,
"column": 36
},
"identifierName": "current"
},
"name": "current"
}
]
}
}
],
"kind": "let"
},
{
"type": "VariableDeclaration",
"start": 433,
"end": 491,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 62
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 437,
"end": 490,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 61
}
},
"id": {
"type": "Identifier",
"start": 437,
"end": 445,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 16
},
"identifierName": "newItems"
},
"name": "newItems"
},
"init": {
"type": "CallExpression",
"start": 448,
"end": 490,
"loc": {
"start": {
"line": 11,
"column": 19
},
"end": {
"line": 11,
"column": 61
}
},
"callee": {
"type": "MemberExpression",
"start": 448,
"end": 459,
"loc": {
"start": {
"line": 11,
"column": 19
},
"end": {
"line": 11,
"column": 30
}
},
"object": {
"type": "Identifier",
"start": 448,
"end": 452,
"loc": {
"start": {
"line": 11,
"column": 19
},
"end": {
"line": 11,
"column": 23
},
"identifierName": "next"
},
"name": "next"
},
"property": {
"type": "Identifier",
"start": 453,
"end": 459,
"loc": {
"start": {
"line": 11,
"column": 24
},
"end": {
"line": 11,
"column": 30
},
"identifierName": "filter"
},
"name": "filter"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 460,
"end": 489,
"loc": {
"start": {
"line": 11,
"column": 31
},
"end": {
"line": 11,
"column": 60
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 460,
"end": 464,
"loc": {
"start": {
"line": 11,
"column": 31
},
"end": {
"line": 11,
"column": 35
},
"identifierName": "item"
},
"name": "item"
}
],
"body": {
"type": "UnaryExpression",
"start": 468,
"end": 489,
"loc": {
"start": {
"line": 11,
"column": 39
},
"end": {
"line": 11,
"column": 60
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "CallExpression",
"start": 469,
"end": 489,
"loc": {
"start": {
"line": 11,
"column": 40
},
"end": {
"line": 11,
"column": 60
}
},
"callee": {
"type": "MemberExpression",
"start": 469,
"end": 483,
"loc": {
"start": {
"line": 11,
"column": 40
},
"end": {
"line": 11,
"column": 54
}
},
"object": {
"type": "Identifier",
"start": 469,
"end": 479,
"loc": {
"start": {
"line": 11,
"column": 40
},
"end": {
"line": 11,
"column": 50
},
"identifierName": "currentSet"
},
"name": "currentSet"
},
"property": {
"type": "Identifier",
"start": 480,
"end": 483,
"loc": {
"start": {
"line": 11,
"column": 51
},
"end": {
"line": 11,
"column": 54
},
"identifierName": "has"
},
"name": "has"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 484,
"end": 488,
"loc": {
"start": {
"line": 11,
"column": 55
},
"end": {
"line": 11,
"column": 59
},
"identifierName": "item"
},
"name": "item"
}
]
},
"extra": {
"parenthesizedArgument": false
}
}
}
]
}
}
],
"kind": "let"
},
{
"type": "VariableDeclaration",
"start": 496,
"end": 514,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 22
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 500,
"end": 513,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 21
}
},
"id": {
"type": "Identifier",
"start": 500,
"end": 508,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 16
},
"identifierName": "promises"
},
"name": "promises"
},
"init": {
"type": "ArrayExpression",
"start": 511,
"end": 513,
"loc": {
"start": {
"line": 12,
"column": 19
},
"end": {
"line": 12,
"column": 21
}
},
"elements": []
}
}
],
"kind": "let"
},
{
"type": "IfStatement",
"start": 519,
"end": 657,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 18,
"column": 5
}
},
"test": {
"type": "MemberExpression",
"start": 523,
"end": 538,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 23
}
},
"object": {
"type": "Identifier",
"start": 523,
"end": 531,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 16
},
"identifierName": "newItems"
},
"name": "newItems"
},
"property": {
"type": "Identifier",
"start": 532,
"end": 538,
"loc": {
"start": {
"line": 13,
"column": 17
},
"end": {
"line": 13,
"column": 23
},
"identifierName": "length"
},
"name": "length"
},
"computed": false
},
"consequent": {
"type": "BlockStatement",
"start": 540,
"end": 657,
"loc": {
"start": {
"line": 13,
"column": 25
},
"end": {
"line": 18,
"column": 5
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 550,
"end": 586,