cubing 0.61.2 → 0.62.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 -1
- package/dist/bin/chunks/{chunk-BIRBVHTR.js → chunk-STSENBFQ.js} +2 -2
- package/dist/bin/order.js +1 -1
- package/dist/bin/order.js.map +1 -1
- package/dist/bin/puzzle-geometry-bin.js +1 -1
- package/dist/bin/puzzle-geometry-bin.js.map +1 -1
- package/dist/bin/scramble.js +1 -1
- package/dist/bin/scramble.js.map +1 -1
- package/dist/lib/cubing/{PuzzleLoader-CkghxdIL.d.ts → PuzzleLoader-B2JfN7uX.d.ts} +7 -7
- package/dist/lib/cubing/alg/index.d.ts +2 -2
- package/dist/lib/cubing/alg/index.js +1 -1
- package/dist/lib/cubing/bluetooth/index.d.ts +23 -4
- package/dist/lib/cubing/bluetooth/index.js +13 -10
- package/dist/lib/cubing/bluetooth/index.js.map +2 -2
- package/dist/lib/cubing/chunks/{big-puzzle-orientation-3GQ3L26S.js → big-puzzle-orientation-ZVZQJEF5.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-T3SF7NHB.js → chunk-2AUSVPAU.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-T3SF7NHB.js.map → chunk-2AUSVPAU.js.map} +2 -2
- package/dist/lib/cubing/chunks/{chunk-ZGT5MZSV.js → chunk-5F7JRCTP.js} +5 -5
- package/dist/lib/cubing/chunks/{chunk-FKKRSXUI.js → chunk-E3YLQC45.js} +2 -2
- package/dist/lib/cubing/chunks/chunk-E3YLQC45.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-MZKROP74.js → chunk-FLK6AZKB.js} +4 -4
- package/dist/lib/cubing/chunks/{chunk-MZKROP74.js.map → chunk-FLK6AZKB.js.map} +1 -1
- package/dist/lib/cubing/chunks/{chunk-QSGI7DXX.js → chunk-FUHYAW74.js} +4 -4
- package/dist/lib/cubing/chunks/{chunk-QSGI7DXX.js.map → chunk-FUHYAW74.js.map} +1 -1
- package/dist/lib/cubing/chunks/{chunk-IHFKNNCV.js → chunk-LIVDX4MD.js} +79 -35
- package/dist/lib/cubing/chunks/chunk-LIVDX4MD.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-3PS5LIPR.js → chunk-LWCBAAHO.js} +15 -9
- package/dist/lib/cubing/chunks/{chunk-3PS5LIPR.js.map → chunk-LWCBAAHO.js.map} +2 -2
- package/dist/lib/cubing/chunks/{chunk-WI337PMF.js → chunk-NGW52SHR.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-7D7ZUWUK.js → chunk-O6HEZXGY.js} +1 -1
- package/dist/lib/cubing/chunks/chunk-O6HEZXGY.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-WAYEJXCG.js → chunk-RINY3U6G.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-AVOUJS6N.js → chunk-ROB5TROI.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-ZKJKRQKY.js → chunk-XO3JAA3V.js} +1 -2
- package/dist/lib/cubing/chunks/chunk-XO3JAA3V.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-LCJT5ROJ.js → chunk-ZU7PSGX4.js} +3 -3
- package/dist/lib/cubing/chunks/chunk-ZU7PSGX4.js.map +7 -0
- package/dist/lib/cubing/chunks/{inside-UAY7NCJR.js → inside-TJAQBDDY.js} +16 -16
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-E5KVBK2Y.js → search-dynamic-sgs-side-events-GB4WAJ7I.js} +6 -6
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-IFHNOIEL.js → search-dynamic-sgs-unofficial-2CECFBP3.js} +6 -6
- package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-QVAXVZBA.js → search-dynamic-solve-4x4x4-NRWKTCNT.js} +8 -8
- package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-HZREG6ZH.js → search-dynamic-solve-fto-UZMNOI6U.js} +2 -2
- package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-GCNVEBDJ.js → search-dynamic-solve-kilominx-CD57C3C4.js} +2 -2
- package/dist/lib/cubing/chunks/search-worker-entry.js +5 -7
- package/dist/lib/cubing/chunks/search-worker-entry.js.map +2 -2
- package/dist/lib/cubing/chunks/{twips-UDB2NAAU.js → twips-YHXBF55O.js} +33 -33
- package/dist/lib/cubing/chunks/{twips-UDB2NAAU.js.map → twips-YHXBF55O.js.map} +3 -3
- package/dist/lib/cubing/chunks/twips_wasm_bg-RWVQBVBA-5YCKA6O5.js +10 -0
- package/dist/lib/cubing/chunks/twips_wasm_bg-RWVQBVBA-5YCKA6O5.js.map +7 -0
- package/dist/lib/cubing/chunks/{twisty-dynamic-3d-O6UL3R7C.js → twisty-dynamic-3d-IKE4BUQG.js} +9 -9
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-IKE4BUQG.js.map +7 -0
- package/dist/lib/cubing/events-BDkOaqlG.d.ts +35 -0
- package/dist/lib/cubing/{index-B_8W-2zR.d.ts → index-DWA95mSl.d.ts} +1 -1
- package/dist/lib/cubing/kpuzzle/index.d.ts +1 -1
- package/dist/lib/cubing/kpuzzle/index.js +2 -2
- package/dist/lib/cubing/notation/index.d.ts +1 -1
- package/dist/lib/cubing/notation/index.js +4 -4
- package/dist/lib/cubing/protocol/index.d.ts +1 -1
- package/dist/lib/cubing/protocol/index.js +4 -4
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +2 -2
- package/dist/lib/cubing/puzzle-geometry/index.js +1 -1
- package/dist/lib/cubing/puzzle-geometry/index.js.map +1 -1
- package/dist/lib/cubing/puzzles/index.d.ts +1 -1
- package/dist/lib/cubing/puzzles/index.js +4 -4
- package/dist/lib/cubing/scramble/index.d.ts +2 -2
- package/dist/lib/cubing/scramble/index.js +7 -7
- package/dist/lib/cubing/search/index.d.ts +3 -3
- package/dist/lib/cubing/search/index.js +7 -7
- package/dist/lib/cubing/stream/index.d.ts +4 -16
- package/dist/lib/cubing/stream/index.js +1 -1
- package/dist/lib/cubing/stream/index.js.map +2 -2
- package/dist/lib/cubing/twisty/index.d.ts +2 -2
- package/dist/lib/cubing/twisty/index.js +70 -62
- package/dist/lib/cubing/twisty/index.js.map +2 -2
- package/package.json +3 -3
- package/dist/lib/cubing/bluetooth-puzzle-c-_IBAdu.d.ts +0 -43
- package/dist/lib/cubing/chunks/chunk-7D7ZUWUK.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-FKKRSXUI.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-IHFKNNCV.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-LCJT5ROJ.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-ZKJKRQKY.js.map +0 -7
- package/dist/lib/cubing/chunks/twips_wasm_bg-TPXD7W4R-2BXON3G5.js +0 -10
- package/dist/lib/cubing/chunks/twips_wasm_bg-TPXD7W4R-2BXON3G5.js.map +0 -7
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-O6UL3R7C.js.map +0 -7
- /package/dist/bin/chunks/{chunk-BIRBVHTR.js.map → chunk-STSENBFQ.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{big-puzzle-orientation-3GQ3L26S.js.map → big-puzzle-orientation-ZVZQJEF5.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-ZGT5MZSV.js.map → chunk-5F7JRCTP.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-WI337PMF.js.map → chunk-NGW52SHR.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-WAYEJXCG.js.map → chunk-RINY3U6G.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-AVOUJS6N.js.map → chunk-ROB5TROI.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{inside-UAY7NCJR.js.map → inside-TJAQBDDY.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-E5KVBK2Y.js.map → search-dynamic-sgs-side-events-GB4WAJ7I.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-IFHNOIEL.js.map → search-dynamic-sgs-unofficial-2CECFBP3.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-QVAXVZBA.js.map → search-dynamic-solve-4x4x4-NRWKTCNT.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-HZREG6ZH.js.map → search-dynamic-solve-fto-UZMNOI6U.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-GCNVEBDJ.js.map → search-dynamic-solve-kilominx-CD57C3C4.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PuzzleID, s as PuzzleLoader, u as KPuzzle, p as PuzzleGeometry, E as ExperimentalStickering, v as StickeringMask, w as PuzzleSpecificSimplifyOptions, A as AlgLeaf, x as AlgTransformData } from '../PuzzleLoader-
|
|
1
|
+
import { t as PuzzleID, s as PuzzleLoader, u as KPuzzle, p as PuzzleGeometry, E as ExperimentalStickering, v as StickeringMask, w as PuzzleSpecificSimplifyOptions, A as AlgLeaf, x as AlgTransformData } from '../PuzzleLoader-B2JfN7uX.js';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
import 'three/src/Three.js';
|
|
4
4
|
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
twizzleEvents,
|
|
6
6
|
wcaEventInfo,
|
|
7
7
|
wcaEvents
|
|
8
|
-
} from "../chunks/chunk-
|
|
8
|
+
} from "../chunks/chunk-FLK6AZKB.js";
|
|
9
9
|
import {
|
|
10
10
|
cube3x3x3
|
|
11
|
-
} from "../chunks/chunk-
|
|
12
|
-
import "../chunks/chunk-
|
|
13
|
-
import "../chunks/chunk-
|
|
11
|
+
} from "../chunks/chunk-FUHYAW74.js";
|
|
12
|
+
import "../chunks/chunk-RINY3U6G.js";
|
|
13
|
+
import "../chunks/chunk-O6HEZXGY.js";
|
|
14
14
|
export {
|
|
15
15
|
cube2x2x2,
|
|
16
16
|
cube3x3x3,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../PuzzleLoader-
|
|
2
|
-
export { g as experimentalDeriveScrambleForEvent, r as randomScrambleForEvent } from '../index-
|
|
1
|
+
import '../PuzzleLoader-B2JfN7uX.js';
|
|
2
|
+
export { g as experimentalDeriveScrambleForEvent, r as randomScrambleForEvent } from '../index-DWA95mSl.js';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'three/src/Three.js';
|
|
@@ -2,14 +2,14 @@ import "../chunks/chunk-NAPITA3L.js";
|
|
|
2
2
|
import {
|
|
3
3
|
deriveScrambleForEvent,
|
|
4
4
|
randomScrambleForEvent
|
|
5
|
-
} from "../chunks/chunk-
|
|
6
|
-
import "../chunks/chunk-
|
|
5
|
+
} from "../chunks/chunk-LIVDX4MD.js";
|
|
6
|
+
import "../chunks/chunk-5F7JRCTP.js";
|
|
7
7
|
import "../chunks/chunk-7GUL3OBQ.js";
|
|
8
|
-
import "../chunks/chunk-
|
|
9
|
-
import "../chunks/chunk-
|
|
10
|
-
import "../chunks/chunk-
|
|
11
|
-
import "../chunks/chunk-
|
|
12
|
-
import "../chunks/chunk-
|
|
8
|
+
import "../chunks/chunk-XO3JAA3V.js";
|
|
9
|
+
import "../chunks/chunk-FLK6AZKB.js";
|
|
10
|
+
import "../chunks/chunk-FUHYAW74.js";
|
|
11
|
+
import "../chunks/chunk-RINY3U6G.js";
|
|
12
|
+
import "../chunks/chunk-O6HEZXGY.js";
|
|
13
13
|
export {
|
|
14
14
|
deriveScrambleForEvent as experimentalDeriveScrambleForEvent,
|
|
15
15
|
randomScrambleForEvent
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { K as KPattern } from '../PuzzleLoader-
|
|
2
|
-
import { s as solveTwips } from '../index-
|
|
3
|
-
export { e as experimentalSolve2x2x2, a as experimentalSolve3x3x3IgnoringCenters, b as setSearchDebug, c as solveMegaminx, d as solvePyraminx, f as solveSkewb } from '../index-
|
|
1
|
+
import { K as KPattern } from '../PuzzleLoader-B2JfN7uX.js';
|
|
2
|
+
import { s as solveTwips } from '../index-DWA95mSl.js';
|
|
3
|
+
export { e as experimentalSolve2x2x2, a as experimentalSolve3x3x3IgnoringCenters, b as setSearchDebug, c as solveMegaminx, d as solvePyraminx, f as solveSkewb } from '../index-DWA95mSl.js';
|
|
4
4
|
import 'type-fest';
|
|
5
5
|
import 'three/src/Three.js';
|
|
6
6
|
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
solvePyraminx,
|
|
7
7
|
solveSkewb,
|
|
8
8
|
solveTwips
|
|
9
|
-
} from "../chunks/chunk-
|
|
9
|
+
} from "../chunks/chunk-LIVDX4MD.js";
|
|
10
10
|
import {
|
|
11
11
|
random333Pattern
|
|
12
|
-
} from "../chunks/chunk-
|
|
12
|
+
} from "../chunks/chunk-5F7JRCTP.js";
|
|
13
13
|
import "../chunks/chunk-7GUL3OBQ.js";
|
|
14
|
-
import "../chunks/chunk-
|
|
15
|
-
import "../chunks/chunk-
|
|
16
|
-
import "../chunks/chunk-
|
|
17
|
-
import "../chunks/chunk-
|
|
18
|
-
import "../chunks/chunk-
|
|
14
|
+
import "../chunks/chunk-XO3JAA3V.js";
|
|
15
|
+
import "../chunks/chunk-FLK6AZKB.js";
|
|
16
|
+
import "../chunks/chunk-FUHYAW74.js";
|
|
17
|
+
import "../chunks/chunk-RINY3U6G.js";
|
|
18
|
+
import "../chunks/chunk-O6HEZXGY.js";
|
|
19
19
|
|
|
20
20
|
// src/cubing/search/index.ts
|
|
21
21
|
var experimentalSolveTwsearch = (...args) => {
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import '../
|
|
2
|
-
|
|
1
|
+
import { P as ProxyEvent, A as AlgLeafEvent, O as OrientationEvent } from '../events-BDkOaqlG.js';
|
|
2
|
+
export { a as ExperimentalProxyMoveEvent, b as ExperimentalProxyOrientationEvent, c as ExperimentalProxyResetEvent } from '../events-BDkOaqlG.js';
|
|
3
|
+
import '../PuzzleLoader-B2JfN7uX.js';
|
|
3
4
|
import 'type-fest';
|
|
4
5
|
import 'three/src/Three.js';
|
|
5
6
|
|
|
6
|
-
interface ProxyMoveEvent {
|
|
7
|
-
event: "move";
|
|
8
|
-
data: AlgLeafEvent;
|
|
9
|
-
}
|
|
10
|
-
interface ProxyOrientationEvent {
|
|
11
|
-
event: "orientation";
|
|
12
|
-
data: OrientationEvent;
|
|
13
|
-
}
|
|
14
|
-
interface ProxyResetEvent {
|
|
15
|
-
event: "reset";
|
|
16
|
-
}
|
|
17
|
-
type ProxyEvent = ProxyMoveEvent | ProxyOrientationEvent | ProxyResetEvent;
|
|
18
|
-
|
|
19
7
|
declare class TwizzleStream extends EventTarget {
|
|
20
8
|
socket: WebSocket;
|
|
21
9
|
constructor(url: string);
|
|
@@ -54,4 +42,4 @@ declare abstract class WebSocketProxyReceiver {
|
|
|
54
42
|
abstract onProxyEvent(e: ProxyEvent): void;
|
|
55
43
|
}
|
|
56
44
|
|
|
57
|
-
export {
|
|
45
|
+
export { AlgLeafEvent as ExperimentalAlgLeafEvent, OrientationEvent as ExperimentalOrientationEvent, ProxyEvent as ExperimentalProxyEvent, TwizzleStreamServer as ExperimentalTwizzleStreamServer, WebSocketProxyReceiver as ExperimentalWebSocketProxyReceiver, WebSocketProxySender as ExperimentalWebSocketProxySender };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cubing/stream/twizzle/TwizzleStream.ts", "../../../../src/cubing/stream/websocket-proxy.ts"],
|
|
4
|
-
"sourcesContent": ["import { Move, QuantumMove } from \"../../alg\";\nimport type { StreamMessageEvent } from \"./stream-types\";\n\nclass TwizzleStream extends EventTarget {\n socket: WebSocket;\n constructor(url: string) {\n super();\n this.socket = new WebSocket(url);\n this.socket.onmessage = this.onMessage.bind(this); // TODO: Can we \"add a listener instead\"?\n }\n\n onMessage(msg: MessageEvent): void {\n try {\n const json: StreamMessageEvent = JSON.parse(msg.data);\n if (json.event === \"move\") {\n const move = json.data.latestMove;\n if (move.type !== \"blockMove\") {\n throw new Error(\"Invalid move!\");\n }\n this.dispatchEvent(\n new CustomEvent(\"move\", {\n detail: {\n move: new Move(new QuantumMove(move.family), move.amount),\n },\n }),\n );\n }\n } catch (e) {\n console.error(\"Could not handle message:\", e);\n }\n }\n}\n\ntype StreamsField = {\n streamID: string;\n senders: { name: string; twizzleUserID: string; wcaID: string | null }[];\n}[];\n\nexport class TwizzleStreamServer {\n async streams(): Promise<StreamsField> {\n return (\n (await (await fetch(\"https://api.twizzle.net/v0/streams\")).json()) as {\n streams: StreamsField;\n }\n ).streams;\n }\n\n connect(streamID: string): TwizzleStream {\n return new TwizzleStream(\n `wss://api.twizzle.net/v0/streams/${streamID}/socket`,\n );\n }\n}\n", "import type {
|
|
5
|
-
"mappings": ";;;;;;AAGA,IAAM,gBAAN,cAA4B,YAAY;AAAA,EACtC;AAAA,EACA,YAAY,KAAa;AACvB,UAAM;AACN,SAAK,SAAS,IAAI,UAAU,GAAG;AAC/B,SAAK,OAAO,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAClD;AAAA,EAEA,UAAU,KAAyB;AACjC,QAAI;AACF,YAAM,OAA2B,KAAK,MAAM,IAAI,IAAI;AACpD,UAAI,KAAK,UAAU,QAAQ;AACzB,cAAM,OAAO,KAAK,KAAK;AACvB,YAAI,KAAK,SAAS,aAAa;AAC7B,gBAAM,IAAI,MAAM,eAAe;AAAA,QACjC;AACA,aAAK;AAAA,UACH,IAAI,YAAY,QAAQ;AAAA,YACtB,QAAQ;AAAA,cACN,MAAM,IAAI,KAAK,IAAI,YAAY,KAAK,MAAM,GAAG,KAAK,MAAM;AAAA,YAC1D;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,SAAS,GAAG;AACV,cAAQ,MAAM,6BAA6B,CAAC;AAAA,IAC9C;AAAA,EACF;AACF;AAOO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,MAAM,UAAiC;AACrC,YACG,OAAO,MAAM,MAAM,oCAAoC,GAAG,KAAK,GAGhE;AAAA,EACJ;AAAA,EAEA,QAAQ,UAAiC;AACvC,WAAO,IAAI;AAAA,MACT,oCAAoC,QAAQ;AAAA,IAC9C;AAAA,EACF;AACF;;;
|
|
4
|
+
"sourcesContent": ["import { Move, QuantumMove } from \"../../alg\";\nimport type { StreamMessageEvent } from \"./stream-types\";\n\nclass TwizzleStream extends EventTarget {\n socket: WebSocket;\n constructor(url: string) {\n super();\n this.socket = new WebSocket(url);\n this.socket.onmessage = this.onMessage.bind(this); // TODO: Can we \"add a listener instead\"?\n }\n\n onMessage(msg: MessageEvent): void {\n try {\n const json: StreamMessageEvent = JSON.parse(msg.data);\n if (json.event === \"move\") {\n const move = json.data.latestMove;\n if (move.type !== \"blockMove\") {\n throw new Error(\"Invalid move!\");\n }\n this.dispatchEvent(\n new CustomEvent(\"move\", {\n detail: {\n move: new Move(new QuantumMove(move.family), move.amount),\n },\n }),\n );\n }\n } catch (e) {\n console.error(\"Could not handle message:\", e);\n }\n }\n}\n\ntype StreamsField = {\n streamID: string;\n senders: { name: string; twizzleUserID: string; wcaID: string | null }[];\n}[];\n\nexport class TwizzleStreamServer {\n async streams(): Promise<StreamsField> {\n return (\n (await (await fetch(\"https://api.twizzle.net/v0/streams\")).json()) as {\n streams: StreamsField;\n }\n ).streams;\n }\n\n connect(streamID: string): TwizzleStream {\n return new TwizzleStream(\n `wss://api.twizzle.net/v0/streams/${streamID}/socket`,\n );\n }\n}\n", "import type { AlgLeafEvent, OrientationEvent, ProxyEvent } from \"./events\";\n\nexport class WebSocketProxySender {\n protected websocket: WebSocket;\n constructor(url: string) {\n this.websocket = new WebSocket(url);\n this.websocket.onopen = this.onopen.bind(this);\n this.websocket.onerror = this.onerror.bind(this);\n this.websocket.onmessage = this.onmessage.bind(this);\n }\n\n public sendMoveEvent(e: AlgLeafEvent): void {\n (e as any).latestAlgLeaf = e.latestAlgLeaf.toString(); // TODO\n this.sendProxyEvent({\n event: \"move\",\n data: e,\n });\n }\n\n public sendOrientationEvent(e: OrientationEvent): void {\n this.sendProxyEvent({\n event: \"orientation\",\n data: e,\n });\n }\n\n public sendResetEvent(): void {\n this.sendProxyEvent({ event: \"reset\" });\n }\n\n protected sendProxyEvent(proxyEvent: ProxyEvent): void {\n this.websocket.send(JSON.stringify(proxyEvent));\n }\n\n protected onopen(): void {\n console.log(\"Sending socket is open!\");\n }\n\n protected onerror(error: any): void {\n console.error(\"WebSocket sender error:\", error);\n }\n\n protected onmessage(_e: MessageEvent): void {}\n}\n\nexport abstract class WebSocketProxyReceiver {\n protected websocket?: WebSocket;\n constructor(url: string, socketOrigin?: string) {\n if (!socketOrigin) {\n console.log(\"No socket origin specified. Will not attempt to connect.\");\n return;\n }\n this.websocket = new WebSocket(url);\n console.log(this.websocket);\n this.websocket.onopen = this.onopen.bind(this);\n this.websocket.onerror = this.onerror.bind(this);\n this.websocket.onmessage = this.onmessage.bind(this);\n }\n\n protected onopen(): void {\n console.log(\"Receiving socket is open!\");\n }\n\n protected onerror(error: any): void {\n console.error(\"WebSocket receiver error:\", error);\n }\n\n protected onmessage(e: MessageEvent): void {\n this.onProxyEvent(JSON.parse(e.data));\n }\n\n abstract onProxyEvent(e: ProxyEvent): void;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;AAGA,IAAM,gBAAN,cAA4B,YAAY;AAAA,EACtC;AAAA,EACA,YAAY,KAAa;AACvB,UAAM;AACN,SAAK,SAAS,IAAI,UAAU,GAAG;AAC/B,SAAK,OAAO,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAClD;AAAA,EAEA,UAAU,KAAyB;AACjC,QAAI;AACF,YAAM,OAA2B,KAAK,MAAM,IAAI,IAAI;AACpD,UAAI,KAAK,UAAU,QAAQ;AACzB,cAAM,OAAO,KAAK,KAAK;AACvB,YAAI,KAAK,SAAS,aAAa;AAC7B,gBAAM,IAAI,MAAM,eAAe;AAAA,QACjC;AACA,aAAK;AAAA,UACH,IAAI,YAAY,QAAQ;AAAA,YACtB,QAAQ;AAAA,cACN,MAAM,IAAI,KAAK,IAAI,YAAY,KAAK,MAAM,GAAG,KAAK,MAAM;AAAA,YAC1D;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,SAAS,GAAG;AACV,cAAQ,MAAM,6BAA6B,CAAC;AAAA,IAC9C;AAAA,EACF;AACF;AAOO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,MAAM,UAAiC;AACrC,YACG,OAAO,MAAM,MAAM,oCAAoC,GAAG,KAAK,GAGhE;AAAA,EACJ;AAAA,EAEA,QAAQ,UAAiC;AACvC,WAAO,IAAI;AAAA,MACT,oCAAoC,QAAQ;AAAA,IAC9C;AAAA,EACF;AACF;;;AClDO,IAAM,uBAAN,MAA2B;AAAA,EACtB;AAAA,EACV,YAAY,KAAa;AACvB,SAAK,YAAY,IAAI,UAAU,GAAG;AAClC,SAAK,UAAU,SAAS,KAAK,OAAO,KAAK,IAAI;AAC7C,SAAK,UAAU,UAAU,KAAK,QAAQ,KAAK,IAAI;AAC/C,SAAK,UAAU,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EACrD;AAAA,EAEO,cAAc,GAAuB;AAC1C,IAAC,EAAU,gBAAgB,EAAE,cAAc,SAAS;AACpD,SAAK,eAAe;AAAA,MAClB,OAAO;AAAA,MACP,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAAA,EAEO,qBAAqB,GAA2B;AACrD,SAAK,eAAe;AAAA,MAClB,OAAO;AAAA,MACP,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAAA,EAEO,iBAAuB;AAC5B,SAAK,eAAe,EAAE,OAAO,QAAQ,CAAC;AAAA,EACxC;AAAA,EAEU,eAAe,YAA8B;AACrD,SAAK,UAAU,KAAK,KAAK,UAAU,UAAU,CAAC;AAAA,EAChD;AAAA,EAEU,SAAe;AACvB,YAAQ,IAAI,yBAAyB;AAAA,EACvC;AAAA,EAEU,QAAQ,OAAkB;AAClC,YAAQ,MAAM,2BAA2B,KAAK;AAAA,EAChD;AAAA,EAEU,UAAU,IAAwB;AAAA,EAAC;AAC/C;AAEO,IAAe,yBAAf,MAAsC;AAAA,EACjC;AAAA,EACV,YAAY,KAAa,cAAuB;AAC9C,QAAI,CAAC,cAAc;AACjB,cAAQ,IAAI,0DAA0D;AACtE;AAAA,IACF;AACA,SAAK,YAAY,IAAI,UAAU,GAAG;AAClC,YAAQ,IAAI,KAAK,SAAS;AAC1B,SAAK,UAAU,SAAS,KAAK,OAAO,KAAK,IAAI;AAC7C,SAAK,UAAU,UAAU,KAAK,QAAQ,KAAK,IAAI;AAC/C,SAAK,UAAU,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EACrD;AAAA,EAEU,SAAe;AACvB,YAAQ,IAAI,2BAA2B;AAAA,EACzC;AAAA,EAEU,QAAQ,OAAkB;AAClC,YAAQ,MAAM,6BAA6B,KAAK;AAAA,EAClD;AAAA,EAEU,UAAU,GAAuB;AACzC,SAAK,aAAa,KAAK,MAAM,EAAE,IAAI,CAAC;AAAA,EACtC;AAGF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { y as AlgIndexer, u as KPuzzle, r as Alg, M as Move, z as MillisecondTimestamp, B as LeafIndex, K as KPattern, C as KTransformation, D as MillisecondDuration, L as LeafCount, v as StickeringMask } from '../PuzzleLoader-
|
|
2
|
-
export { F as BackViewLayout, N as EXPERIMENTAL_PROP_NO_VALUE, E as ExperimentalStickering, t as PuzzleID, T as TwistyAlgEditor, H as TwistyAlgViewer, J as TwistyPlayer, I as TwistyPlayerConfig, O as TwizzleLink, V as VisualizationFormat, G as backViewLayouts } from '../PuzzleLoader-
|
|
1
|
+
import { y as AlgIndexer, u as KPuzzle, r as Alg, M as Move, z as MillisecondTimestamp, B as LeafIndex, K as KPattern, C as KTransformation, D as MillisecondDuration, L as LeafCount, v as StickeringMask } from '../PuzzleLoader-B2JfN7uX.js';
|
|
2
|
+
export { F as BackViewLayout, N as EXPERIMENTAL_PROP_NO_VALUE, E as ExperimentalStickering, t as PuzzleID, T as TwistyAlgEditor, H as TwistyAlgViewer, J as TwistyPlayer, I as TwistyPlayerConfig, O as TwizzleLink, V as VisualizationFormat, G as backViewLayouts } from '../PuzzleLoader-B2JfN7uX.js';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'three/src/Three.js';
|
|
5
5
|
|
|
@@ -18,22 +18,22 @@ import {
|
|
|
18
18
|
rawRenderPooled,
|
|
19
19
|
setCameraFromOrbitCoordinates,
|
|
20
20
|
setTwistyDebug
|
|
21
|
-
} from "../chunks/chunk-
|
|
21
|
+
} from "../chunks/chunk-LWCBAAHO.js";
|
|
22
22
|
import {
|
|
23
23
|
countAnimatedLeaves,
|
|
24
24
|
countLeavesInExpansionForSimultaneousMoveIndexer,
|
|
25
25
|
countMetricMoves
|
|
26
|
-
} from "../chunks/chunk-
|
|
26
|
+
} from "../chunks/chunk-ZU7PSGX4.js";
|
|
27
27
|
import {
|
|
28
28
|
puzzles
|
|
29
|
-
} from "../chunks/chunk-
|
|
29
|
+
} from "../chunks/chunk-FLK6AZKB.js";
|
|
30
30
|
import {
|
|
31
31
|
cube3x3x3,
|
|
32
32
|
customPGPuzzleLoader,
|
|
33
33
|
getPartialAppendOptionsForPuzzleSpecificSimplifyOptions,
|
|
34
34
|
getPieceStickeringMask
|
|
35
|
-
} from "../chunks/chunk-
|
|
36
|
-
import "../chunks/chunk-
|
|
35
|
+
} from "../chunks/chunk-FUHYAW74.js";
|
|
36
|
+
import "../chunks/chunk-RINY3U6G.js";
|
|
37
37
|
import {
|
|
38
38
|
Alg,
|
|
39
39
|
AlgBuilder,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
functionFromTraversal,
|
|
53
53
|
offsetMod,
|
|
54
54
|
startCharIndexKey
|
|
55
|
-
} from "../chunks/chunk-
|
|
55
|
+
} from "../chunks/chunk-O6HEZXGY.js";
|
|
56
56
|
|
|
57
57
|
// src/cubing/twisty/controllers/indexer/AlgDuration.ts
|
|
58
58
|
function defaultDurationForAmount(amount) {
|
|
@@ -1046,29 +1046,31 @@ var TwistyAnimationController = class {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
// TODO: bundle playing direction, and boundary into `toggle`.
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
if (
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1049
|
+
play(options) {
|
|
1050
|
+
void (async () => {
|
|
1051
|
+
const direction = options?.direction ?? 1 /* Forwards */;
|
|
1052
|
+
const coarseTimelineInfo = await this.model.coarseTimelineInfo.get();
|
|
1053
|
+
if (options?.autoSkipToOtherEndIfStartingAtBoundary ?? true) {
|
|
1054
|
+
if (direction === 1 /* Forwards */ && coarseTimelineInfo.atEnd) {
|
|
1055
|
+
this.model.timestampRequest.set("start");
|
|
1056
|
+
this.delegate.flash();
|
|
1057
|
+
}
|
|
1058
|
+
if (direction === -1 /* Backwards */ && coarseTimelineInfo.atStart) {
|
|
1059
|
+
this.model.timestampRequest.set("end");
|
|
1060
|
+
this.delegate.flash();
|
|
1061
|
+
}
|
|
1060
1062
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1063
|
+
this.model.playingInfo.set({
|
|
1064
|
+
playing: true,
|
|
1065
|
+
direction,
|
|
1066
|
+
untilBoundary: options?.untilBoundary ?? "entire-timeline" /* EntireTimeline */,
|
|
1067
|
+
loop: options?.loop ?? false
|
|
1068
|
+
});
|
|
1069
|
+
this.playing = true;
|
|
1070
|
+
this.lastDatestamp = performance.now();
|
|
1071
|
+
this.lastTimestampPromise = this.#effectiveTimestampMilliseconds();
|
|
1072
|
+
this.scheduler.requestAnimFrame();
|
|
1073
|
+
})();
|
|
1072
1074
|
}
|
|
1073
1075
|
pause() {
|
|
1074
1076
|
this.playing = false;
|
|
@@ -1396,7 +1398,7 @@ var Twisty2DPuzzleWrapper = class {
|
|
|
1396
1398
|
this.schedulable = schedulable;
|
|
1397
1399
|
this.puzzleLoader = puzzleLoader;
|
|
1398
1400
|
this.effectiveVisualization = effectiveVisualization;
|
|
1399
|
-
this.twisty2DPuzzle();
|
|
1401
|
+
void this.twisty2DPuzzle();
|
|
1400
1402
|
this.#freshListenerManager.addListener(
|
|
1401
1403
|
this.model.twistySceneModel.stickeringMask,
|
|
1402
1404
|
async (stickeringMask) => {
|
|
@@ -1477,22 +1479,24 @@ var Twisty2DSceneWrapper = class extends ManagedCustomElement {
|
|
|
1477
1479
|
puzzleLoader,
|
|
1478
1480
|
this.effectiveVisualization
|
|
1479
1481
|
);
|
|
1480
|
-
this.setCurrentTwisty2DPuzzleWrapper(twisty2DPuzzleWrapper);
|
|
1482
|
+
void this.setCurrentTwisty2DPuzzleWrapper(twisty2DPuzzleWrapper);
|
|
1481
1483
|
}
|
|
1482
1484
|
};
|
|
1483
1485
|
customElementsShim.define("twisty-2d-scene-wrapper", Twisty2DSceneWrapper);
|
|
1484
1486
|
|
|
1485
1487
|
// src/cubing/twisty/views/InitialValueTracker.ts
|
|
1486
1488
|
var InitialValueTracker = class {
|
|
1489
|
+
// @ts-expect-error: We do initialize this synchronously (assuming no one has tampered with the `Promise` constructor).
|
|
1487
1490
|
#resolve;
|
|
1491
|
+
// @ts-expect-error: We do initialize this synchronously (assuming no one has tampered with the `Promise` constructor).
|
|
1488
1492
|
reject;
|
|
1489
1493
|
// TODO: AbortController?
|
|
1490
1494
|
promise;
|
|
1491
1495
|
constructor() {
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
+
this.promise = new Promise((resolve, reject) => {
|
|
1497
|
+
this.#resolve = resolve;
|
|
1498
|
+
this.reject = reject;
|
|
1499
|
+
});
|
|
1496
1500
|
}
|
|
1497
1501
|
handleNewValue(t) {
|
|
1498
1502
|
this.#resolve(t);
|
|
@@ -1507,7 +1511,7 @@ var Twisty3DPuzzleWrapper = class extends EventTarget {
|
|
|
1507
1511
|
this.schedulable = schedulable;
|
|
1508
1512
|
this.puzzleLoader = puzzleLoader;
|
|
1509
1513
|
this.visualizationStrategy = visualizationStrategy;
|
|
1510
|
-
this.twisty3DPuzzle();
|
|
1514
|
+
void this.twisty3DPuzzle();
|
|
1511
1515
|
this.#freshListenerManager.addListener(
|
|
1512
1516
|
this.model.puzzleLoader,
|
|
1513
1517
|
(puzzleLoader2) => {
|
|
@@ -1809,7 +1813,7 @@ var Twisty3DSceneWrapper = class extends ManagedCustomElement {
|
|
|
1809
1813
|
// TODO
|
|
1810
1814
|
])
|
|
1811
1815
|
);
|
|
1812
|
-
this.setCurrentTwisty3DPuzzleWrapper(scene, twisty3DPuzzleWrapper);
|
|
1816
|
+
void this.setCurrentTwisty3DPuzzleWrapper(scene, twisty3DPuzzleWrapper);
|
|
1813
1817
|
}
|
|
1814
1818
|
};
|
|
1815
1819
|
customElementsShim.define("twisty-3d-scene-wrapper", Twisty3DSceneWrapper);
|
|
@@ -2078,7 +2082,7 @@ var TwistyButtons = class extends ManagedCustomElement {
|
|
|
2078
2082
|
#onCommand(command) {
|
|
2079
2083
|
switch (command) {
|
|
2080
2084
|
case "fullscreen": {
|
|
2081
|
-
this.onFullscreenButton();
|
|
2085
|
+
void this.onFullscreenButton();
|
|
2082
2086
|
break;
|
|
2083
2087
|
}
|
|
2084
2088
|
case "jump-to-start": {
|
|
@@ -2108,7 +2112,7 @@ var TwistyButtons = class extends ManagedCustomElement {
|
|
|
2108
2112
|
break;
|
|
2109
2113
|
}
|
|
2110
2114
|
case "twizzle-link": {
|
|
2111
|
-
this.controller?.visitTwizzleLink();
|
|
2115
|
+
void this.controller?.visitTwizzleLink();
|
|
2112
2116
|
break;
|
|
2113
2117
|
}
|
|
2114
2118
|
default:
|
|
@@ -2122,10 +2126,10 @@ var TwistyButtons = class extends ManagedCustomElement {
|
|
|
2122
2126
|
throw new Error("Attempted to go fullscreen without an element.");
|
|
2123
2127
|
}
|
|
2124
2128
|
if (documentFullscreenElement() === this.defaultFullscreenElement) {
|
|
2125
|
-
documentExitFullscreen();
|
|
2129
|
+
void documentExitFullscreen();
|
|
2126
2130
|
} else {
|
|
2127
2131
|
this.buttons?.fullscreen.setIcon("exit-fullscreen");
|
|
2128
|
-
requestFullscreen(
|
|
2132
|
+
void requestFullscreen(
|
|
2129
2133
|
await this.model?.twistySceneModel.fullscreenElement.get() ?? this.defaultFullscreenElement
|
|
2130
2134
|
);
|
|
2131
2135
|
const onFullscreen = () => {
|
|
@@ -4350,7 +4354,7 @@ var TwistyPlayer = class extends TwistyPlayerSettable {
|
|
|
4350
4354
|
// TODO: Better pattern.
|
|
4351
4355
|
#alreadyConnected = false;
|
|
4352
4356
|
// TODO: support resetting
|
|
4353
|
-
|
|
4357
|
+
connectedCallback() {
|
|
4354
4358
|
this.addCSS(twistyPlayerCSS);
|
|
4355
4359
|
waitForIntersection(this);
|
|
4356
4360
|
}
|
|
@@ -5080,7 +5084,7 @@ var TwistyAlgEditor = class extends ManagedCustomElement {
|
|
|
5080
5084
|
if (!twistyPlayer) {
|
|
5081
5085
|
return;
|
|
5082
5086
|
}
|
|
5083
|
-
(async () => {
|
|
5087
|
+
void (async () => {
|
|
5084
5088
|
this.algString = this.#algProp ? (await this.#algProp.get()).alg.toString() : "";
|
|
5085
5089
|
})();
|
|
5086
5090
|
if (this.#twistyPlayerProp === "alg") {
|
|
@@ -5196,24 +5200,28 @@ customElementsShim.define("twisty-alg-editor", TwistyAlgEditor);
|
|
|
5196
5200
|
|
|
5197
5201
|
// src/cubing/twisty/views/firstElementWithId.ts
|
|
5198
5202
|
async function firstElementWithId(id) {
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
const observer = new MutationObserver((mutations) => {
|
|
5205
|
-
for (const mutation of mutations) {
|
|
5206
|
-
if (mutation.attributeName === "id" && mutation.target instanceof Element && mutation.target.getAttribute("id") === id) {
|
|
5207
|
-
resolve(mutation.target);
|
|
5208
|
-
observer.disconnect();
|
|
5203
|
+
return new Promise((resolve, reject) => {
|
|
5204
|
+
try {
|
|
5205
|
+
const currentElem = document.getElementById(id);
|
|
5206
|
+
if (currentElem) {
|
|
5207
|
+
resolve(currentElem);
|
|
5209
5208
|
}
|
|
5209
|
+
const observer = new MutationObserver((mutations) => {
|
|
5210
|
+
for (const mutation of mutations) {
|
|
5211
|
+
if (mutation.attributeName === "id" && mutation.target instanceof Element && mutation.target.getAttribute("id") === id) {
|
|
5212
|
+
resolve(mutation.target);
|
|
5213
|
+
observer.disconnect();
|
|
5214
|
+
}
|
|
5215
|
+
}
|
|
5216
|
+
});
|
|
5217
|
+
observer.observe(document.body, {
|
|
5218
|
+
attributeFilter: ["id"],
|
|
5219
|
+
subtree: true
|
|
5220
|
+
});
|
|
5221
|
+
} catch (e) {
|
|
5222
|
+
reject(e);
|
|
5210
5223
|
}
|
|
5211
5224
|
});
|
|
5212
|
-
observer.observe(document.body, {
|
|
5213
|
-
attributeFilter: ["id"],
|
|
5214
|
-
subtree: true
|
|
5215
|
-
});
|
|
5216
|
-
return promise;
|
|
5217
5225
|
}
|
|
5218
5226
|
|
|
5219
5227
|
// src/cubing/twisty/views/TwistyAlgViewer.css.ts
|
|
@@ -5264,7 +5272,7 @@ var TwistyAlgLeafElem = class extends ManagedCustomElement {
|
|
|
5264
5272
|
anchor.textContent = text;
|
|
5265
5273
|
anchor.addEventListener("click", (e) => {
|
|
5266
5274
|
e.preventDefault();
|
|
5267
|
-
dataDown.twistyAlgViewer.jumpToIndex(
|
|
5275
|
+
void dataDown.twistyAlgViewer.jumpToIndex(
|
|
5268
5276
|
dataDown.earliestMoveIndex,
|
|
5269
5277
|
offsetIntoMove
|
|
5270
5278
|
);
|
|
@@ -5571,7 +5579,7 @@ var TwistyAlgViewer = class extends HTMLElementShim {
|
|
|
5571
5579
|
return this.#twistyPlayer;
|
|
5572
5580
|
}
|
|
5573
5581
|
set twistyPlayer(twistyPlayer) {
|
|
5574
|
-
this.#setTwistyPlayer(twistyPlayer);
|
|
5582
|
+
void this.#setTwistyPlayer(twistyPlayer);
|
|
5575
5583
|
}
|
|
5576
5584
|
async #setTwistyPlayer(twistyPlayer) {
|
|
5577
5585
|
if (this.#twistyPlayer) {
|
|
@@ -6007,13 +6015,13 @@ var TwizzleLink = class extends ManagedCustomElement {
|
|
|
6007
6015
|
if (textToCopy) {
|
|
6008
6016
|
try {
|
|
6009
6017
|
await navigator.clipboard.writeText(textToCopy);
|
|
6010
|
-
setAndClear("\u{1F4CB}\u2705");
|
|
6018
|
+
void setAndClear("\u{1F4CB}\u2705");
|
|
6011
6019
|
} catch (e2) {
|
|
6012
|
-
setAndClear("\u{1F4CB}\u274C");
|
|
6020
|
+
void setAndClear("\u{1F4CB}\u274C");
|
|
6013
6021
|
throw e2;
|
|
6014
6022
|
}
|
|
6015
6023
|
} else {
|
|
6016
|
-
setAndClear("\u{1F4CB}\u274C");
|
|
6024
|
+
void setAndClear("\u{1F4CB}\u274C");
|
|
6017
6025
|
}
|
|
6018
6026
|
});
|
|
6019
6027
|
}
|