cubing 0.55.1 → 0.56.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.
Files changed (69) hide show
  1. package/dist/bin/scramble.js +1 -0
  2. package/dist/bin/scramble.js.map +2 -2
  3. package/dist/lib/cubing/{KPattern-BXlfgC6b.d.ts → PuzzleLoader-DWqO9l1G.d.ts} +44 -43
  4. package/dist/lib/cubing/alg/index.d.ts +3 -3
  5. package/dist/lib/cubing/bluetooth/index.d.ts +7 -7
  6. package/dist/lib/cubing/bluetooth/index.js +7 -6
  7. package/dist/lib/cubing/bluetooth/index.js.map +2 -2
  8. package/dist/lib/cubing/{bluetooth-puzzle-CkZw4jC6.d.ts → bluetooth-puzzle-C6TIIh-Z.d.ts} +1 -1
  9. package/dist/lib/cubing/chunks/{chunk-Y5U55NHQ.js → chunk-KO64SKMG.js} +3 -3
  10. package/dist/lib/cubing/chunks/{chunk-WELOEBCE.js → chunk-M4T7GO54.js} +77 -83
  11. package/dist/lib/cubing/chunks/chunk-M4T7GO54.js.map +7 -0
  12. package/dist/lib/cubing/chunks/{chunk-PJH5IVDC.js → chunk-MA47PABE.js} +2 -2
  13. package/dist/lib/cubing/chunks/{chunk-MFK4M6PV.js → chunk-WOAANT6Y.js} +23 -14
  14. package/dist/lib/cubing/chunks/chunk-WOAANT6Y.js.map +7 -0
  15. package/dist/lib/cubing/chunks/{chunk-55STZK6V.js → chunk-XKTLEY2R.js} +2 -2
  16. package/dist/lib/cubing/chunks/chunk-XKTLEY2R.js.map +7 -0
  17. package/dist/lib/cubing/chunks/{chunk-JS5PDZ4D.js → chunk-XPH22PGR.js} +1 -1
  18. package/dist/lib/cubing/chunks/{chunk-2QDTMC3W.js → chunk-YFGRXDD4.js} +2 -2
  19. package/dist/lib/cubing/chunks/{chunk-SGPKF5IH.js → chunk-YQVHA4F6.js} +1 -1
  20. package/dist/lib/cubing/chunks/{inside-KP7ZR25G.js → inside-KAVAZETT.js} +10 -10
  21. package/dist/lib/cubing/chunks/{puzzles-dynamic-side-events-QIADTLKJ.js → puzzles-dynamic-side-events-AHFPWEBD.js} +24 -143
  22. package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-AHFPWEBD.js.map +7 -0
  23. package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-EGIM6IYZ.js → search-dynamic-sgs-side-events-FTWMZ5ZJ.js} +3 -3
  24. package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-R2TXOWXD.js → search-dynamic-sgs-unofficial-ZYGVRJQK.js} +3 -3
  25. package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-JXJRJXQ6.js → search-dynamic-solve-4x4x4-6MKLH6KJ.js} +5 -5
  26. package/dist/lib/cubing/chunks/search-worker-entry.js +1 -1
  27. package/dist/lib/cubing/chunks/{twisty-dynamic-3d-H7YMZQPB.js → twisty-dynamic-3d-QGRCHB6L.js} +47 -40
  28. package/dist/lib/cubing/chunks/twisty-dynamic-3d-QGRCHB6L.js.map +7 -0
  29. package/dist/lib/cubing/chunks/{twsearch-HWA5BU3S.js → twsearch-ITWEA5PO.js} +4 -4
  30. package/dist/lib/cubing/chunks/twsearch-ITWEA5PO.js.map +7 -0
  31. package/dist/lib/cubing/chunks/twsearch_wasm_bg-NHUYB5UW-HHHVHFI5.js +10 -0
  32. package/dist/lib/cubing/chunks/twsearch_wasm_bg-NHUYB5UW-HHHVHFI5.js.map +7 -0
  33. package/dist/lib/cubing/{index-BaPEgEPZ.d.ts → index-g0IQg962.d.ts} +1 -1
  34. package/dist/lib/cubing/kpuzzle/index.d.ts +2 -2
  35. package/dist/lib/cubing/notation/index.d.ts +2 -2
  36. package/dist/lib/cubing/notation/index.js +2 -2
  37. package/dist/lib/cubing/protocol/index.d.ts +2 -2
  38. package/dist/lib/cubing/protocol/index.js +2 -2
  39. package/dist/lib/cubing/puzzle-geometry/index.d.ts +3 -3
  40. package/dist/lib/cubing/puzzle-geometry/index.js +167 -52
  41. package/dist/lib/cubing/puzzle-geometry/index.js.map +2 -2
  42. package/dist/lib/cubing/puzzles/index.d.ts +2 -2
  43. package/dist/lib/cubing/puzzles/index.js +2 -2
  44. package/dist/lib/cubing/scramble/index.d.ts +3 -3
  45. package/dist/lib/cubing/scramble/index.js +4 -4
  46. package/dist/lib/cubing/search/index.d.ts +3 -3
  47. package/dist/lib/cubing/search/index.js +4 -4
  48. package/dist/lib/cubing/stream/index.d.ts +3 -3
  49. package/dist/lib/cubing/twisty/index.d.ts +3 -3
  50. package/dist/lib/cubing/twisty/index.js +23 -18
  51. package/dist/lib/cubing/twisty/index.js.map +3 -3
  52. package/package.json +5 -5
  53. package/dist/lib/cubing/chunks/chunk-55STZK6V.js.map +0 -7
  54. package/dist/lib/cubing/chunks/chunk-MFK4M6PV.js.map +0 -7
  55. package/dist/lib/cubing/chunks/chunk-WELOEBCE.js.map +0 -7
  56. package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-QIADTLKJ.js.map +0 -7
  57. package/dist/lib/cubing/chunks/twisty-dynamic-3d-H7YMZQPB.js.map +0 -7
  58. package/dist/lib/cubing/chunks/twsearch-HWA5BU3S.js.map +0 -7
  59. package/dist/lib/cubing/chunks/twsearch_wasm_bg-BI4JVWGR-OGWODKOA.js +0 -10
  60. package/dist/lib/cubing/chunks/twsearch_wasm_bg-BI4JVWGR-OGWODKOA.js.map +0 -7
  61. /package/dist/lib/cubing/chunks/{chunk-Y5U55NHQ.js.map → chunk-KO64SKMG.js.map} +0 -0
  62. /package/dist/lib/cubing/chunks/{chunk-PJH5IVDC.js.map → chunk-MA47PABE.js.map} +0 -0
  63. /package/dist/lib/cubing/chunks/{chunk-JS5PDZ4D.js.map → chunk-XPH22PGR.js.map} +0 -0
  64. /package/dist/lib/cubing/chunks/{chunk-2QDTMC3W.js.map → chunk-YFGRXDD4.js.map} +0 -0
  65. /package/dist/lib/cubing/chunks/{chunk-SGPKF5IH.js.map → chunk-YQVHA4F6.js.map} +0 -0
  66. /package/dist/lib/cubing/chunks/{inside-KP7ZR25G.js.map → inside-KAVAZETT.js.map} +0 -0
  67. /package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-EGIM6IYZ.js.map → search-dynamic-sgs-side-events-FTWMZ5ZJ.js.map} +0 -0
  68. /package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-R2TXOWXD.js.map → search-dynamic-sgs-unofficial-ZYGVRJQK.js.map} +0 -0
  69. /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-JXJRJXQ6.js.map → search-dynamic-solve-4x4x4-6MKLH6KJ.js.map} +0 -0
@@ -153,6 +153,7 @@ ${scrambleText(scramble)}
153
153
  }
154
154
  jsonListPrinter?.finish();
155
155
  }
156
+ (await import("node:process")).exit(0);
156
157
  }
157
158
  });
158
159
  await run(binary(app), process.argv);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/bin/scramble.ts"],
4
- "sourcesContent": ["// To run this file directly:\n// bun run src/bin/scramble.ts -- 333\n\n// TODO: completions for `bash`, `zsh`, and `fish`: https://github.com/loilo/completarr\n\n// Important! We import this instead of inlining, because `esbuild` preserves import order semantics but hoists imports above any code inlined here.\n\nimport type { Alg } from \"cubing/alg\";\nimport { eventInfo } from \"cubing/puzzles\";\nimport { randomScrambleForEvent } from \"cubing/scramble\";\nimport { setSearchDebug } from \"cubing/search\";\nimport \"./guards/cmd-ts-too-guard\";\n\nconst {\n binary,\n number: cmdNumber,\n string: cmdString,\n command,\n flag,\n oneOf,\n option,\n optional,\n positional,\n run,\n} = await import(\"cmd-ts-too\");\n\n// TODO: file an issue about printing these values.\nconst outputFormats = [\"text\", \"link\", \"json-text\"] as const;\nconst notationTypes = [\"auto\", \"LGN\"] as const;\n\nconst app = command({\n name: \"scramble\",\n args: {\n amount: option({\n description: \"Amount of scrambles\",\n type: cmdNumber,\n long: \"amount\",\n short: \"n\",\n defaultValue: () => 1,\n defaultValueIsSerializable: true,\n }),\n format: option({\n description: `Output format. One of: ${outputFormats.join(\", \")}`,\n type: optional(oneOf(outputFormats)),\n long: \"format\",\n short: \"f\",\n }),\n notation: option({\n description: `Notation type. One of: ${notationTypes.join(\", \")}`,\n type: optional(oneOf([\"auto\", \"LGN\"])),\n long: \"notation\",\n }),\n text: flag({\n description: \"Convenient shorthand for `--format text`.\",\n long: \"t\", // TODO: https://github.com/lgarron/cmd-ts-too/issues/6\n short: \"t\",\n }),\n eventID: positional({\n type: cmdString,\n displayName: \"WCA or unofficial event ID\",\n }),\n },\n handler: async ({ amount, format: argsFormat, notation, text, eventID }) => {\n const format =\n argsFormat ?? (text || !process.stdout.isTTY ? \"text\" : \"auto\");\n\n setSearchDebug({ logPerf: false, showWorkerInstantiationWarnings: false });\n\n function scrambleText(scramble: Alg): string {\n return scramble.toString({\n // TODO: any\n notation: notation as (typeof notationTypes)[number], // TODO: handle type conversion at arg parse time.\n });\n }\n\n function scrambleLink(scramble: Alg): string {\n const url = new URL(\"https://alpha.twizzle.net/edit/\");\n const puzzleID = eventInfo(eventID)?.puzzleID;\n puzzleID && url.searchParams.set(\"puzzle\", puzzleID);\n url.searchParams.set(\"alg\", scrambleText(scramble));\n return url.toString();\n }\n\n class JSONListPrinter<T> {\n #finished = false;\n #firstValuePrintedAlready = false;\n constructor() {\n process.stdout.write(\"[\\n \");\n }\n\n push(value: T) {\n if (this.#firstValuePrintedAlready) {\n process.stdout.write(\",\\n \");\n }\n this.#firstValuePrintedAlready = true;\n process.stdout.write(JSON.stringify(value));\n }\n\n finish() {\n if (this.#finished) {\n throw new Error(\"Tried to finish JSON list printing multiple times.\");\n }\n this.#finished = true;\n console.log(\"\\n]\");\n }\n }\n\n if (format !== \"json-text\" && amount === 1) {\n const scramble = await randomScrambleForEvent(eventID);\n\n switch (format) {\n case \"text\": {\n console.log(scrambleText(scramble));\n break;\n }\n case \"link\": {\n console.log(scrambleLink(scramble));\n break;\n }\n // @ts-ignore This is a code guard for future refactoring.\n case \"json-text\": {\n throw new Error(\n \"Encountered `json` format in code that is not expected to handle it.\",\n );\n }\n case \"auto\": {\n console.log(`${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}`);\n break;\n }\n default: {\n throw new Error(\"Unknown format!\");\n }\n }\n } else {\n const jsonListPrinter: JSONListPrinter<string> | undefined =\n format === \"json-text\" ? new JSONListPrinter() : undefined;\n for (let i = 0; i < amount; i++) {\n // @ts-ignore: Top-level await is okay because this is not part of the main library.\n const scramble = await randomScrambleForEvent(eventID);\n switch (format) {\n case \"text\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleText(scramble)}\\n`);\n break;\n }\n case \"link\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleLink(scramble)}\\n`);\n break;\n }\n case \"json-text\": {\n jsonListPrinter?.push(scramble.toString());\n break;\n }\n case \"auto\": {\n console.log(`// Scramble #${i + 1}\n${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}\n`);\n break;\n }\n default: {\n throw new Error(\"Unknown format!\");\n }\n }\n }\n jsonListPrinter?.finish();\n }\n },\n});\n\nawait run(binary(app), process.argv);\n"],
5
- "mappings": ";;;;AAQA,SAAS,iBAAiB;AAC1B,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAG/B,IAAM;AAAA,EACJ;AAAA,EACA,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAI,MAAM,OAAO,YAAY;AAG7B,IAAM,gBAAgB,CAAC,QAAQ,QAAQ,WAAW;AAClD,IAAM,gBAAgB,CAAC,QAAQ,KAAK;AAEpC,IAAM,MAAM,QAAQ;AAAA,EAClB,MAAM;AAAA,EACN,MAAM;AAAA,IACJ,QAAQ,OAAO;AAAA,MACb,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,cAAc,MAAM;AAAA,MACpB,4BAA4B;A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,IAAI,GAAG,aAAa,QAAQ,CAAC;AAAA,CAAI;AACzC;AAAA,UACF;AAAA,UACA,KAAK,aAAa;AAChB,6BAAiB,KAAK,SAAS,SAAS,CAAC;AACzC;AAAA,UACF;AAAA,UACA,KAAK,QAAQ;AACX,oBAAQ,IAAI,gBAAgB,IAAI,CAAC;AAAA,EAC3C,aAAa,QAAQ,CAAC;AAAA;AAAA,YAEnB,aAAa,QAAQ,CAAC;AAAA,CAC1B;AACW;AAAA,UACF;AAAA,UACA,SAAS;AACP,kBAAM,IAAI,MAAM,iBAAiB;AAAA,UACnC;AAAA,QACF;AAAA,MACF;AACA,uBAAiB,OAAO;AAAA,IAC1B;AAAA,EACF;AACF,CAAC;AAED,MAAM,IAAI,OAAO,GAAG,GAAG,QAAQ,IAAI;",
4
+ "sourcesContent": ["// To run this file directly:\n// bun run src/bin/scramble.ts -- 333\n\n// TODO: completions for `bash`, `zsh`, and `fish`: https://github.com/loilo/completarr\n\n// Important! We import this instead of inlining, because `esbuild` preserves import order semantics but hoists imports above any code inlined here.\n\nimport type { Alg } from \"cubing/alg\";\nimport { eventInfo } from \"cubing/puzzles\";\nimport { randomScrambleForEvent } from \"cubing/scramble\";\nimport { setSearchDebug } from \"cubing/search\";\nimport \"./guards/cmd-ts-too-guard\";\n\nconst {\n binary,\n number: cmdNumber,\n string: cmdString,\n command,\n flag,\n oneOf,\n option,\n optional,\n positional,\n run,\n} = await import(\"cmd-ts-too\");\n\n// TODO: file an issue about printing these values.\nconst outputFormats = [\"text\", \"link\", \"json-text\"] as const;\nconst notationTypes = [\"auto\", \"LGN\"] as const;\n\nconst app = command({\n name: \"scramble\",\n args: {\n amount: option({\n description: \"Amount of scrambles\",\n type: cmdNumber,\n long: \"amount\",\n short: \"n\",\n defaultValue: () => 1,\n defaultValueIsSerializable: true,\n }),\n format: option({\n description: `Output format. One of: ${outputFormats.join(\", \")}`,\n type: optional(oneOf(outputFormats)),\n long: \"format\",\n short: \"f\",\n }),\n notation: option({\n description: `Notation type. One of: ${notationTypes.join(\", \")}`,\n type: optional(oneOf([\"auto\", \"LGN\"])),\n long: \"notation\",\n }),\n text: flag({\n description: \"Convenient shorthand for `--format text`.\",\n long: \"t\", // TODO: https://github.com/lgarron/cmd-ts-too/issues/6\n short: \"t\",\n }),\n eventID: positional({\n type: cmdString,\n displayName: \"WCA or unofficial event ID\",\n }),\n },\n handler: async ({ amount, format: argsFormat, notation, text, eventID }) => {\n const format =\n argsFormat ?? (text || !process.stdout.isTTY ? \"text\" : \"auto\");\n\n setSearchDebug({ logPerf: false, showWorkerInstantiationWarnings: false });\n\n function scrambleText(scramble: Alg): string {\n return scramble.toString({\n // TODO: any\n notation: notation as (typeof notationTypes)[number], // TODO: handle type conversion at arg parse time.\n });\n }\n\n function scrambleLink(scramble: Alg): string {\n const url = new URL(\"https://alpha.twizzle.net/edit/\");\n const puzzleID = eventInfo(eventID)?.puzzleID;\n puzzleID && url.searchParams.set(\"puzzle\", puzzleID);\n url.searchParams.set(\"alg\", scrambleText(scramble));\n return url.toString();\n }\n\n class JSONListPrinter<T> {\n #finished = false;\n #firstValuePrintedAlready = false;\n constructor() {\n process.stdout.write(\"[\\n \");\n }\n\n push(value: T) {\n if (this.#firstValuePrintedAlready) {\n process.stdout.write(\",\\n \");\n }\n this.#firstValuePrintedAlready = true;\n process.stdout.write(JSON.stringify(value));\n }\n\n finish() {\n if (this.#finished) {\n throw new Error(\"Tried to finish JSON list printing multiple times.\");\n }\n this.#finished = true;\n console.log(\"\\n]\");\n }\n }\n\n if (format !== \"json-text\" && amount === 1) {\n const scramble = await randomScrambleForEvent(eventID);\n\n switch (format) {\n case \"text\": {\n console.log(scrambleText(scramble));\n break;\n }\n case \"link\": {\n console.log(scrambleLink(scramble));\n break;\n }\n // @ts-ignore This is a code guard for future refactoring.\n case \"json-text\": {\n throw new Error(\n \"Encountered `json` format in code that is not expected to handle it.\",\n );\n }\n case \"auto\": {\n console.log(`${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}`);\n break;\n }\n default: {\n throw new Error(\"Unknown format!\");\n }\n }\n } else {\n const jsonListPrinter: JSONListPrinter<string> | undefined =\n format === \"json-text\" ? new JSONListPrinter() : undefined;\n for (let i = 0; i < amount; i++) {\n // @ts-ignore: Top-level await is okay because this is not part of the main library.\n const scramble = await randomScrambleForEvent(eventID);\n switch (format) {\n case \"text\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleText(scramble)}\\n`);\n break;\n }\n case \"link\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleLink(scramble)}\\n`);\n break;\n }\n case \"json-text\": {\n jsonListPrinter?.push(scramble.toString());\n break;\n }\n case \"auto\": {\n console.log(`// Scramble #${i + 1}\n${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}\n`);\n break;\n }\n default: {\n throw new Error(\"Unknown format!\");\n }\n }\n }\n jsonListPrinter?.finish();\n }\n\n // TODO(https://github.com/cubing/cubing.js/issues/358): this shouldn't be needed.\n (await import(\"node:process\")).exit(0);\n },\n});\n\nawait run(binary(app), process.argv);\n"],
5
+ "mappings": ";;;;AAQA,SAAS,iBAAiB;AAC1B,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAG/B,IAAM;AAAA,EACJ;AAAA,EACA,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAI,MAAM,OAAO,YAAY;AAG7B,IAAM,gBAAgB,CAAC,QAAQ,QAAQ,WAAW;AAClD,IAAM,gBAAgB,CAAC,QAAQ,KAAK;AAEpC,IAAM,MAAM,QAAQ;AAAA,EAClB,MAAM;AAAA,EACN,MAAM;AAAA,IACJ,QAAQ,OAAO;AAAA,MACb,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,cAAc,MAAM;AAAA,MACpB,4BAA4B;AAAA,IAC9B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AG,aAAa,QAAQ,CAAC;AAAA,CAAI;AACzC;AAAA,UACF;AAAA,UACA,KAAK,aAAa;AAChB,6BAAiB,KAAK,SAAS,SAAS,CAAC;AACzC;AAAA,UACF;AAAA,UACA,KAAK,QAAQ;AACX,oBAAQ,IAAI,gBAAgB,IAAI,CAAC;AAAA,EAC3C,aAAa,QAAQ,CAAC;AAAA;AAAA,YAEnB,aAAa,QAAQ,CAAC;AAAA,CAC1B;AACW;AAAA,UACF;AAAA,UACA,SAAS;AACP,kBAAM,IAAI,MAAM,iBAAiB;AAAA,UACnC;AAAA,QACF;AAAA,MACF;AACA,uBAAiB,OAAO;AAAA,IAC1B;AAGA,KAAC,MAAM,OAAO,cAAc,GAAG,KAAK,CAAC;AAAA,EACvC;AACF,CAAC;AAED,MAAM,IAAI,OAAO,GAAG,GAAG,QAAQ,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { Texture, Object3D, Raycaster, PerspectiveCamera, Scene, WebGLRenderer } from 'three';
1
+ import { Texture, Object3D, Raycaster, PerspectiveCamera, Scene, WebGLRenderer } from 'three/src/Three.js';
2
2
 
3
3
  type ExperimentalNotationType = "auto" | "LGN";
4
4
  interface ExperimentalSerializationOptions {
@@ -408,6 +408,47 @@ declare class Perm {
408
408
  order(): number;
409
409
  }
410
410
 
411
+ declare class KTransformation {
412
+ #private;
413
+ readonly kpuzzle: KPuzzle;
414
+ readonly transformationData: KTransformationData;
415
+ constructor(kpuzzle: KPuzzle, transformationData: KTransformationData);
416
+ toJSON(): any;
417
+ invert(): KTransformation;
418
+ isIdentityTransformation(): boolean;
419
+ /** @deprecated */
420
+ static experimentalConstructIdentity(kpuzzle: KPuzzle): KTransformation;
421
+ isIdentical(t2: KTransformation): boolean;
422
+ /** @deprecated */
423
+ apply(source: KTransformationSource): KTransformation;
424
+ applyTransformation(t2: KTransformation): KTransformation;
425
+ applyMove(move: Move | string): KTransformation;
426
+ applyAlg(alg: Alg | string): KTransformation;
427
+ toKPattern(): KPattern;
428
+ repetitionOrder(): number;
429
+ selfMultiply(amount: number): KTransformation;
430
+ }
431
+
432
+ declare class KPattern {
433
+ readonly kpuzzle: KPuzzle;
434
+ readonly patternData: KPatternData;
435
+ constructor(kpuzzle: KPuzzle, patternData: KPatternData);
436
+ toJSON(): any;
437
+ static fromTransformation(transformation: KTransformation): KPattern;
438
+ /** @deprecated */
439
+ apply(source: KTransformationSource): KPattern;
440
+ applyTransformation(transformation: KTransformation): KPattern;
441
+ applyMove(move: Move | string): KPattern;
442
+ applyAlg(alg: Alg | string): KPattern;
443
+ isIdentical(other: KPattern): boolean;
444
+ /** @deprecated */
445
+ experimentalToTransformation(): KTransformation | null;
446
+ experimentalIsSolved(options: {
447
+ ignorePuzzleOrientation: boolean;
448
+ ignoreCenterOrientation: boolean;
449
+ }): boolean;
450
+ }
451
+
411
452
  type KPatternData = Record<string, KPatternOrbitData>;
412
453
  interface KPatternOrbitData {
413
454
  pieces: number[];
@@ -779,7 +820,7 @@ declare class PuzzleGeometry {
779
820
  private swizzler;
780
821
  notationMapper: NotationMapper;
781
822
  private addNotationMapper;
782
- private setReidOrder;
823
+ private setReidOrSpeffzOrder;
783
824
  private options;
784
825
  constructor(puzzleDescription: PuzzleDescription, options: PuzzleGeometryOptions);
785
826
  create(puzzleDescription: PuzzleDescription): void;
@@ -788,6 +829,7 @@ declare class PuzzleGeometry {
788
829
  private keyface3;
789
830
  private findface;
790
831
  private project2d;
832
+ private upperStringToBitSet;
791
833
  allstickers(): void;
792
834
  unswizzle(mv: Move): Move | null;
793
835
  private stringToBlockMove;
@@ -833,27 +875,6 @@ declare class PGNotation {
833
875
  remapKPuzzleDefinition(kpuzzleDefinition: KPuzzleDefinition): KPuzzleDefinition;
834
876
  }
835
877
 
836
- declare class KTransformation {
837
- #private;
838
- readonly kpuzzle: KPuzzle;
839
- readonly transformationData: KTransformationData;
840
- constructor(kpuzzle: KPuzzle, transformationData: KTransformationData);
841
- toJSON(): any;
842
- invert(): KTransformation;
843
- isIdentityTransformation(): boolean;
844
- /** @deprecated */
845
- static experimentalConstructIdentity(kpuzzle: KPuzzle): KTransformation;
846
- isIdentical(t2: KTransformation): boolean;
847
- /** @deprecated */
848
- apply(source: KTransformationSource): KTransformation;
849
- applyTransformation(t2: KTransformation): KTransformation;
850
- applyMove(move: Move | string): KTransformation;
851
- applyAlg(alg: Alg | string): KTransformation;
852
- toKPattern(): KPattern;
853
- repetitionOrder(): number;
854
- selfMultiply(amount: number): KTransformation;
855
- }
856
-
857
878
  type KTransformationSource = Alg | Move | string | KTransformation;
858
879
  declare class KPuzzle {
859
880
  #private;
@@ -2264,24 +2285,4 @@ interface PuzzleLoader {
2264
2285
  keyMapping?: () => Promise<KeyMapping>;
2265
2286
  }
2266
2287
 
2267
- declare class KPattern {
2268
- readonly kpuzzle: KPuzzle;
2269
- readonly patternData: KPatternData;
2270
- constructor(kpuzzle: KPuzzle, patternData: KPatternData);
2271
- toJSON(): any;
2272
- static fromTransformation(transformation: KTransformation): KPattern;
2273
- /** @deprecated */
2274
- apply(source: KTransformationSource): KPattern;
2275
- applyTransformation(transformation: KTransformation): KPattern;
2276
- applyMove(move: Move | string): KPattern;
2277
- applyAlg(alg: Alg | string): KPattern;
2278
- isIdentical(other: KPattern): boolean;
2279
- /** @deprecated */
2280
- experimentalToTransformation(): KTransformation | null;
2281
- experimentalIsSolved(options: {
2282
- ignorePuzzleOrientation: boolean;
2283
- ignoreCenterOrientation: boolean;
2284
- }): boolean;
2285
- }
2286
-
2287
2288
  export { LineComment as $, type AlgLeaf as A, TwistyPlayer as B, TwistyAlgViewer as C, type Duration as D, type ExperimentalStickering as E, TwistyAlgEditor as F, type TwistyPlayerConfig as G, type BackViewLayout as H, backViewLayouts as I, TwizzleLink as J, KPattern as K, type MillisecondTimestamp as L, Move as M, NO_VALUE as N, type AlgNode as O, Perm as P, Quat as Q, type AppendOptions as R, type StickerDat as S, type Timestamp as T, type KeyMapping as U, type VisualizationFormat as V, Grouping as W, Commutator as X, Conjugate as Y, Pause as Z, Newline as _, getPuzzleGeometryByDesc as a, type MoveModifications as a0, type AlgBranch as a1, type AppendCancelOptions as a2, type SimplifyOptions as a3, type Parsed as a4, type ExperimentalNotationType as a5, type ExperimentalSerializationOptions as a6, QuantumMove as a7, type KPuzzleDefinition as a8, type KPatternData as a9, type KPatternOrbitData as aa, type KTransformationData as ab, type KTransformationOrbitData as ac, getPuzzleGeometryByName as b, getPG3DNamedPuzzles as c, PuzzleGeometry as d, type StickerDatAxis as e, type StickerDatFace as f, getPuzzleDescriptionString as g, type StickerDatSticker as h, parseOptions as i, type PuzzleGeometryOptions as j, PGNotation as k, type PuzzleCutDescription as l, type PuzzleDescription as m, PUZZLE_CUT_TYPES as n, type PuzzleCutType as o, parsePuzzleDescription as p, PUZZLE_BASE_SHAPES as q, type PuzzleBaseShape as r, Alg as s, type PuzzleLoader as t, type PuzzleID as u, KPuzzle as v, type StickeringMask as w, type PuzzleSpecificSimplifyOptions as x, type AlgIndexer as y, KTransformation as z };
@@ -1,6 +1,6 @@
1
- import { O as AlgNode, s as Alg, M as Move, R as AppendOptions, U as KeyMapping, A as AlgLeaf, W as Grouping, X as Commutator, Y as Conjugate, Z as Pause, _ as Newline, $ as LineComment } from '../KPattern-BXlfgC6b.js';
2
- export { a1 as AlgBranch, a2 as AppendCancelOptions, a5 as ExperimentalNotationType, a4 as ExperimentalParsed, a6 as ExperimentalSerializationOptions, a0 as MoveModifications, x as PuzzleSpecificSimplifyOptions, a7 as QuantumMove, a3 as SimplifyOptions } from '../KPattern-BXlfgC6b.js';
3
- import 'three';
1
+ import { O as AlgNode, s as Alg, M as Move, R as AppendOptions, U as KeyMapping, A as AlgLeaf, W as Grouping, X as Commutator, Y as Conjugate, Z as Pause, _ as Newline, $ as LineComment } from '../PuzzleLoader-DWqO9l1G.js';
2
+ export { a1 as AlgBranch, a2 as AppendCancelOptions, a5 as ExperimentalNotationType, a4 as ExperimentalParsed, a6 as ExperimentalSerializationOptions, a0 as MoveModifications, x as PuzzleSpecificSimplifyOptions, a7 as QuantumMove, a3 as SimplifyOptions } from '../PuzzleLoader-DWqO9l1G.js';
3
+ import 'three/src/Three.js';
4
4
 
5
5
  /** @deprecated */
6
6
  type Unit = AlgNode;
@@ -1,7 +1,7 @@
1
- import { u as PuzzleID, t as PuzzleLoader, K as KPattern, s as Alg, M as Move } from '../KPattern-BXlfgC6b.js';
2
- import { B as BluetoothPuzzle } from '../bluetooth-puzzle-CkZw4jC6.js';
3
- export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle-CkZw4jC6.js';
4
- import 'three';
1
+ import { u as PuzzleID, t as PuzzleLoader, K as KPattern, s as Alg, M as Move } from '../PuzzleLoader-DWqO9l1G.js';
2
+ import { B as BluetoothPuzzle } from '../bluetooth-puzzle-C6TIIh-Z.js';
3
+ export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle-C6TIIh-Z.js';
4
+ import 'three/src/Three.js';
5
5
 
6
6
  declare function enableDebugLogging(enable: boolean): void;
7
7
 
@@ -56,9 +56,9 @@ declare class GanCube extends BluetoothPuzzle {
56
56
  faceletStatus2Characteristic(): Promise<BluetoothRemoteGATTCharacteristic>;
57
57
  actualAngleAndBatteryCharacteristic(): Promise<BluetoothRemoteGATTCharacteristic>;
58
58
  reset(): Promise<void>;
59
- readFaceletStatus1Characteristic(): Promise<ArrayBuffer>;
59
+ readFaceletStatus1Characteristic(): Promise<ArrayBufferLike>;
60
60
  readFaceletStatus2Characteristic(): Promise<string>;
61
- readActualAngleAndBatteryCharacteristic(): Promise<ArrayBuffer>;
61
+ readActualAngleAndBatteryCharacteristic(): Promise<ArrayBufferLike>;
62
62
  }
63
63
 
64
64
  /** @category Smart Puzzles */
@@ -142,7 +142,7 @@ declare class GanTimer extends EventTarget {
142
142
  disconnect(): void;
143
143
  poll(): Promise<void>;
144
144
  onDisconnect(): void;
145
- getTimeCharacteristic(): Promise<Uint8Array>;
145
+ getTimeCharacteristic(): Promise<Uint8Array<ArrayBufferLike>>;
146
146
  getTime(): Promise<number>;
147
147
  decodeTimeMs(bytes: Uint8Array): number;
148
148
  startPolling(): void;
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  binaryComponentsToReid3x3x3,
3
3
  twizzleBinaryToBinaryComponents
4
- } from "../chunks/chunk-2QDTMC3W.js";
4
+ } from "../chunks/chunk-YFGRXDD4.js";
5
5
  import {
6
6
  cube3x3x3,
7
7
  puzzles
8
- } from "../chunks/chunk-MFK4M6PV.js";
8
+ } from "../chunks/chunk-WOAANT6Y.js";
9
9
  import {
10
10
  experimental3x3x3KPuzzle
11
- } from "../chunks/chunk-SGPKF5IH.js";
11
+ } from "../chunks/chunk-YQVHA4F6.js";
12
12
  import {
13
13
  KPattern
14
14
  } from "../chunks/chunk-TQF5J7MH.js";
@@ -36,7 +36,8 @@ function debugLog(...args) {
36
36
  }
37
37
 
38
38
  // src/cubing/bluetooth/transformer.ts
39
- import { Quaternion, Vector3 } from "three";
39
+ import { Quaternion } from "three/src/math/Quaternion.js";
40
+ import { Vector3 } from "three/src/math/Vector3.js";
40
41
  function maxAxis(v) {
41
42
  const maxVal = Math.max(Math.abs(v.x), Math.abs(v.y), Math.abs(v.z));
42
43
  switch (maxVal) {
@@ -238,7 +239,7 @@ async function bluetoothConnect(configs, options = {}) {
238
239
  }
239
240
 
240
241
  // src/cubing/bluetooth/smart-puzzle/gan.ts
241
- import { Quaternion as Quaternion2 } from "three";
242
+ import { Quaternion as Quaternion2 } from "three/src/math/Quaternion.js";
242
243
 
243
244
  // src/cubing/vendor/public-domain/unsafe-raw-aes/unsafe-raw-aes.ts
244
245
  var blockSize = 16;
@@ -935,7 +936,7 @@ var giiKERConfig = {
935
936
  };
936
937
 
937
938
  // src/cubing/bluetooth/smart-puzzle/gocube.ts
938
- import { Quaternion as Quaternion3 } from "three";
939
+ import { Quaternion as Quaternion3 } from "three/src/math/Quaternion.js";
939
940
  var UUIDs3 = {
940
941
  goCubeService: "6e400001-b5a3-f393-e0a9-e50e24dcca9e",
941
942
  goCubeStateCharacteristic: "6e400003-b5a3-f393-e0a9-e50e24dcca9e"