cubing 0.29.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -6
- package/dist/esm/.DS_Store +0 -0
- package/dist/esm/alg/index.js +1 -2
- package/dist/esm/bluetooth/index.js +36 -32
- package/dist/esm/bluetooth/index.js.map +2 -2
- package/dist/esm/{chunk-XRZBPKES.js → chunk-35OK6TQ4.js} +328 -66
- package/dist/esm/chunk-35OK6TQ4.js.map +7 -0
- package/dist/esm/{chunk-WYKXX2XY.js → chunk-4QZRHN6S.js} +10 -8
- package/dist/esm/{chunk-WYKXX2XY.js.map → chunk-4QZRHN6S.js.map} +2 -2
- package/dist/esm/{chunk-2JDBIQSV.js → chunk-5OQ34D3X.js} +7 -7
- package/dist/esm/{chunk-2JDBIQSV.js.map → chunk-5OQ34D3X.js.map} +2 -2
- package/dist/esm/{chunk-U2ONHTIX.js → chunk-6FB2XWAK.js} +33 -31
- package/dist/esm/chunk-6FB2XWAK.js.map +7 -0
- package/dist/esm/{chunk-ZNAYJGVL.js → chunk-C6KMV2PL.js} +2 -2
- package/dist/esm/{chunk-ZNAYJGVL.js.map → chunk-C6KMV2PL.js.map} +0 -0
- package/dist/esm/{chunk-XU5ILFX5.js → chunk-GQBRF4EM.js} +6 -4
- package/dist/esm/{chunk-XU5ILFX5.js.map → chunk-GQBRF4EM.js.map} +2 -2
- package/dist/esm/{chunk-WXCNEGW3.js → chunk-HR5D6SD4.js} +2 -2
- package/dist/esm/{chunk-WXCNEGW3.js.map → chunk-HR5D6SD4.js.map} +2 -2
- package/dist/esm/{chunk-XT3R2ENM.js → chunk-KOAJIBEX.js} +47 -38
- package/dist/esm/chunk-KOAJIBEX.js.map +7 -0
- package/dist/esm/{chunk-OX6O2ZO5.js → chunk-QHWK5RXN.js} +1 -1
- package/dist/esm/chunk-QHWK5RXN.js.map +7 -0
- package/dist/esm/{chunk-GW4FGG42.js → chunk-RI2DAEY6.js} +2 -2
- package/dist/esm/{chunk-GW4FGG42.js.map → chunk-RI2DAEY6.js.map} +0 -0
- package/dist/esm/{chunk-AHEXXC6V.js → chunk-VIUWS2PX.js} +4 -4
- package/dist/esm/chunk-VIUWS2PX.js.map +7 -0
- package/dist/esm/{chunk-2IZUSAXQ.js → chunk-WEYPAZEE.js} +1 -1
- package/dist/esm/{chunk-2IZUSAXQ.js.map → chunk-WEYPAZEE.js.map} +1 -1
- package/dist/esm/{chunk-NI7U4XAZ.js → chunk-ZQT3QSWD.js} +226 -113
- package/dist/esm/chunk-ZQT3QSWD.js.map +7 -0
- package/dist/esm/kpuzzle/index.js +2 -3
- package/dist/esm/notation/index.js +2 -3
- package/dist/esm/protocol/index.js +4 -5
- package/dist/esm/puzzle-geometry/index.js +110 -85
- package/dist/esm/puzzle-geometry/index.js.map +2 -2
- package/dist/esm/puzzles/index.js +10 -7
- package/dist/esm/{puzzles-dynamic-3x3x3-KIG5A6QR.js → puzzles-dynamic-3x3x3-ZKMODX2P.js} +1 -3
- package/dist/esm/{puzzles-dynamic-3x3x3-KIG5A6QR.js.map → puzzles-dynamic-3x3x3-ZKMODX2P.js.map} +1 -1
- package/dist/esm/{puzzles-dynamic-4x4x4-PEDAPUZK.js → puzzles-dynamic-4x4x4-DT42HVIY.js} +1 -3
- package/dist/esm/{puzzles-dynamic-4x4x4-PEDAPUZK.js.map → puzzles-dynamic-4x4x4-DT42HVIY.js.map} +1 -1
- package/dist/esm/{puzzles-dynamic-side-events-5C7LMBWX.js → puzzles-dynamic-side-events-HMUBMHA5.js} +2 -4
- package/dist/esm/{puzzles-dynamic-side-events-5C7LMBWX.js.map → puzzles-dynamic-side-events-HMUBMHA5.js.map} +2 -2
- package/dist/esm/{puzzles-dynamic-unofficial-WWJ4NJMX.js → puzzles-dynamic-unofficial-QXSDLTK5.js} +1 -3
- package/dist/esm/{puzzles-dynamic-unofficial-WWJ4NJMX.js.map → puzzles-dynamic-unofficial-QXSDLTK5.js.map} +1 -1
- package/dist/esm/scramble/index.js +3 -4
- package/dist/esm/search/index.js +8 -9
- package/dist/esm/{search-dynamic-sgs-side-events-4H3X5HLH.js → search-dynamic-sgs-side-events-XNTCWRI4.js} +6 -7
- package/dist/esm/search-dynamic-sgs-side-events-XNTCWRI4.js.map +7 -0
- package/dist/esm/{search-dynamic-sgs-unofficial-7IRW4LVD.js → search-dynamic-sgs-unofficial-5KMZ747E.js} +122 -68
- package/dist/esm/search-dynamic-sgs-unofficial-5KMZ747E.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-3x3x3-7XZTYQMO.js → search-dynamic-solve-3x3x3-TSXPWENP.js} +649 -407
- package/dist/esm/search-dynamic-solve-3x3x3-TSXPWENP.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-4x4x4-7JTJCCSY.js → search-dynamic-solve-4x4x4-FKQ2JWK2.js} +399 -151
- package/dist/esm/search-dynamic-solve-4x4x4-FKQ2JWK2.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-fto-4LI23P6K.js → search-dynamic-solve-fto-GPLW7S5F.js} +74 -35
- package/dist/esm/search-dynamic-solve-fto-GPLW7S5F.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-kilominx-3HEVQ4MC.js → search-dynamic-solve-kilominx-HB2QFUGF.js} +136 -72
- package/dist/esm/search-dynamic-solve-kilominx-HB2QFUGF.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-master_tetraminx-UB32C7MM.js → search-dynamic-solve-master_tetraminx-LR3LJI7O.js} +84 -42
- package/dist/esm/search-dynamic-solve-master_tetraminx-LR3LJI7O.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-sq1-HA72TYF2.js → search-dynamic-solve-sq1-W33UXTDZ.js} +129 -55
- package/dist/esm/search-dynamic-solve-sq1-W33UXTDZ.js.map +7 -0
- package/dist/esm/search-worker-inside-generated-string-5HKZNHKK.js +3884 -0
- package/dist/esm/search-worker-inside-generated-string-5HKZNHKK.js.map +7 -0
- package/dist/esm/{search-worker-js-entry-T6YIT7YD.js → search-worker-js-entry-PDXEE46R.js} +44 -36
- package/dist/esm/search-worker-js-entry-PDXEE46R.js.map +7 -0
- package/dist/esm/{search-worker-ts-entry-OUEC4L5I.js → search-worker-ts-entry-UV2RY2EY.js} +3 -4
- package/dist/esm/{search-worker-ts-entry-OUEC4L5I.js.map → search-worker-ts-entry-UV2RY2EY.js.map} +1 -1
- package/dist/esm/stream/index.js +1 -2
- package/dist/esm/stream/index.js.map +2 -2
- package/dist/esm/twisty/index.js +368 -300
- package/dist/esm/twisty/index.js.map +3 -3
- package/dist/esm/{twisty-dynamic-3d-AZUSXQ5S.js → twisty-dynamic-3d-GPF6TW32.js} +57 -60
- package/dist/esm/twisty-dynamic-3d-GPF6TW32.js.map +7 -0
- package/dist/types/{Alg-137fb0d5.d.ts → Alg-1c8c3757.d.ts} +25 -26
- package/dist/types/{KState-a73111d7.d.ts → KState-7c9e40f4.d.ts} +1 -1
- package/dist/types/{TwizzleLink-bef52ecd.d.ts → TwizzleLink-3f8a01d2.d.ts} +19 -18
- package/dist/types/alg/index.d.ts +30 -8
- package/dist/types/bluetooth/index.d.ts +4 -4
- package/dist/types/{bluetooth-puzzle-8a678993.d.ts → bluetooth-puzzle-a64e9756.d.ts} +2 -2
- package/dist/types/kpuzzle/index.d.ts +2 -2
- package/dist/types/notation/index.d.ts +1 -1
- package/dist/types/{outside-e55f28a0.d.ts → outside-b62aa614.d.ts} +2 -2
- package/dist/types/{parseAlg-a28f7568.d.ts → parseAlg-d5fbee87.d.ts} +1 -1
- package/dist/types/protocol/index.d.ts +2 -2
- package/dist/types/puzzle-geometry/index.d.ts +3 -3
- package/dist/types/puzzles/index.d.ts +8 -6
- package/dist/types/scramble/index.d.ts +3 -3
- package/dist/types/search/index.d.ts +3 -3
- package/dist/types/stream/index.d.ts +3 -3
- package/dist/types/twisty/index.d.ts +5 -5
- package/package.json +51 -147
- package/dist/esm/chunk-AHEXXC6V.js.map +0 -7
- package/dist/esm/chunk-NI7U4XAZ.js.map +0 -7
- package/dist/esm/chunk-OX6O2ZO5.js.map +0 -7
- package/dist/esm/chunk-SBZRVSPK.js +0 -30
- package/dist/esm/chunk-SBZRVSPK.js.map +0 -7
- package/dist/esm/chunk-U2ONHTIX.js.map +0 -7
- package/dist/esm/chunk-XRZBPKES.js.map +0 -7
- package/dist/esm/chunk-XT3R2ENM.js.map +0 -7
- package/dist/esm/search-dynamic-sgs-side-events-4H3X5HLH.js.map +0 -7
- package/dist/esm/search-dynamic-sgs-unofficial-7IRW4LVD.js.map +0 -7
- package/dist/esm/search-dynamic-solve-3x3x3-7XZTYQMO.js.map +0 -7
- package/dist/esm/search-dynamic-solve-4x4x4-7JTJCCSY.js.map +0 -7
- package/dist/esm/search-dynamic-solve-fto-4LI23P6K.js.map +0 -7
- package/dist/esm/search-dynamic-solve-kilominx-3HEVQ4MC.js.map +0 -7
- package/dist/esm/search-dynamic-solve-master_tetraminx-UB32C7MM.js.map +0 -7
- package/dist/esm/search-dynamic-solve-sq1-HA72TYF2.js.map +0 -7
- package/dist/esm/search-worker-inside-generated-string-ZEY77HTF.js +0 -3886
- package/dist/esm/search-worker-inside-generated-string-ZEY77HTF.js.map +0 -7
- package/dist/esm/search-worker-js-entry-T6YIT7YD.js.map +0 -7
- package/dist/esm/twisty-dynamic-3d-AZUSXQ5S.js.map +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AlgNode, a as Alg,
|
|
2
|
-
export { a as Alg, f as AlgBranch,
|
|
3
|
-
export { P as ExperimentalParsed } from '../parseAlg-
|
|
1
|
+
import { A as AlgNode, a as Alg, G as Grouping, M as Move, C as Commutator, b as Conjugate, P as Pause, N as Newline, L as LineComment, c as AlgLeaf, d as AppendOptions } from '../Alg-1c8c3757.js';
|
|
2
|
+
export { a as Alg, f as AlgBranch, c as AlgLeaf, A as AlgNode, h as AppendCancelOptions, C as Commutator, b as Conjugate, G as Grouping, L as LineComment, M as Move, e as MoveModifications, N as Newline, P as Pause, g as PuzzleSpecificSimplifyOptions, Q as QuantumMove, S as SimplifyOptions } from '../Alg-1c8c3757.js';
|
|
3
|
+
export { P as ExperimentalParsed } from '../parseAlg-d5fbee87.js';
|
|
4
4
|
|
|
5
5
|
/** @deprecated */
|
|
6
6
|
declare type Unit = AlgNode;
|
|
@@ -16,6 +16,31 @@ declare class AlgBuilder {
|
|
|
16
16
|
reset(): void;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
declare abstract class TraversalDownUp<DataDown, DataAlgUp, DataAlgNodeUp = DataAlgUp> {
|
|
20
|
+
traverseAlgNode(algNode: AlgNode, dataDown: DataDown): DataAlgNodeUp;
|
|
21
|
+
traverseIntoAlgNode(algNode: AlgNode, dataDown: DataDown): AlgNode;
|
|
22
|
+
abstract traverseAlg(alg: Alg, dataDown: DataDown): DataAlgUp;
|
|
23
|
+
abstract traverseGrouping(grouping: Grouping, dataDown: DataDown): DataAlgNodeUp;
|
|
24
|
+
abstract traverseMove(move: Move, dataDown: DataDown): DataAlgNodeUp;
|
|
25
|
+
abstract traverseCommutator(commutator: Commutator, dataDown: DataDown): DataAlgNodeUp;
|
|
26
|
+
abstract traverseConjugate(conjugate: Conjugate, dataDown: DataDown): DataAlgNodeUp;
|
|
27
|
+
abstract traversePause(pause: Pause, dataDown: DataDown): DataAlgNodeUp;
|
|
28
|
+
abstract traverseNewline(newline: Newline, dataDown: DataDown): DataAlgNodeUp;
|
|
29
|
+
abstract traverseLineComment(comment: LineComment, dataDown: DataDown): DataAlgNodeUp;
|
|
30
|
+
}
|
|
31
|
+
declare abstract class TraversalUp<DataAlgUp, DataAlgNodeUp = DataAlgUp> extends TraversalDownUp<undefined, DataAlgUp, DataAlgNodeUp> {
|
|
32
|
+
traverseAlgNode(algNode: AlgNode): DataAlgNodeUp;
|
|
33
|
+
traverseIntoAlgNode(algNode: AlgNode): AlgNode;
|
|
34
|
+
abstract traverseAlg(alg: Alg): DataAlgUp;
|
|
35
|
+
abstract traverseGrouping(grouping: Grouping): DataAlgNodeUp;
|
|
36
|
+
abstract traverseMove(move: Move): DataAlgNodeUp;
|
|
37
|
+
abstract traverseCommutator(commutator: Commutator): DataAlgNodeUp;
|
|
38
|
+
abstract traverseConjugate(conjugate: Conjugate): DataAlgNodeUp;
|
|
39
|
+
abstract traversePause(pause: Pause): DataAlgNodeUp;
|
|
40
|
+
abstract traverseNewline(newline: Newline): DataAlgNodeUp;
|
|
41
|
+
abstract traverseLineComment(comment: LineComment): DataAlgNodeUp;
|
|
42
|
+
}
|
|
43
|
+
|
|
19
44
|
declare const Example: {
|
|
20
45
|
Sune: Alg;
|
|
21
46
|
AntiSune: Alg;
|
|
@@ -44,10 +69,7 @@ interface AlgCubingNetOptions {
|
|
|
44
69
|
/** @deprecated */
|
|
45
70
|
declare function experimentalAlgCubingNetLink(options: AlgCubingNetOptions): string;
|
|
46
71
|
|
|
47
|
-
declare function experimentalAppendMove(alg: Alg,
|
|
48
|
-
coalesce?: boolean;
|
|
49
|
-
mod?: number;
|
|
50
|
-
}): Alg;
|
|
72
|
+
declare function experimentalAppendMove(alg: Alg, addedMove: Move, options?: AppendOptions): Alg;
|
|
51
73
|
|
|
52
74
|
declare function experimentalIs(v: any, c: typeof Alg | typeof Grouping | typeof LineComment | typeof Commutator | typeof Conjugate | typeof Move | typeof Newline | typeof Pause): boolean;
|
|
53
75
|
|
|
@@ -55,4 +77,4 @@ declare function setAlgDebug(options: {
|
|
|
55
77
|
caratNISSNotationEnabled?: boolean;
|
|
56
78
|
}): void;
|
|
57
79
|
|
|
58
|
-
export { AlgBuilder, AlgCubingNetOptions, Example, Unit, experimentalAlgCubingNetLink, experimentalAppendMove, experimentalIs, keyToMove, setAlgDebug };
|
|
80
|
+
export { AlgBuilder, AlgCubingNetOptions, Example, TraversalDownUp, TraversalUp, Unit, experimentalAlgCubingNetLink, experimentalAppendMove, experimentalIs, keyToMove, setAlgDebug };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { K as KState } from '../KState-
|
|
2
|
-
import { B as BluetoothPuzzle } from '../bluetooth-puzzle-
|
|
3
|
-
export { B as BluetoothPuzzle, A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle-
|
|
4
|
-
import { a as Alg, M as Move } from '../Alg-
|
|
1
|
+
import { K as KState } from '../KState-7c9e40f4.js';
|
|
2
|
+
import { B as BluetoothPuzzle } from '../bluetooth-puzzle-a64e9756.js';
|
|
3
|
+
export { B as BluetoothPuzzle, A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle-a64e9756.js';
|
|
4
|
+
import { a as Alg, M as Move } from '../Alg-1c8c3757.js';
|
|
5
5
|
|
|
6
6
|
declare function enableDebugLogging(enable: boolean): void;
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { K as KState } from './KState-
|
|
1
|
+
import { c as AlgLeaf } from './Alg-1c8c3757.js';
|
|
2
|
+
import { K as KState } from './KState-7c9e40f4.js';
|
|
3
3
|
|
|
4
4
|
interface StreamTransformer {
|
|
5
5
|
transformAlgLeaf(algLeafEvent: AlgLeafEvent): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as KPuzzle, b as KPuzzleDefinition, K as KState, c as KStateData, e as KTransformation, d as KTransformationData } from '../KState-
|
|
2
|
-
import '../Alg-
|
|
1
|
+
export { a as KPuzzle, b as KPuzzleDefinition, K as KState, c as KStateData, e as KTransformation, d as KTransformationData } from '../KState-7c9e40f4.js';
|
|
2
|
+
import '../Alg-1c8c3757.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as Perm } from '../KState-
|
|
2
|
-
export { u as EXPERIMENTAL_PUZZLE_BASE_SHAPES, s as EXPERIMENTAL_PUZZLE_CUT_TYPES, o as ExperimentalPGNotation, v as ExperimentalPuzzleBaseShape, q as ExperimentalPuzzleCutDescription, t as ExperimentalPuzzleCutType, r as ExperimentalPuzzleDescription, j as PuzzleGeometry, Q as Quat, S as StickerDat, k as StickerDatAxis, l as StickerDatFace, m as StickerDatSticker, i as getPG3DNamedPuzzles, g as getPuzzleDescriptionString, f as getPuzzleGeometryByDesc, h as getPuzzleGeometryByName, n as parseOptions, p as parsePuzzleDescription } from '../KState-
|
|
3
|
-
import '../Alg-
|
|
1
|
+
import { P as Perm } from '../KState-7c9e40f4.js';
|
|
2
|
+
export { u as EXPERIMENTAL_PUZZLE_BASE_SHAPES, s as EXPERIMENTAL_PUZZLE_CUT_TYPES, o as ExperimentalPGNotation, v as ExperimentalPuzzleBaseShape, q as ExperimentalPuzzleCutDescription, t as ExperimentalPuzzleCutType, r as ExperimentalPuzzleDescription, j as PuzzleGeometry, Q as Quat, S as StickerDat, k as StickerDatAxis, l as StickerDatFace, m as StickerDatSticker, i as getPG3DNamedPuzzles, g as getPuzzleDescriptionString, f as getPuzzleGeometryByDesc, h as getPuzzleGeometryByName, n as parseOptions, p as parsePuzzleDescription } from '../KState-7c9e40f4.js';
|
|
3
|
+
import '../Alg-1c8c3757.js';
|
|
4
4
|
|
|
5
5
|
declare function schreierSims(g: Perm[], disp: (s: string) => void): bigint;
|
|
6
6
|
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { P as PuzzleID, a as PuzzleLoader } from '../TwizzleLink-
|
|
2
|
-
export { a as PuzzleLoader } from '../TwizzleLink-
|
|
1
|
+
import { P as PuzzleID, a as PuzzleLoader } from '../TwizzleLink-3f8a01d2.js';
|
|
2
|
+
export { a as PuzzleLoader } from '../TwizzleLink-3f8a01d2.js';
|
|
3
3
|
import 'three';
|
|
4
|
-
import '../Alg-
|
|
5
|
-
import '../parseAlg-
|
|
6
|
-
import '../KState-
|
|
4
|
+
import '../Alg-1c8c3757.js';
|
|
5
|
+
import '../parseAlg-d5fbee87.js';
|
|
6
|
+
import '../KState-7c9e40f4.js';
|
|
7
7
|
|
|
8
8
|
interface EventInfo {
|
|
9
9
|
puzzleID: PuzzleID;
|
|
10
10
|
eventName: string;
|
|
11
11
|
}
|
|
12
|
+
declare const wcaEvents: Record<string, EventInfo>;
|
|
12
13
|
/** @category Event Info */
|
|
13
14
|
declare function wcaEventInfo(event: string): EventInfo | null;
|
|
15
|
+
declare const twizzleEvents: Record<string, EventInfo>;
|
|
14
16
|
/** @category Event Info */
|
|
15
17
|
declare function eventInfo(event: string): EventInfo | null;
|
|
16
18
|
|
|
@@ -23,4 +25,4 @@ declare const cube3x3x3: PuzzleLoader;
|
|
|
23
25
|
/** @category All Puzzles */
|
|
24
26
|
declare const puzzles: Record<string, PuzzleLoader>;
|
|
25
27
|
|
|
26
|
-
export { cube2x2x2, cube3x3x3, eventInfo, puzzles, wcaEventInfo };
|
|
28
|
+
export { cube2x2x2, cube3x3x3, eventInfo, puzzles, twizzleEvents, wcaEventInfo, wcaEvents };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { r as randomScrambleForEvent } from '../outside-
|
|
2
|
-
import '../Alg-
|
|
3
|
-
import '../KState-
|
|
1
|
+
export { r as randomScrambleForEvent } from '../outside-b62aa614.js';
|
|
2
|
+
import '../Alg-1c8c3757.js';
|
|
3
|
+
import '../KState-7c9e40f4.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { a as experimentalSolve2x2x2, e as experimentalSolve3x3x3IgnoringCenters, d as setDebug, c as solveMegaminx, b as solvePyraminx, s as solveSkewb } from '../outside-
|
|
2
|
-
import { K as KState } from '../KState-
|
|
3
|
-
import '../Alg-
|
|
1
|
+
export { a as experimentalSolve2x2x2, e as experimentalSolve3x3x3IgnoringCenters, d as setDebug, c as solveMegaminx, b as solvePyraminx, s as solveSkewb } from '../outside-b62aa614.js';
|
|
2
|
+
import { K as KState } from '../KState-7c9e40f4.js';
|
|
3
|
+
import '../Alg-1c8c3757.js';
|
|
4
4
|
|
|
5
5
|
declare function random333State(): Promise<KState>;
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AlgLeafEvent, O as OrientationEvent } from '../bluetooth-puzzle-
|
|
2
|
-
import '../Alg-
|
|
3
|
-
import '../KState-
|
|
1
|
+
import { A as AlgLeafEvent, O as OrientationEvent } from '../bluetooth-puzzle-a64e9756.js';
|
|
2
|
+
import '../Alg-1c8c3757.js';
|
|
3
|
+
import '../KState-7c9e40f4.js';
|
|
4
4
|
|
|
5
5
|
interface ProxyMoveEvent {
|
|
6
6
|
event: "move";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as AlgIndexer, T as Timestamp, D as Duration, b as PuzzleAppearance } from '../TwizzleLink-
|
|
2
|
-
export { A as AlgIndexer, B as BackViewLayout, N as EXPERIMENTAL_PROP_NO_VALUE, M as ExperimentalMillisecondTimestamp, E as ExperimentalStickering, P as PuzzleID, e as TwistyAlgEditor, d as TwistyAlgViewer, c as TwistyPlayer, f as TwistyPlayerConfig, h as TwizzleLink, V as VisualizationFormat, g as backViewLayouts } from '../TwizzleLink-
|
|
3
|
-
import { a as Alg, M as Move } from '../Alg-
|
|
4
|
-
import { a as KPuzzle, K as KState, e as KTransformation } from '../KState-
|
|
1
|
+
import { A as AlgIndexer, T as Timestamp, D as Duration, b as PuzzleAppearance } from '../TwizzleLink-3f8a01d2.js';
|
|
2
|
+
export { A as AlgIndexer, B as BackViewLayout, N as EXPERIMENTAL_PROP_NO_VALUE, M as ExperimentalMillisecondTimestamp, E as ExperimentalStickering, P as PuzzleID, e as TwistyAlgEditor, d as TwistyAlgViewer, c as TwistyPlayer, f as TwistyPlayerConfig, h as TwizzleLink, V as VisualizationFormat, g as backViewLayouts } from '../TwizzleLink-3f8a01d2.js';
|
|
3
|
+
import { a as Alg, M as Move } from '../Alg-1c8c3757.js';
|
|
4
|
+
import { a as KPuzzle, K as KState, e as KTransformation } from '../KState-7c9e40f4.js';
|
|
5
5
|
import 'three';
|
|
6
|
-
import '../parseAlg-
|
|
6
|
+
import '../parseAlg-d5fbee87.js';
|
|
7
7
|
|
|
8
8
|
declare const twistyDebugGlobals: {
|
|
9
9
|
animateRaiseHintFacelets: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cubing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "A collection of JavaScript cubing libraries.",
|
|
5
5
|
"author": "The js.cubing.net team",
|
|
6
6
|
"type": "module",
|
|
@@ -53,37 +53,29 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@types/three": "^0.
|
|
56
|
+
"@types/three": "^0.144.0",
|
|
57
57
|
"@types/web-bluetooth": "^0.0.15",
|
|
58
58
|
"comlink": "^4.3.1",
|
|
59
|
-
"three": "^0.
|
|
59
|
+
"three": "^0.144.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@babel/eslint-parser": "^7.18.9",
|
|
63
|
-
"@babel/preset-env": "^7.18.10",
|
|
64
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
65
62
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
66
63
|
"@types/chai": "^4.3.3",
|
|
67
64
|
"@types/dom-speech-recognition": "^0.0.1",
|
|
68
65
|
"@types/mocha": "^9.1.1",
|
|
69
66
|
"@types/node": "^18.7.2",
|
|
70
|
-
"@
|
|
71
|
-
"@typescript-eslint/parser": "^5.33.0",
|
|
67
|
+
"@types/yargs": "^17.0.12",
|
|
72
68
|
"@web/dev-server-esbuild": "^0.3.2",
|
|
73
69
|
"@web/test-runner": "^0.14.0",
|
|
74
70
|
"@web/test-runner-playwright": "^0.8.10",
|
|
75
71
|
"barely-a-dev-server": "^0.3.4",
|
|
76
72
|
"chai": "^4.3.6",
|
|
77
73
|
"esbuild": "^0.15.3",
|
|
78
|
-
"eslint": "^8.21.0",
|
|
79
|
-
"eslint-config-prettier": "^8.5.0",
|
|
80
|
-
"eslint-plugin-html": "^7.1.0",
|
|
81
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
82
74
|
"jszip": "^3.10.1",
|
|
83
75
|
"mocha": "^10.0.0",
|
|
84
76
|
"peggy": "^2.0.1",
|
|
85
77
|
"playwright": "^1.25.1",
|
|
86
|
-
"
|
|
78
|
+
"rome": "^0.9.2-next",
|
|
87
79
|
"tsup": "^6.2.2",
|
|
88
80
|
"typedoc": "^0.23.10",
|
|
89
81
|
"typescript": "^4.7.4",
|
|
@@ -92,7 +84,8 @@
|
|
|
92
84
|
"minimalDevDependencies": [
|
|
93
85
|
"barely-a-dev-server",
|
|
94
86
|
"esbuild",
|
|
95
|
-
"jszip"
|
|
87
|
+
"jszip",
|
|
88
|
+
"rome"
|
|
96
89
|
],
|
|
97
90
|
"engines": {
|
|
98
91
|
"node": "^16.13 || >=18"
|
|
@@ -108,45 +101,49 @@
|
|
|
108
101
|
"/*/index.d.ts"
|
|
109
102
|
],
|
|
110
103
|
"scripts": {
|
|
111
|
-
"build": "
|
|
112
|
-
"build-esm": "
|
|
113
|
-
"build-types": "
|
|
114
|
-
"build-bin": "
|
|
115
|
-
"build-sites": "
|
|
116
|
-
"build-site-twizzle": "
|
|
117
|
-
"build-site-experiments": "
|
|
118
|
-
"build-site-typedoc": "
|
|
119
|
-
"build-search-worker": "
|
|
120
|
-
"generate-js": "
|
|
121
|
-
"generate-js-parsers": "
|
|
122
|
-
"generate-js-svg": "
|
|
123
|
-
"dev": "
|
|
124
|
-
"link": "
|
|
125
|
-
"clean": "
|
|
126
|
-
"test": "
|
|
127
|
-
"test-fast": "
|
|
128
|
-
"test-all": "
|
|
129
|
-
"test-src": "
|
|
130
|
-
"test-spec": "
|
|
131
|
-
"test-spec-
|
|
132
|
-
"test-
|
|
133
|
-
"test-src-
|
|
134
|
-
"test-src-
|
|
135
|
-
"test-
|
|
136
|
-
"test-
|
|
137
|
-
"
|
|
138
|
-
"test-
|
|
139
|
-
"test-dist
|
|
140
|
-
"test-dist-esm-
|
|
141
|
-
"test-dist-esm-
|
|
142
|
-
"test-dist-esm-
|
|
143
|
-
"test-dist-
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
104
|
+
"build": "make build",
|
|
105
|
+
"build-esm": "make build-esm",
|
|
106
|
+
"build-types": "make build-types",
|
|
107
|
+
"build-bin": "make build-bin",
|
|
108
|
+
"build-sites": "make build-sites",
|
|
109
|
+
"build-site-twizzle": "make build-site-twizzle",
|
|
110
|
+
"build-site-experiments": "make build-site-experiments",
|
|
111
|
+
"build-site-typedoc": "make build-site-typedoc",
|
|
112
|
+
"build-search-worker": "make build-search-worker",
|
|
113
|
+
"generate-js": "make generate-js",
|
|
114
|
+
"generate-js-parsers": "make generate-js-parsers",
|
|
115
|
+
"generate-js-svg": "make generate-js-svg",
|
|
116
|
+
"dev": "make dev",
|
|
117
|
+
"link": "make link",
|
|
118
|
+
"clean": "make clean",
|
|
119
|
+
"test": "make test",
|
|
120
|
+
"test-fast": "make test-fast",
|
|
121
|
+
"test-all": "make test-all",
|
|
122
|
+
"test-src": "make test-src",
|
|
123
|
+
"test-spec": "make test-spec",
|
|
124
|
+
"test-spec-with-coverage": "make test-spec-with-coverage",
|
|
125
|
+
"test-spec-watch": "make test-spec-watch",
|
|
126
|
+
"test-src-internal-import-restrictions": "make test-src-internal-import-restrictions",
|
|
127
|
+
"test-src-does-not-import-dist": "make test-src-does-not-import-dist",
|
|
128
|
+
"test-src-tsc": "make test-src-tsc",
|
|
129
|
+
"test-src-scripts-consistency": "make test-src-scripts-consistency",
|
|
130
|
+
"fix-src-scripts-consistency": "make fix-src-scripts-consistency",
|
|
131
|
+
"test-build": "make test-build",
|
|
132
|
+
"test-dist": "make test-dist",
|
|
133
|
+
"test-dist-esm-node-import": "make test-dist-esm-node-import",
|
|
134
|
+
"test-dist-esm-scramble-all-events": "make test-dist-esm-scramble-all-events",
|
|
135
|
+
"test-dist-esm-perf": "make test-dist-esm-perf",
|
|
136
|
+
"test-dist-esm-plain-esbuild-compat": "make test-dist-esm-plain-esbuild-compat",
|
|
137
|
+
"test-dist-esm-parcel": "make test-dist-esm-parcel",
|
|
138
|
+
"test-dist-esm-vite": "make test-dist-esm-vite",
|
|
139
|
+
"test-dist-sites-experiments": "make test-dist-sites-experiments",
|
|
140
|
+
"format": "make format",
|
|
141
|
+
"setup": "make setup",
|
|
142
|
+
"quick-setup": "make quick-setup",
|
|
143
|
+
"lint": "make lint",
|
|
144
|
+
"lint-ci": "make lint-ci",
|
|
145
|
+
"prepack": "make prepack",
|
|
146
|
+
"postpublish": "make postpublish"
|
|
150
147
|
},
|
|
151
148
|
"keywords": [
|
|
152
149
|
"cubing",
|
|
@@ -158,98 +155,5 @@
|
|
|
158
155
|
"bluetooth",
|
|
159
156
|
"rubik",
|
|
160
157
|
"rubik's"
|
|
161
|
-
]
|
|
162
|
-
"prettier": {
|
|
163
|
-
"semi": true,
|
|
164
|
-
"trailingComma": "all",
|
|
165
|
-
"tabWidth": 2,
|
|
166
|
-
"quoteProps": "consistent"
|
|
167
|
-
},
|
|
168
|
-
"eslintConfig": {
|
|
169
|
-
"parser": "@babel/eslint-parser",
|
|
170
|
-
"parserOptions": {
|
|
171
|
-
"project": "./tsconfig.json"
|
|
172
|
-
},
|
|
173
|
-
"overrides": [
|
|
174
|
-
{
|
|
175
|
-
"files": "**/*.js",
|
|
176
|
-
"parser": "@babel/eslint-parser",
|
|
177
|
-
"extends": [
|
|
178
|
-
"eslint:recommended"
|
|
179
|
-
],
|
|
180
|
-
"rules": {
|
|
181
|
-
"no-unused-vars": [
|
|
182
|
-
"error",
|
|
183
|
-
{
|
|
184
|
-
"argsIgnorePattern": "^_"
|
|
185
|
-
}
|
|
186
|
-
]
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"files": "**/*.ts",
|
|
191
|
-
"parser": "@typescript-eslint/parser",
|
|
192
|
-
"plugins": [
|
|
193
|
-
"@typescript-eslint"
|
|
194
|
-
],
|
|
195
|
-
"extends": [
|
|
196
|
-
"eslint:recommended",
|
|
197
|
-
"plugin:@typescript-eslint/recommended",
|
|
198
|
-
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
|
199
|
-
],
|
|
200
|
-
"rules": {
|
|
201
|
-
"curly": "error",
|
|
202
|
-
"no-throw-literal": "error",
|
|
203
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
204
|
-
"@typescript-eslint/no-floating-promises": "off",
|
|
205
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
206
|
-
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
207
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
208
|
-
"@typescript-eslint/no-misused-promises": "off",
|
|
209
|
-
"@typescript-eslint/require-await": "off",
|
|
210
|
-
"@typescript-eslint/no-unused-vars": [
|
|
211
|
-
"error",
|
|
212
|
-
{
|
|
213
|
-
"argsIgnorePattern": "^_"
|
|
214
|
-
}
|
|
215
|
-
],
|
|
216
|
-
"@typescript-eslint/no-unsafe-argument": "off",
|
|
217
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
218
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
|
219
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
220
|
-
"@typescript-eslint/restrict-plus-operands": "off",
|
|
221
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
|
222
|
-
"@typescript-eslint/no-unsafe-return": "off"
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
],
|
|
226
|
-
"ignorePatterns": [
|
|
227
|
-
"/src/static",
|
|
228
|
-
"/src/cubing/search/search-worker-inside-generated*",
|
|
229
|
-
"parser-peggy.js"
|
|
230
|
-
],
|
|
231
|
-
"globals": {
|
|
232
|
-
"globalThis": false,
|
|
233
|
-
"Promise": false,
|
|
234
|
-
"Symbol": false
|
|
235
|
-
},
|
|
236
|
-
"env": {
|
|
237
|
-
"commonjs": true,
|
|
238
|
-
"browser": true,
|
|
239
|
-
"node": true
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
"babel": {
|
|
243
|
-
"presets": [
|
|
244
|
-
[
|
|
245
|
-
"@babel/preset-env",
|
|
246
|
-
{
|
|
247
|
-
"targets": {
|
|
248
|
-
"node": "current"
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
],
|
|
252
|
-
"@babel/preset-typescript"
|
|
253
|
-
]
|
|
254
|
-
}
|
|
158
|
+
]
|
|
255
159
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/cubing/protocol/binary/orbit-indexing.ts", "../../src/cubing/protocol/binary/binary3x3x3.ts", "../../src/cubing/protocol/binary/hex.ts"],
|
|
4
|
-
"sourcesContent": ["export function identityPermutation(numElems: number): number[] {\n const arr = new Array<number>(numElems);\n for (let i = 0; i < numElems; i++) {\n arr[i] = i;\n }\n return arr;\n}\n\n// Inclusive start, exclusive end (similar to `Array.prototype.slice`)\nexport function orientationsToMask(\n radix: number,\n orientations: number[],\n): number {\n let val = 0;\n for (const orientation of orientations) {\n val *= radix;\n val += orientation;\n }\n return val;\n}\n\n// Inclusive start, exclusive end (similar to `Array.prototype.slice`)\nexport function maskToOrientations(\n radix: number,\n numElems: number,\n mask: number,\n): number[] {\n const arr = [];\n while (mask > 0) {\n arr.push(mask % radix);\n mask = Math.floor(mask / radix);\n }\n return new Array<number>(numElems - arr.length).fill(0).concat(arr.reverse());\n}\n\n// From https://www.jaapsch.net/puzzles/compindx.htm#perm\nexport function permutationToLex(permutation: number[]): number {\n const n = permutation.length;\n let lexicographicIdx = 0;\n for (let i = 0; i < n - 1; i++) {\n lexicographicIdx = lexicographicIdx * (n - i);\n for (let j = i + 1; j < n; j++) {\n if (permutation[i] > permutation[j]) {\n lexicographicIdx += 1;\n }\n }\n }\n return lexicographicIdx;\n}\n\n// From https://www.jaapsch.net/puzzles/compindx.htm#perm\nexport function lexToPermutation(\n numPieces: number,\n lexicographicIdx: number,\n): number[] {\n const permutation: number[] = new Array(numPieces);\n permutation[numPieces - 1] = 0;\n for (let i = numPieces - 2; i >= 0; i--) {\n permutation[i] = lexicographicIdx % (numPieces - i);\n lexicographicIdx = Math.floor(lexicographicIdx / (numPieces - i));\n for (let j = i + 1; j < numPieces; j++) {\n if (permutation[j] >= permutation[i]) {\n permutation[j] = permutation[j] + 1;\n }\n }\n }\n return permutation;\n}\n", "import { KState } from \"../../kpuzzle\";\nimport {\n experimental3x3x3KPuzzle,\n experimentalNormalize3x3x3Orientation,\n experimentalPuzzleOrientation3x3x3Cache,\n experimentalPuzzleOrientation3x3x3Idx,\n} from \"../../puzzles/cubing-private\";\nimport {\n identityPermutation,\n lexToPermutation,\n maskToOrientations,\n orientationsToMask,\n permutationToLex,\n} from \"./orbit-indexing\";\n\n// TODO: combine with `orientPuzzle`?\nexport function reorientPuzzle(\n state: KState,\n idxU: number,\n idxL: number,\n): KState {\n return state.applyTransformation(\n experimentalPuzzleOrientation3x3x3Cache()[idxU][idxL].invert(),\n );\n}\n\ntype Binary3x3x3State = ArrayBuffer;\n\n// Bit lengths of the encoded components, in order.\nconst BIT_LENGTHS = [29, 12, 16, 13, 3, 2, 1, 12];\n\n// These fields are sorted by the order in which they appear in the binary format.\nexport interface Binary3x3x3Components {\n epLex: number; // 29 bits, edge permutation\n eoMask: number; // 12 bits, edge orientation\n cpLex: number; // 16 bits, corner permutation\n coMask: number; // 13 bits, corner orientation\n poIdxU: number; // 3 bits, puzzle orientation (U face)\n poIdxL: number; // 2 bits, puzzle orientation (L face)\n moSupport: number; // 1 bit, center orientation support\n moMask: number; // 12 bits, center orientation\n}\n\n// There are various clever ways to do this, but this is simple and efficient.\nfunction arraySum(arr: number[]): number {\n let total = 0;\n for (const entry of arr) {\n total += entry;\n }\n return total;\n}\n\n// Due to limitations in JS bit operations, this is unsafe if any of the bit lengths span across the contents of more than 4 bytes.\n// - Safe: [8, 32]\n// - Unsafe: [4, 32, 4]\n// - Unsafe: [40, 4]\nfunction splitBinary(bitLengths: number[], buffy: ArrayBuffer): number[] {\n const u8buffy = new Uint8Array(buffy);\n let at = 0;\n let bits = 0;\n let accum = 0;\n const values: number[] = [];\n for (const bitLength of bitLengths) {\n while (bits < bitLength) {\n accum = (accum << 8) | u8buffy[at++];\n bits += 8;\n }\n values.push((accum >> (bits - bitLength)) & ((1 << bitLength) - 1));\n bits -= bitLength;\n }\n return values;\n}\n\n// See above for safety notes.\nfunction concatBinary(bitLengths: number[], values: number[]): ArrayBuffer {\n const buffy = new Uint8Array(Math.ceil(arraySum(bitLengths) / 8));\n let at = 0;\n let bits = 0;\n let accum = 0;\n for (let i = 0; i < bitLengths.length; i++) {\n accum = (accum << bitLengths[i]) | values[i];\n bits += bitLengths[i];\n while (bits >= 8) {\n buffy[at++] = accum >> (bits - 8);\n bits -= 8;\n }\n }\n if (bits > 0) {\n buffy[at++] = accum << (8 - bits);\n }\n return buffy;\n}\n\n// 0x111 (for idxU) means \"not supported\"\nfunction supportsPuzzleOrientation(components: Binary3x3x3Components): boolean {\n return components.poIdxU !== 7;\n}\n\nexport function reid3x3x3ToBinaryComponents(\n state: KState,\n): Binary3x3x3Components {\n const normedState = experimentalNormalize3x3x3Orientation(state);\n\n const epLex = permutationToLex(normedState.stateData[\"EDGES\"].pieces);\n const eoMask = orientationsToMask(\n 2,\n normedState.stateData[\"EDGES\"].orientation,\n );\n const cpLex = permutationToLex(normedState.stateData[\"CORNERS\"].pieces);\n const coMask = orientationsToMask(\n 3,\n normedState.stateData[\"CORNERS\"].orientation,\n );\n const [poIdxU, poIdxL] = experimentalPuzzleOrientation3x3x3Idx(state);\n const moSupport = 1; // Required for now.\n const moMask = orientationsToMask(\n 4,\n normedState.stateData[\"CENTERS\"].orientation,\n );\n\n return {\n epLex,\n eoMask,\n cpLex,\n coMask,\n poIdxU,\n poIdxL,\n moSupport,\n moMask,\n };\n}\n\nexport function binaryComponentsToTwizzleBinary(\n components: Binary3x3x3Components,\n): Binary3x3x3State {\n const { epLex, eoMask, cpLex, coMask, poIdxU, poIdxL, moSupport, moMask } =\n components;\n\n return concatBinary(BIT_LENGTHS, [\n epLex,\n eoMask,\n cpLex,\n coMask,\n poIdxU,\n poIdxL,\n moSupport,\n moMask,\n ]);\n}\n\n/** @category Binary 3x3x3 Format */\nexport function reid3x3x3ToTwizzleBinary(state: KState): Binary3x3x3State {\n const components: Binary3x3x3Components = reid3x3x3ToBinaryComponents(state);\n return binaryComponentsToTwizzleBinary(components);\n}\n\n/** @category Binary 3x3x3 Format */\nexport function twizzleBinaryToBinaryComponents(\n buffer: ArrayBuffer,\n): Binary3x3x3Components {\n const [epLex, eoMask, cpLex, coMask, poIdxU, poIdxL, moSupport, moMask] =\n splitBinary(BIT_LENGTHS, buffer);\n\n return {\n epLex,\n eoMask,\n cpLex,\n coMask,\n poIdxU,\n poIdxL,\n moSupport,\n moMask,\n };\n}\n\n/** @category Binary 3x3x3 Format */\nexport function binaryComponentsToReid3x3x3(\n components: Binary3x3x3Components,\n): KState {\n if (components.moSupport !== 1) {\n throw new Error(\"Must support center orientation.\");\n }\n\n const normedState = new KState(experimental3x3x3KPuzzle, {\n EDGES: {\n pieces: lexToPermutation(12, components.epLex),\n orientation: maskToOrientations(2, 12, components.eoMask),\n },\n CORNERS: {\n pieces: lexToPermutation(8, components.cpLex),\n orientation: maskToOrientations(3, 8, components.coMask),\n },\n CENTERS: {\n pieces: identityPermutation(6),\n orientation: maskToOrientations(4, 6, components.moMask),\n },\n });\n\n if (!supportsPuzzleOrientation(components)) {\n return normedState;\n }\n\n return reorientPuzzle(normedState, components.poIdxU, components.poIdxL);\n}\n\n// Returns a list of error string.\n// An empty list means validation success.\nfunction validateComponents(components: Binary3x3x3Components): string[] {\n const errors = [];\n if (components.epLex < 0 || components.epLex >= 479001600) {\n errors.push(`epLex (${components.epLex}) out of range`);\n }\n if (components.cpLex < 0 || components.cpLex >= 40320) {\n errors.push(`cpLex (${components.cpLex}) out of range`);\n }\n if (components.coMask < 0 || components.coMask >= 6561) {\n errors.push(`coMask (${components.coMask}) out of range`);\n }\n if (components.poIdxU < 0 || components.poIdxU >= 6) {\n // 0x111 (for idxU) means \"not supported\"\n if (supportsPuzzleOrientation(components)) {\n errors.push(`poIdxU (${components.poIdxU}) out of range`);\n }\n }\n // The following cannot be (f decoded from binary properl) out of rangey.\n if (components.eoMask < 0 || components.eoMask >= 4096) {\n errors.push(`eoMask (${components.eoMask}) out of range`);\n }\n if (components.moMask < 0 || components.moMask >= 4096) {\n errors.push(`moMask (${components.moMask}) out of range`);\n }\n if (components.poIdxL < 0 || components.poIdxL >= 4) {\n errors.push(`poIdxL (${components.poIdxL}) out of range`);\n }\n if (components.moSupport < 0 || components.moSupport >= 2) {\n errors.push(`moSupport (${components.moSupport}) out of range`);\n }\n return errors;\n}\n\n/** @category Binary 3x3x3 Format */\nexport function twizzleBinaryToReid3x3x3(buffy: ArrayBuffer): KState {\n const components = twizzleBinaryToBinaryComponents(buffy);\n const errors = validateComponents(components);\n if (errors.length !== 0) {\n throw new Error(`Invalid binary state components: ${errors.join(\", \")}`);\n }\n return binaryComponentsToReid3x3x3(components);\n}\n", "export function bufferToSpacedHex(buffer: ArrayBuffer): string {\n // buffer is an ArrayBuffer\n return (\n Array.prototype.map.call(new Uint8Array(buffer), (x: number) =>\n (\"00\" + x.toString(16)).slice(-2),\n ) as string[]\n ).join(\" \");\n}\n\nexport function spacedHexToBuffer(hex: string): Uint8Array {\n return new Uint8Array(hex.split(\" \").map((c) => parseInt(c, 16)));\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAAO,SAAS,oBAAoB,UAA4B;AAC9D,QAAM,MAAM,IAAI,MAAc,QAAQ;AACtC,WAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,QAAI,KAAK;AAAA,EACX;AACA,SAAO;AACT;AAGO,SAAS,mBACd,OACA,cACQ;AACR,MAAI,MAAM;AACV,aAAW,eAAe,cAAc;AACtC,WAAO;AACP,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAGO,SAAS,mBACd,OACA,UACA,MACU;AACV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