cubing 0.21.0 → 0.22.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 (417) hide show
  1. package/dist/.DS_Store +0 -0
  2. package/dist/bin/puzzle-geometry-bin.js +9 -5
  3. package/dist/bin/puzzle-geometry-bin.js.map +2 -2
  4. package/dist/bundle-global/cubing.bundle-global.js +284 -303
  5. package/dist/esm/.DS_Store +0 -0
  6. package/dist/esm/3d-3WQVOHX5.js +21 -0
  7. package/dist/esm/3d-3WQVOHX5.js.map +7 -0
  8. package/dist/esm/alg/index.js +1 -1
  9. package/dist/esm/bluetooth/index.js +3 -3
  10. package/dist/esm/bluetooth/index.js.map +1 -1
  11. package/dist/esm/{chunk-RE7MIN5R.js → chunk-4IUYLRHT.js} +2 -2
  12. package/dist/esm/{chunk-RE7MIN5R.js.map → chunk-4IUYLRHT.js.map} +0 -0
  13. package/dist/esm/{chunk-7GADUDIG.js → chunk-7KI3I3Y7.js} +5 -5
  14. package/dist/esm/{chunk-7GADUDIG.js.map → chunk-7KI3I3Y7.js.map} +0 -0
  15. package/dist/esm/{chunk-5DN4DAAX.js → chunk-DLN5QS4V.js} +448 -1052
  16. package/dist/esm/chunk-DLN5QS4V.js.map +7 -0
  17. package/dist/esm/{chunk-BU5PUJK3.js → chunk-EWRBHQFX.js} +1 -1
  18. package/dist/esm/{chunk-BU5PUJK3.js.map → chunk-EWRBHQFX.js.map} +1 -1
  19. package/dist/esm/{chunk-CQS6JZ7G.js → chunk-HXKINJ7U.js} +6 -6
  20. package/dist/esm/{chunk-CQS6JZ7G.js.map → chunk-HXKINJ7U.js.map} +2 -2
  21. package/dist/esm/{chunk-YV3RT5PX.js → chunk-X6JHXPDX.js} +2 -2
  22. package/dist/esm/{chunk-YV3RT5PX.js.map → chunk-X6JHXPDX.js.map} +0 -0
  23. package/dist/esm/kpuzzle/index.js +2 -2
  24. package/dist/esm/notation/index.js +2 -2
  25. package/dist/esm/protocol/index.js +2 -2
  26. package/dist/esm/puzzle-geometry/index.js +10 -6
  27. package/dist/esm/puzzle-geometry/index.js.map +2 -2
  28. package/dist/esm/puzzles/index.js +7 -7
  29. package/dist/esm/scramble/index.js +4 -4
  30. package/dist/esm/search/index.js +4 -4
  31. package/dist/esm/stream/index.js +1 -1
  32. package/dist/esm/twisty/index.js +723 -2344
  33. package/dist/esm/twisty/index.js.map +3 -3
  34. package/dist/esm/{worker-inside-generated-string-KDZOUGJF.js → worker-inside-generated-string-ZA6E6672.js} +21 -21
  35. package/dist/esm/worker-inside-generated-string-ZA6E6672.js.map +7 -0
  36. package/dist/types/alg/index.d.ts +1 -0
  37. package/dist/types/alg/index.d.ts.map +1 -1
  38. package/dist/types/alg/units/leaves/Move.d.ts +1 -1
  39. package/dist/types/alg/units/leaves/Move.d.ts.map +1 -1
  40. package/dist/types/cubing.bundle-global.d.ts +1 -24
  41. package/dist/types/cubing.bundle-global.d.ts.map +1 -1
  42. package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts +3 -0
  43. package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts.map +1 -1
  44. package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts +5 -1
  45. package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts.map +1 -1
  46. package/dist/types/puzzles/index.d.ts +6 -2
  47. package/dist/types/puzzles/index.d.ts.map +1 -1
  48. package/dist/types/search/worker-inside-generated-string.d.ts +1 -1
  49. package/dist/types/search/worker-inside-generated-string.d.ts.map +1 -1
  50. package/dist/types/twisty/{old/animation/cursor/CursorTypes.d.ts → controllers/AnimationTypes.d.ts} +10 -3
  51. package/dist/types/twisty/controllers/AnimationTypes.d.ts.map +1 -0
  52. package/dist/types/twisty/{old/animation → controllers}/RenderScheduler.d.ts +0 -0
  53. package/dist/types/twisty/controllers/RenderScheduler.d.ts.map +1 -0
  54. package/dist/types/twisty/controllers/TwistyAnimationController.d.ts +1 -1
  55. package/dist/types/twisty/controllers/TwistyAnimationController.d.ts.map +1 -1
  56. package/dist/types/twisty/{old/animation → controllers}/easing.d.ts +0 -0
  57. package/dist/types/twisty/controllers/easing.d.ts.map +1 -0
  58. package/dist/types/twisty/{old/animation → controllers}/indexer/AlgDuration.d.ts +2 -2
  59. package/dist/types/twisty/controllers/indexer/AlgDuration.d.ts.map +1 -0
  60. package/dist/types/twisty/{old/animation → controllers}/indexer/AlgIndexer.d.ts +3 -3
  61. package/dist/types/twisty/controllers/indexer/AlgIndexer.d.ts.map +1 -0
  62. package/dist/types/twisty/{old/animation → controllers}/indexer/SimpleAlgIndexer.d.ts +3 -3
  63. package/dist/types/twisty/controllers/indexer/SimpleAlgIndexer.d.ts.map +1 -0
  64. package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts +3 -3
  65. package/dist/types/twisty/controllers/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +1 -0
  66. package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts +3 -3
  67. package/dist/types/twisty/controllers/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts.map +1 -0
  68. package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/simul-moves.d.ts +2 -2
  69. package/dist/types/twisty/controllers/indexer/simultaneous-moves/simul-moves.d.ts.map +1 -0
  70. package/dist/types/twisty/{old/animation → controllers}/indexer/tree/AlgWalker.d.ts +2 -2
  71. package/dist/types/twisty/controllers/indexer/tree/AlgWalker.d.ts.map +1 -0
  72. package/dist/types/twisty/{old/animation → controllers}/indexer/tree/TreeAlgIndexer.d.ts +3 -3
  73. package/dist/types/twisty/controllers/indexer/tree/TreeAlgIndexer.d.ts.map +1 -0
  74. package/dist/types/twisty/controllers/indexer/tree/chunkAlgs.d.ts +3 -0
  75. package/dist/types/twisty/controllers/indexer/tree/chunkAlgs.d.ts.map +1 -0
  76. package/dist/types/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.d.ts +2 -2
  77. package/dist/types/twisty/controllers/stream/timeline-move-calculation-draft.d.ts.map +1 -0
  78. package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts +1 -2
  79. package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts.map +1 -1
  80. package/dist/types/twisty/index.d.ts +9 -12
  81. package/dist/types/twisty/index.d.ts.map +1 -1
  82. package/dist/types/twisty/model/TwistyPlayerModel.d.ts +11 -0
  83. package/dist/types/twisty/model/TwistyPlayerModel.d.ts.map +1 -1
  84. package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts +1 -1
  85. package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts.map +1 -1
  86. package/dist/types/twisty/model/props/puzzle/display/FoundationDisplayProp.d.ts +6 -0
  87. package/dist/types/twisty/model/props/puzzle/display/FoundationDisplayProp.d.ts.map +1 -0
  88. package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts +5 -1
  89. package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts.map +1 -1
  90. package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts +44 -1
  91. package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts.map +1 -1
  92. package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts +2 -2
  93. package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts.map +1 -1
  94. package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts +1 -1
  95. package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts.map +1 -1
  96. package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts +1 -1
  97. package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts.map +1 -1
  98. package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts +1 -1
  99. package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts.map +1 -1
  100. package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts +5 -2
  101. package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts.map +1 -1
  102. package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts +2 -2
  103. package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts.map +1 -1
  104. package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts +2 -2
  105. package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts.map +1 -1
  106. package/dist/types/twisty/model/props/puzzle/state/MovePressInputProp.d.ts +6 -0
  107. package/dist/types/twisty/model/props/puzzle/state/MovePressInputProp.d.ts.map +1 -0
  108. package/dist/types/twisty/model/props/puzzle/state/NaiveMoveCountProp.d.ts +10 -0
  109. package/dist/types/twisty/model/props/puzzle/state/NaiveMoveCountProp.d.ts.map +1 -0
  110. package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts +5 -1
  111. package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts.map +1 -1
  112. package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts +1 -1
  113. package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts.map +1 -1
  114. package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts +19 -1
  115. package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts.map +1 -1
  116. package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts +1 -1
  117. package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts.map +1 -1
  118. package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts +2 -3
  119. package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts.map +1 -1
  120. package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts +1 -1
  121. package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts.map +1 -1
  122. package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts +1 -1
  123. package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts.map +1 -1
  124. package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts +6 -1
  125. package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts.map +1 -1
  126. package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts +5 -1
  127. package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts.map +1 -1
  128. package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts +5 -1
  129. package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts.map +1 -1
  130. package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts +18 -5
  131. package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts.map +1 -1
  132. package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts +6 -6
  133. package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts.map +1 -1
  134. package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts +2 -2
  135. package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts.map +1 -1
  136. package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts +5 -1
  137. package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts.map +1 -1
  138. package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts +7 -1
  139. package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts.map +1 -1
  140. package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts +1 -1
  141. package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts.map +1 -1
  142. package/dist/types/twisty/views/2D/Twisty2DPuzzle.css.d.ts +3 -0
  143. package/dist/types/twisty/views/2D/Twisty2DPuzzle.css.d.ts.map +1 -0
  144. package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts +4 -6
  145. package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts.map +1 -1
  146. package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts +1 -1
  147. package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts.map +1 -1
  148. package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts +2 -2
  149. package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts.map +1 -1
  150. package/dist/types/twisty/views/3D/DragTracker.d.ts +28 -0
  151. package/dist/types/twisty/views/3D/DragTracker.d.ts.map +1 -0
  152. package/dist/types/twisty/views/3D/RendererPool.d.ts.map +1 -1
  153. package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts +6 -1
  154. package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts.map +1 -1
  155. package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts +9 -4
  156. package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts.map +1 -1
  157. package/dist/types/twisty/views/3D/Twisty3DVantage.css.d.ts +3 -0
  158. package/dist/types/twisty/views/3D/Twisty3DVantage.css.d.ts.map +1 -0
  159. package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts +12 -8
  160. package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts.map +1 -1
  161. package/dist/types/twisty/views/3D/TwistyOrbitControls.d.ts +24 -0
  162. package/dist/types/twisty/views/3D/TwistyOrbitControls.d.ts.map +1 -0
  163. package/dist/types/twisty/views/3D/TwistyOrbitControls.spec.d.ts +5 -0
  164. package/dist/types/twisty/views/3D/TwistyOrbitControls.spec.d.ts.map +1 -0
  165. package/dist/types/twisty/views/3D/puzzles/Cube3D.d.ts +4 -4
  166. package/dist/types/twisty/views/3D/puzzles/Cube3D.d.ts.map +1 -1
  167. package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts +17 -10
  168. package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts.map +1 -1
  169. package/dist/types/twisty/views/3D/puzzles/Twisty3DPuzzle.d.ts +1 -1
  170. package/dist/types/twisty/views/3D/puzzles/Twisty3DPuzzle.d.ts.map +1 -1
  171. package/dist/types/twisty/{old/dom/element → views}/ClassListManager.d.ts +0 -0
  172. package/dist/types/twisty/views/ClassListManager.d.ts.map +1 -0
  173. package/dist/types/twisty/{old/dom/element → views}/ManagedCustomElement.d.ts +0 -0
  174. package/dist/types/twisty/views/ManagedCustomElement.d.ts.map +1 -0
  175. package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts +1 -1
  176. package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts.map +1 -1
  177. package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts +1 -1
  178. package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts.map +1 -1
  179. package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts +2 -1
  180. package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts.map +1 -1
  181. package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts +1 -1
  182. package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts.map +1 -1
  183. package/dist/types/twisty/views/TwistyAlgViewer.d.ts +2 -2
  184. package/dist/types/twisty/views/TwistyAlgViewer.d.ts.map +1 -1
  185. package/dist/types/twisty/views/TwistyPlayer.css.d.ts +3 -0
  186. package/dist/types/twisty/views/TwistyPlayer.css.d.ts.map +1 -0
  187. package/dist/types/twisty/views/TwistyPlayer.d.ts +7 -3
  188. package/dist/types/twisty/views/TwistyPlayer.d.ts.map +1 -1
  189. package/dist/types/twisty/views/TwistyPlayerSettable.d.ts +7 -4
  190. package/dist/types/twisty/views/TwistyPlayerSettable.d.ts.map +1 -1
  191. package/dist/types/twisty/views/TwistyViewerWrapper.css.d.ts +3 -0
  192. package/dist/types/twisty/views/TwistyViewerWrapper.css.d.ts.map +1 -0
  193. package/dist/types/twisty/{old/dom/viewers → views}/canvas.d.ts +0 -0
  194. package/dist/types/twisty/views/canvas.d.ts.map +1 -0
  195. package/dist/types/twisty/views/control-panel/TwistyButtonsV2.css.d.ts +4 -0
  196. package/dist/types/twisty/views/control-panel/TwistyButtonsV2.css.d.ts.map +1 -0
  197. package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts +1 -1
  198. package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts.map +1 -1
  199. package/dist/types/twisty/views/control-panel/TwistyScrubber.css.d.ts +3 -0
  200. package/dist/types/twisty/{old/dom/controls → views/control-panel}/TwistyScrubber.css.d.ts.map +1 -1
  201. package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts +1 -1
  202. package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts.map +1 -1
  203. package/dist/types/twisty/{old/dom/element → views}/node-custom-element-shims.d.ts +0 -0
  204. package/dist/types/twisty/views/node-custom-element-shims.d.ts.map +1 -0
  205. package/dist/types/twisty/views/stream/TwistyStreamSource.css.d.ts +3 -0
  206. package/dist/types/twisty/views/stream/TwistyStreamSource.css.d.ts.map +1 -0
  207. package/dist/types/twisty/{old/dom → views}/stream/TwistyStreamSource.d.ts +1 -1
  208. package/dist/types/twisty/views/stream/TwistyStreamSource.d.ts.map +1 -0
  209. package/docs/.DS_Store +0 -0
  210. package/docs/cubing/.DS_Store +0 -0
  211. package/docs/cubing/api/index.html +11 -52
  212. package/package.json +1 -1
  213. package/src/cubing/.DS_Store +0 -0
  214. package/src/cubing/alg/index.ts +1 -0
  215. package/src/cubing/alg/units/leaves/Move.ts +1 -1
  216. package/src/cubing/bluetooth/smart-timer/GanTimer.ts +1 -1
  217. package/src/cubing/cubing.bundle-global.ts +2 -2
  218. package/src/cubing/puzzle-geometry/PGPuzzles.spec.ts +4 -0
  219. package/src/cubing/puzzle-geometry/PuzzleGeometry.ts +14 -6
  220. package/src/cubing/puzzles/index.ts +3 -3
  221. package/src/cubing/search/worker-inside-generated-string.js +1 -1
  222. package/src/cubing/twisty/.DS_Store +0 -0
  223. package/src/cubing/{kpuzzle → twisty/controllers}/.DS_Store +0 -0
  224. package/src/cubing/twisty/{old/animation/cursor/CursorTypes.ts → controllers/AnimationTypes.ts} +11 -2
  225. package/src/cubing/twisty/{old/animation → controllers}/RenderScheduler.ts +0 -0
  226. package/src/cubing/twisty/controllers/TwistyAnimationController.ts +4 -4
  227. package/src/cubing/{search → twisty/controllers/animation}/.DS_Store +0 -0
  228. package/src/cubing/twisty/{old/animation → controllers}/easing.ts +0 -0
  229. package/src/cubing/{vendor → twisty/controllers/indexer}/.DS_Store +0 -0
  230. package/src/cubing/twisty/{old/animation → controllers}/indexer/AlgDuration.ts +2 -2
  231. package/src/cubing/twisty/{old/animation → controllers}/indexer/AlgIndexer.ts +4 -4
  232. package/src/cubing/twisty/{old/animation → controllers}/indexer/SimpleAlgIndexer.ts +4 -4
  233. package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexer.ts +3 -3
  234. package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.ts +3 -3
  235. package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/simul-moves.ts +2 -2
  236. package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/AlgWalker.ts +4 -4
  237. package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/TreeAlgIndexer.ts +3 -3
  238. package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/chunkAlgs.ts +2 -2
  239. package/src/cubing/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.spec.ts.TODO +0 -0
  240. package/src/cubing/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.ts +2 -2
  241. package/src/cubing/{alg → twisty/heavy-code-imports}/.DS_Store +0 -0
  242. package/src/cubing/twisty/heavy-code-imports/dynamic-entries/3d.ts +2 -12
  243. package/src/cubing/twisty/index.ts +12 -19
  244. package/src/cubing/twisty/model/.DS_Store +0 -0
  245. package/src/cubing/twisty/model/TwistyPlayerModel.ts +30 -1
  246. package/src/cubing/twisty/model/props/.DS_Store +0 -0
  247. package/src/cubing/twisty/model/props/TwistyPropDebugger.ts +3 -3
  248. package/src/cubing/twisty/model/props/puzzle/.DS_Store +0 -0
  249. package/src/cubing/twisty/model/props/puzzle/display/FoundationDisplayProp.ts +9 -0
  250. package/src/cubing/twisty/model/props/puzzle/display/HintFaceletProp.ts +6 -1
  251. package/src/cubing/twisty/model/props/puzzle/display/StickeringProp.ts +47 -1
  252. package/src/cubing/twisty/model/props/puzzle/state/AlgTransformationProp.ts +1 -1
  253. package/src/cubing/twisty/model/props/puzzle/state/AnchoredStartProp.ts +2 -2
  254. package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesProp.ts +2 -2
  255. package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesSimplified.ts +1 -1
  256. package/src/cubing/twisty/model/props/puzzle/state/CurrentTransformationProp.ts +1 -1
  257. package/src/cubing/twisty/model/props/puzzle/state/IndexerConstructorProp.ts +12 -5
  258. package/src/cubing/twisty/model/props/puzzle/state/IndexerProp.ts +2 -2
  259. package/src/cubing/twisty/model/props/puzzle/state/LegacyPositionProp.ts +2 -2
  260. package/src/cubing/twisty/model/props/puzzle/state/MovePressInputProp.ts +9 -0
  261. package/src/cubing/twisty/model/props/puzzle/state/NaiveMoveCountProp.ts +20 -0
  262. package/src/cubing/twisty/model/props/puzzle/state/SetupAnchorProp.ts +7 -1
  263. package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDProp.ts +1 -1
  264. package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.ts +20 -1
  265. package/src/cubing/twisty/model/props/puzzle/structure/PuzzleLoaderProp.ts +1 -1
  266. package/src/cubing/twisty/model/props/timeline/DetailedTimelineInfoProp.ts +5 -3
  267. package/src/cubing/twisty/model/props/timeline/PlayingInfoProp.ts +1 -4
  268. package/src/cubing/twisty/model/props/timeline/TimestampRequestProp.ts +1 -1
  269. package/src/cubing/twisty/model/props/viewer/BackViewProp.ts +7 -1
  270. package/src/cubing/twisty/model/props/viewer/BackgroundProp.ts +6 -1
  271. package/src/cubing/twisty/model/props/viewer/ControlPanelProp.ts +5 -1
  272. package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesProp.ts +83 -12
  273. package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesRequestProp.ts +8 -8
  274. package/src/cubing/twisty/model/props/viewer/TimeRangeProp.ts +2 -2
  275. package/src/cubing/twisty/model/props/viewer/ViewerLinkProp.ts +5 -1
  276. package/src/cubing/twisty/model/props/viewer/VisualizationProp.ts +8 -1
  277. package/src/cubing/twisty/model/props/viewer/VisualizationStrategyProp.ts +1 -1
  278. package/src/cubing/twisty/old/.DS_Store +0 -0
  279. package/src/cubing/twisty/old/animation/.DS_Store +0 -0
  280. package/src/cubing/twisty/old/dom/.DS_Store +0 -0
  281. package/src/cubing/twisty/views/.DS_Store +0 -0
  282. package/src/cubing/twisty/{old/dom/viewers/Twisty2DSVGView.css.ts → views/2D/Twisty2DPuzzle.css.ts} +1 -1
  283. package/src/cubing/twisty/views/2D/Twisty2DPuzzle.ts +8 -12
  284. package/src/cubing/twisty/views/2D/Twisty2DPuzzleWrapper.ts +1 -1
  285. package/src/cubing/twisty/views/2D/Twisty2DSceneWrapper.ts +4 -4
  286. package/src/cubing/twisty/{old/animation/indexer → views/3D}/.DS_Store +0 -0
  287. package/src/cubing/twisty/views/3D/DragTracker.ts +184 -0
  288. package/src/cubing/twisty/views/3D/RendererPool.ts +2 -1
  289. package/src/cubing/twisty/views/3D/Twisty3DPuzzleWrapper.ts +51 -5
  290. package/src/cubing/twisty/views/3D/Twisty3DSceneWrapper.ts +51 -10
  291. package/src/cubing/twisty/{old/dom/viewers/Twisty3DCanvas.css.ts → views/3D/Twisty3DVantage.css.ts} +2 -2
  292. package/src/cubing/twisty/views/3D/Twisty3DVantage.ts +103 -35
  293. package/src/cubing/twisty/views/3D/TwistyOrbitControls.spec.ts +213 -0
  294. package/src/cubing/twisty/views/3D/TwistyOrbitControls.ts +176 -0
  295. package/src/cubing/twisty/views/3D/puzzles/Cube3D.ts +5 -9
  296. package/src/cubing/twisty/views/3D/puzzles/PG3D.ts +127 -37
  297. package/src/cubing/twisty/views/3D/puzzles/Twisty3DPuzzle.ts +1 -1
  298. package/src/cubing/twisty/{old/dom/element → views}/ClassListManager.ts +0 -0
  299. package/src/cubing/twisty/{old/dom/element → views}/ManagedCustomElement.ts +0 -0
  300. package/src/cubing/twisty/views/TwistyAlgEditor/LeafTokens.ts +1 -1
  301. package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.ts +1 -1
  302. package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.ts +11 -4
  303. package/src/cubing/twisty/views/TwistyAlgViewer.css.ts +1 -1
  304. package/src/cubing/twisty/views/TwistyAlgViewer.ts +4 -4
  305. package/src/cubing/twisty/{old/dom → views}/TwistyPlayer.css.ts +4 -1
  306. package/src/cubing/twisty/views/TwistyPlayer.ts +16 -25
  307. package/src/cubing/twisty/views/TwistyPlayerSettable.ts +14 -10
  308. package/src/cubing/twisty/{old/dom/viewers → views}/TwistyViewerWrapper.css.ts +1 -1
  309. package/src/cubing/twisty/{old/dom/viewers → views}/canvas.ts +0 -0
  310. package/src/cubing/twisty/{old/dom/controls/buttons.css.ts → views/control-panel/TwistyButtonsV2.css.ts} +1 -1
  311. package/src/cubing/twisty/views/control-panel/TwistyButtonsV2.ts +5 -8
  312. package/src/cubing/twisty/{old/dom/controls → views/control-panel}/TwistyScrubber.css.ts +1 -1
  313. package/src/cubing/twisty/views/control-panel/TwistyScrubberV2.ts +3 -3
  314. package/src/cubing/twisty/{old/dom/element → views}/node-custom-element-shims.ts +0 -0
  315. package/src/cubing/twisty/{old/dom → views}/stream/TwistyStreamSource.css.ts +1 -1
  316. package/src/cubing/twisty/{old/dom → views}/stream/TwistyStreamSource.ts +9 -9
  317. package/dist/esm/3d-JZD3V366.js +0 -39
  318. package/dist/esm/3d-JZD3V366.js.map +0 -7
  319. package/dist/esm/chunk-5DN4DAAX.js.map +0 -7
  320. package/dist/esm/worker-inside-generated-string-KDZOUGJF.js.map +0 -7
  321. package/dist/types/twisty/old/animation/RenderScheduler.d.ts.map +0 -1
  322. package/dist/types/twisty/old/animation/Timeline.d.ts +0 -72
  323. package/dist/types/twisty/old/animation/Timeline.d.ts.map +0 -1
  324. package/dist/types/twisty/old/animation/cursor/AlgCursor.d.ts +0 -53
  325. package/dist/types/twisty/old/animation/cursor/AlgCursor.d.ts.map +0 -1
  326. package/dist/types/twisty/old/animation/cursor/CursorTypes.d.ts.map +0 -1
  327. package/dist/types/twisty/old/animation/easing.d.ts.map +0 -1
  328. package/dist/types/twisty/old/animation/indexer/AlgDuration.d.ts.map +0 -1
  329. package/dist/types/twisty/old/animation/indexer/AlgIndexer.d.ts.map +0 -1
  330. package/dist/types/twisty/old/animation/indexer/SimpleAlgIndexer.d.ts.map +0 -1
  331. package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +0 -1
  332. package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts.map +0 -1
  333. package/dist/types/twisty/old/animation/indexer/simultaneous-moves/simul-moves.d.ts.map +0 -1
  334. package/dist/types/twisty/old/animation/indexer/tree/AlgWalker.d.ts.map +0 -1
  335. package/dist/types/twisty/old/animation/indexer/tree/TreeAlgIndexer.d.ts.map +0 -1
  336. package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts +0 -3
  337. package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts.map +0 -1
  338. package/dist/types/twisty/old/animation/stream/timeline-move-calculation-draft.d.ts.map +0 -1
  339. package/dist/types/twisty/old/dom/TwistyAlgViewerV1.css.d.ts +0 -3
  340. package/dist/types/twisty/old/dom/TwistyAlgViewerV1.css.d.ts.map +0 -1
  341. package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts +0 -52
  342. package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts.map +0 -1
  343. package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts +0 -3
  344. package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts.map +0 -1
  345. package/dist/types/twisty/old/dom/TwistyPlayer.d.ts +0 -92
  346. package/dist/types/twisty/old/dom/TwistyPlayer.d.ts.map +0 -1
  347. package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts +0 -5
  348. package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts.map +0 -1
  349. package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts +0 -165
  350. package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts.map +0 -1
  351. package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts +0 -2
  352. package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts.map +0 -1
  353. package/dist/types/twisty/old/dom/controls/TwistyScrubber.css.d.ts +0 -3
  354. package/dist/types/twisty/old/dom/controls/TwistyScrubber.d.ts +0 -14
  355. package/dist/types/twisty/old/dom/controls/TwistyScrubber.d.ts.map +0 -1
  356. package/dist/types/twisty/old/dom/controls/buttons.css.d.ts +0 -4
  357. package/dist/types/twisty/old/dom/controls/buttons.css.d.ts.map +0 -1
  358. package/dist/types/twisty/old/dom/controls/buttons.d.ts +0 -40
  359. package/dist/types/twisty/old/dom/controls/buttons.d.ts.map +0 -1
  360. package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts +0 -5
  361. package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts.map +0 -1
  362. package/dist/types/twisty/old/dom/element/ClassListManager.d.ts.map +0 -1
  363. package/dist/types/twisty/old/dom/element/ElementConfig.d.ts +0 -49
  364. package/dist/types/twisty/old/dom/element/ElementConfig.d.ts.map +0 -1
  365. package/dist/types/twisty/old/dom/element/ManagedCustomElement.d.ts.map +0 -1
  366. package/dist/types/twisty/old/dom/element/node-custom-element-shims.d.ts.map +0 -1
  367. package/dist/types/twisty/old/dom/stream/TwistyStreamSource.css.d.ts +0 -3
  368. package/dist/types/twisty/old/dom/stream/TwistyStreamSource.css.d.ts.map +0 -1
  369. package/dist/types/twisty/old/dom/stream/TwistyStreamSource.d.ts.map +0 -1
  370. package/dist/types/twisty/old/dom/viewers/Twisty2DSVG.d.ts +0 -26
  371. package/dist/types/twisty/old/dom/viewers/Twisty2DSVG.d.ts.map +0 -1
  372. package/dist/types/twisty/old/dom/viewers/Twisty2DSVGView.css.d.ts +0 -3
  373. package/dist/types/twisty/old/dom/viewers/Twisty2DSVGView.css.d.ts.map +0 -1
  374. package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.css.d.ts +0 -3
  375. package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.css.d.ts.map +0 -1
  376. package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts +0 -41
  377. package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts.map +0 -1
  378. package/dist/types/twisty/old/dom/viewers/TwistyOrbitControls.d.ts +0 -59
  379. package/dist/types/twisty/old/dom/viewers/TwistyOrbitControls.d.ts.map +0 -1
  380. package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts +0 -4
  381. package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts.map +0 -1
  382. package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.css.d.ts +0 -3
  383. package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.css.d.ts.map +0 -1
  384. package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.d.ts +0 -18
  385. package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.d.ts.map +0 -1
  386. package/dist/types/twisty/old/dom/viewers/canvas.d.ts.map +0 -1
  387. package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts +0 -41
  388. package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts.map +0 -1
  389. package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts +0 -5
  390. package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts.map +0 -1
  391. package/dist/types/twisty/views/3D/puzzles/TwistyTestBox.d.ts +0 -9
  392. package/dist/types/twisty/views/3D/puzzles/TwistyTestBox.d.ts.map +0 -1
  393. package/src/cubing/alg/units/.DS_Store +0 -0
  394. package/src/cubing/bluetooth/.DS_Store +0 -0
  395. package/src/cubing/puzzles/.DS_Store +0 -0
  396. package/src/cubing/puzzles/implementations/.DS_Store +0 -0
  397. package/src/cubing/stream/.DS_Store +0 -0
  398. package/src/cubing/twisty/old/animation/Timeline.ts +0 -378
  399. package/src/cubing/twisty/old/animation/cursor/AlgCursor.ts +0 -252
  400. package/src/cubing/twisty/old/dom/TwistyAlgViewerV1.css.ts +0 -25
  401. package/src/cubing/twisty/old/dom/TwistyAlgViewerV1.ts +0 -516
  402. package/src/cubing/twisty/old/dom/TwistyPlayer.spec.ts +0 -25
  403. package/src/cubing/twisty/old/dom/TwistyPlayer.ts +0 -927
  404. package/src/cubing/twisty/old/dom/TwistyPlayerConfig.ts +0 -378
  405. package/src/cubing/twisty/old/dom/controls/TwistyControlElement.ts +0 -1
  406. package/src/cubing/twisty/old/dom/controls/TwistyScrubber.ts +0 -53
  407. package/src/cubing/twisty/old/dom/controls/buttons.spec.ts +0 -37
  408. package/src/cubing/twisty/old/dom/controls/buttons.ts +0 -326
  409. package/src/cubing/twisty/old/dom/element/ElementConfig.ts +0 -180
  410. package/src/cubing/twisty/old/dom/viewers/Twisty2DSVG.ts +0 -118
  411. package/src/cubing/twisty/old/dom/viewers/Twisty3DCanvas.ts +0 -256
  412. package/src/cubing/twisty/old/dom/viewers/TwistyOrbitControls.ts +0 -420
  413. package/src/cubing/twisty/old/dom/viewers/TwistyViewerElement.ts +0 -5
  414. package/src/cubing/twisty/old/dom/viewers/TwistyViewerWrapper.ts +0 -45
  415. package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.spec.ts +0 -209
  416. package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.ts +0 -270
  417. package/src/cubing/twisty/views/3D/puzzles/TwistyTestBox.ts +0 -22
@@ -1,19 +1,23 @@
1
1
  import {
2
+ cube3x3x3,
2
3
  getFaceletAppearance,
3
4
  puzzles
4
- } from "./chunk-CQS6JZ7G.js";
5
+ } from "./chunk-HXKINJ7U.js";
5
6
  import {
7
+ KPuzzle,
6
8
  areTransformationsEquivalent,
7
- transformationForQuantumMove
8
- } from "./chunk-YV3RT5PX.js";
9
+ transformationForQuantumMove,
10
+ transformationOrder
11
+ } from "./chunk-X6JHXPDX.js";
9
12
  import {
10
- Alg
11
- } from "./chunk-BU5PUJK3.js";
13
+ Move
14
+ } from "./chunk-EWRBHQFX.js";
12
15
  import {
13
16
  __privateAdd,
14
17
  __privateGet,
15
18
  __privateMethod,
16
- __privateSet
19
+ __privateSet,
20
+ __privateWrapper
17
21
  } from "./chunk-WO2AXYFE.js";
18
22
 
19
23
  // src/cubing/twisty/views/3D/puzzles/Cube3D.ts
@@ -32,363 +36,345 @@ import {
32
36
  Quaternion,
33
37
  TextureLoader,
34
38
  Vector2,
35
- Vector3 as Vector32
39
+ Vector3
36
40
  } from "three";
37
41
 
38
- // src/cubing/twisty/old/animation/easing.ts
39
- function smootherStep(x) {
40
- return x * x * x * (10 - x * (15 - 6 * x));
41
- }
42
-
43
- // src/cubing/twisty/old/dom/TwistyPlayerConfig.ts
44
- import { Vector3 } from "three";
45
-
46
- // src/cubing/twisty/views/3D/TAU.ts
47
- var TAU = Math.PI * 2;
48
- var DEGREES_PER_RADIAN = 360 / TAU;
49
-
50
- // src/cubing/twisty/old/dom/element/ElementConfig.ts
51
- var AlgAttribute = class {
52
- constructor(initialValue) {
53
- if (initialValue) {
54
- if (typeof initialValue === "string") {
55
- this.setString(initialValue);
56
- } else {
57
- this.setValue(initialValue);
58
- }
59
- } else {
60
- this.setValue(this.defaultValue());
61
- }
42
+ // src/cubing/vendor/p-lazy/p-lazy.ts
43
+ var PLazy = class extends Promise {
44
+ constructor(executor) {
45
+ super((resolve) => {
46
+ resolve();
47
+ });
48
+ this._executor = executor;
62
49
  }
63
- setString(str) {
64
- if (this.string === str) {
65
- return false;
66
- }
67
- this.string = str;
68
- this.value = this.toValue(str);
69
- return true;
50
+ static from(function_) {
51
+ return new PLazy((resolve) => {
52
+ resolve(function_());
53
+ });
70
54
  }
71
- setValue(val) {
72
- const str = this.toString(val);
73
- if (this.string === str) {
74
- return false;
75
- }
76
- this.string = str;
77
- this.value = val;
78
- return true;
55
+ static resolve(value) {
56
+ return new PLazy((resolve) => {
57
+ resolve(value);
58
+ });
79
59
  }
80
- defaultValue() {
81
- return new Alg([]);
60
+ static reject(error) {
61
+ return new PLazy((_resolve, reject) => {
62
+ reject(error);
63
+ });
82
64
  }
83
- toValue(s) {
84
- return Alg.fromString(s);
65
+ then(onFulfilled, onRejected) {
66
+ this._promise = this._promise || new Promise(this._executor);
67
+ return this._promise.then(onFulfilled, onRejected);
85
68
  }
86
- toString(val) {
87
- return val.toString();
69
+ catch(onRejected) {
70
+ this._promise = this._promise || new Promise(this._executor);
71
+ return this._promise.catch(onRejected);
88
72
  }
89
73
  };
90
- var StringEnumAttribute = class {
91
- constructor(enumVal, initialValue) {
92
- this.enumVal = enumVal;
93
- this.setString(initialValue ?? this.defaultValue());
94
- }
95
- setString(str) {
96
- if (this.string === str) {
97
- return false;
98
- }
99
- if (!(str in this.enumVal)) {
100
- throw new Error(`Invalid string for attribute!: ${str}`);
74
+ function from(function_) {
75
+ return new PLazy((resolve) => {
76
+ resolve(function_());
77
+ });
78
+ }
79
+
80
+ // src/cubing/twisty/model/PromiseFreshener.ts
81
+ var _latestAssignedIdx, _latestResolvedIdx;
82
+ var PromiseFreshener = class {
83
+ constructor() {
84
+ __privateAdd(this, _latestAssignedIdx, 0);
85
+ __privateAdd(this, _latestResolvedIdx, 0);
86
+ }
87
+ async queue(p) {
88
+ const idx = ++__privateWrapper(this, _latestAssignedIdx)._;
89
+ const result = await p;
90
+ if (idx > __privateGet(this, _latestResolvedIdx)) {
91
+ __privateSet(this, _latestResolvedIdx, idx);
92
+ return {
93
+ fresh: true,
94
+ result
95
+ };
96
+ } else {
97
+ return { fresh: false };
101
98
  }
102
- this.string = str;
103
- this.value = this.toValue(str);
104
- return true;
105
- }
106
- setValue(val) {
107
- return this.setString(val);
108
- }
109
- defaultValue() {
110
- return Object.keys(this.enumVal)[0];
111
- }
112
- toValue(s) {
113
- return s;
114
99
  }
115
100
  };
116
- var _defaultValue, _clampValue, clampValue_fn;
117
- var RangedFloatAttribute = class {
118
- constructor(defaultValue, minValue, maxValue, initialValue) {
119
- this.minValue = minValue;
120
- this.maxValue = maxValue;
121
- __privateAdd(this, _clampValue);
122
- __privateAdd(this, _defaultValue, void 0);
123
- __privateSet(this, _defaultValue, defaultValue === null ? null : __privateMethod(this, _clampValue, clampValue_fn).call(this, defaultValue));
124
- this.setValue(initialValue ?? this.defaultValue());
125
- }
126
- setString(str) {
127
- return this.setValue(str === "" ? null : this.toValue(str));
128
- }
129
- setValue(val) {
130
- const str = this.toString(val);
131
- if (this.string === str) {
132
- return false;
133
- }
134
- this.string = str;
135
- this.value = val;
136
- return true;
137
- }
138
- defaultValue() {
139
- return __privateGet(this, _defaultValue);
140
- }
141
- toValue(s) {
142
- return parseFloat(s);
143
- }
144
- toString(v) {
145
- return v === null ? "" : v.toString();
101
+ _latestAssignedIdx = new WeakMap();
102
+ _latestResolvedIdx = new WeakMap();
103
+ var _latestAssignedIdx2, _latestResolvedIdx2;
104
+ var StaleDropper = class {
105
+ constructor() {
106
+ __privateAdd(this, _latestAssignedIdx2, 0);
107
+ __privateAdd(this, _latestResolvedIdx2, 0);
108
+ }
109
+ queue(p) {
110
+ return new Promise(async (resolve, reject) => {
111
+ try {
112
+ const idx = ++__privateWrapper(this, _latestAssignedIdx2)._;
113
+ const result = await p;
114
+ if (idx > __privateGet(this, _latestResolvedIdx2)) {
115
+ __privateSet(this, _latestResolvedIdx2, idx);
116
+ resolve(result);
117
+ }
118
+ } catch (e) {
119
+ reject(e);
120
+ }
121
+ });
146
122
  }
147
123
  };
148
- _defaultValue = new WeakMap();
149
- _clampValue = new WeakSet();
150
- clampValue_fn = function(val) {
151
- return Math.max(Math.min(val, this.maxValue), this.minValue);
152
- };
124
+ _latestAssignedIdx2 = new WeakMap();
125
+ _latestResolvedIdx2 = new WeakMap();
153
126
 
154
- // src/cubing/twisty/old/dom/element/ClassListManager.ts
155
- var _currentClassName;
156
- var ClassListManager = class {
157
- constructor(elem, prefix, validSuffixes) {
158
- this.elem = elem;
159
- this.prefix = prefix;
160
- this.validSuffixes = validSuffixes;
161
- __privateAdd(this, _currentClassName, null);
162
- }
163
- clearValue() {
164
- if (__privateGet(this, _currentClassName)) {
165
- this.elem.contentWrapper.classList.remove(__privateGet(this, _currentClassName));
166
- }
167
- __privateSet(this, _currentClassName, null);
168
- }
169
- setValue(suffix) {
170
- if (!this.validSuffixes.includes(suffix)) {
171
- throw new Error(`Invalid suffix: ${suffix}`);
172
- }
173
- const newClassName = `${this.prefix}${suffix}`;
174
- const changed = __privateGet(this, _currentClassName) !== newClassName;
175
- if (changed) {
176
- this.clearValue();
177
- this.elem.contentWrapper.classList.add(newClassName);
178
- __privateSet(this, _currentClassName, newClassName);
179
- }
180
- return changed;
127
+ // src/cubing/twisty/model/props/TwistyProp.ts
128
+ var globalSourceGeneration = 0;
129
+ var _children, _rawListeners, _scheduleRawDispatch, scheduleRawDispatch_fn, _rawDispatchPending, _dispatchRawListeners, dispatchRawListeners_fn, _freshListeners;
130
+ var TwistyPropParent = class {
131
+ constructor() {
132
+ __privateAdd(this, _scheduleRawDispatch);
133
+ __privateAdd(this, _dispatchRawListeners);
134
+ __privateAdd(this, _children, new Set());
135
+ this.lastSourceGeneration = 0;
136
+ __privateAdd(this, _rawListeners, new Set());
137
+ __privateAdd(this, _rawDispatchPending, false);
138
+ __privateAdd(this, _freshListeners, new Map());
181
139
  }
182
- };
183
- _currentClassName = new WeakMap();
184
-
185
- // src/cubing/twisty/old/dom/element/node-custom-element-shims.ts
186
- var HTMLElementStub = class {
187
- };
188
- var HTMLElementShim;
189
- if (typeof HTMLElement !== "undefined") {
190
- HTMLElementShim = HTMLElement;
191
- } else {
192
- HTMLElementShim = HTMLElementStub;
193
- }
194
- var CustomElementsStub = class {
195
- define() {
140
+ canReuse(v1, v2) {
141
+ return v1 === v2 || this.canReuseValue(v1, v2);
196
142
  }
197
- };
198
- var customElementsShim;
199
- if (typeof customElements !== "undefined") {
200
- customElementsShim = customElements;
201
- } else {
202
- customElementsShim = new CustomElementsStub();
203
- }
204
-
205
- // src/cubing/twisty/old/dom/element/ManagedCustomElement.ts
206
- var CSSSource = class {
207
- constructor(sourceText) {
208
- this.sourceText = sourceText;
143
+ canReuseValue(_v1, _v2) {
144
+ return false;
209
145
  }
210
- getAsString() {
211
- return this.sourceText;
146
+ debugGetChildren() {
147
+ return Array.from(__privateGet(this, _children).values());
212
148
  }
213
- };
214
- var _cssSourceMap;
215
- var ManagedCustomElement = class extends HTMLElementShim {
216
- constructor(options) {
217
- super();
218
- __privateAdd(this, _cssSourceMap, new Map());
219
- this.shadow = this.attachShadow({ mode: options?.mode ?? "closed" });
220
- this.contentWrapper = document.createElement("div");
221
- this.contentWrapper.classList.add("wrapper");
222
- this.shadow.appendChild(this.contentWrapper);
223
- }
224
- addCSS(cssSource) {
225
- if (__privateGet(this, _cssSourceMap).get(cssSource)) {
149
+ addChild(child) {
150
+ __privateGet(this, _children).add(child);
151
+ }
152
+ removeChild(child) {
153
+ __privateGet(this, _children).delete(child);
154
+ }
155
+ markStale(sourceEvent) {
156
+ if (sourceEvent.detail.generation !== globalSourceGeneration) {
157
+ throw new Error("A TwistyProp was marked stale too late!");
158
+ }
159
+ if (this.lastSourceGeneration === sourceEvent.detail.generation) {
226
160
  return;
227
161
  }
228
- const cssElem = document.createElement("style");
229
- cssElem.textContent = cssSource.getAsString();
230
- __privateGet(this, _cssSourceMap).set(cssSource, cssElem);
231
- this.shadow.appendChild(cssElem);
162
+ this.lastSourceGeneration = sourceEvent.detail.generation;
163
+ for (const child of __privateGet(this, _children)) {
164
+ child.markStale(sourceEvent);
165
+ }
166
+ __privateMethod(this, _scheduleRawDispatch, scheduleRawDispatch_fn).call(this);
232
167
  }
233
- removeCSS(cssSource) {
234
- const cssElem = __privateGet(this, _cssSourceMap).get(cssSource);
235
- if (!cssElem) {
236
- return;
168
+ addRawListener(listener, options) {
169
+ __privateGet(this, _rawListeners).add(listener);
170
+ if (options?.initial) {
171
+ listener();
237
172
  }
238
- this.shadow.removeChild(cssElem);
239
- __privateGet(this, _cssSourceMap).delete(cssSource);
240
173
  }
241
- addElement(element) {
242
- return this.contentWrapper.appendChild(element);
174
+ removeRawListener(listener) {
175
+ __privateGet(this, _rawListeners).delete(listener);
243
176
  }
244
- prependElement(element) {
245
- this.contentWrapper.prepend(element);
177
+ addFreshListener(listener) {
178
+ const staleDropper = new StaleDropper();
179
+ let lastResult = null;
180
+ const callback = async () => {
181
+ const result = await staleDropper.queue(this.get());
182
+ if (lastResult !== null && this.canReuse(lastResult, result)) {
183
+ return;
184
+ }
185
+ lastResult = result;
186
+ listener(result);
187
+ };
188
+ __privateGet(this, _freshListeners).set(listener, callback);
189
+ this.addRawListener(callback, { initial: true });
246
190
  }
247
- removeElement(element) {
248
- return this.contentWrapper.removeChild(element);
191
+ removeFreshListener(listener) {
192
+ this.removeRawListener(__privateGet(this, _freshListeners).get(listener));
193
+ __privateGet(this, _freshListeners).delete(listener);
249
194
  }
250
195
  };
251
- _cssSourceMap = new WeakMap();
252
- customElementsShim.define("twisty-managed-custom-element", ManagedCustomElement);
253
-
254
- // src/cubing/twisty/old/dom/viewers/TwistyViewerWrapper.css.ts
255
- var twistyViewerWrapperCSS = new CSSSource(`
256
- :host {
257
- width: 384px;
258
- height: 256px;
259
- display: grid;
260
- }
261
-
262
- .wrapper {
263
- width: 100%;
264
- height: 100%;
265
- display: grid;
266
- overflow: hidden;
267
- }
268
-
269
- .wrapper > * {
270
- width: 100%;
271
- height: 100%;
272
- overflow: hidden;
273
- }
274
-
275
- .wrapper.back-view-side-by-side {
276
- grid-template-columns: 1fr 1fr;
277
- }
278
-
279
- .wrapper.back-view-top-right {
280
- grid-template-columns: 3fr 1fr;
281
- grid-template-rows: 1fr 3fr;
282
- }
283
-
284
- .wrapper.back-view-top-right > :nth-child(1) {
285
- grid-row: 1 / 3;
286
- grid-column: 1 / 3;
287
- }
288
-
289
- .wrapper.back-view-top-right > :nth-child(2) {
290
- grid-row: 1 / 2;
291
- grid-column: 2 / 3;
292
- }
293
- `);
294
-
295
- // src/cubing/twisty/old/dom/viewers/TwistyViewerWrapper.ts
296
- var backViewLayouts = {
297
- "none": true,
298
- "side-by-side": true,
299
- "top-right": true
196
+ _children = new WeakMap();
197
+ _rawListeners = new WeakMap();
198
+ _scheduleRawDispatch = new WeakSet();
199
+ scheduleRawDispatch_fn = function() {
200
+ if (!__privateGet(this, _rawDispatchPending)) {
201
+ __privateSet(this, _rawDispatchPending, true);
202
+ setTimeout(() => __privateMethod(this, _dispatchRawListeners, dispatchRawListeners_fn).call(this), 0);
203
+ }
300
204
  };
301
- var _backViewClassListManager;
302
- var TwistyViewerWrapper = class extends ManagedCustomElement {
303
- constructor(config = {}) {
205
+ _rawDispatchPending = new WeakMap();
206
+ _dispatchRawListeners = new WeakSet();
207
+ dispatchRawListeners_fn = function() {
208
+ if (!__privateGet(this, _rawDispatchPending)) {
209
+ throw new Error("Invalid dispatch state!");
210
+ }
211
+ for (const listener of __privateGet(this, _rawListeners)) {
212
+ listener();
213
+ }
214
+ __privateSet(this, _rawDispatchPending, false);
215
+ };
216
+ _freshListeners = new WeakMap();
217
+ var _value;
218
+ var TwistyPropSource = class extends TwistyPropParent {
219
+ constructor(initialValue) {
304
220
  super();
305
- __privateAdd(this, _backViewClassListManager, new ClassListManager(this, "back-view-", [
306
- "none",
307
- "side-by-side",
308
- "top-right"
309
- ]));
310
- this.addCSS(twistyViewerWrapperCSS);
311
- if (config.backView && config.backView in backViewLayouts) {
312
- __privateGet(this, _backViewClassListManager).setValue(config.backView);
221
+ __privateAdd(this, _value, void 0);
222
+ __privateSet(this, _value, from(() => this.getDefaultValue()));
223
+ if (initialValue) {
224
+ __privateSet(this, _value, this.deriveFromPromiseOrValue(initialValue, __privateGet(this, _value)));
313
225
  }
314
226
  }
315
- setBackView(backView) {
316
- return __privateGet(this, _backViewClassListManager).setValue(backView);
227
+ set(input) {
228
+ __privateSet(this, _value, this.deriveFromPromiseOrValue(input, __privateGet(this, _value)));
229
+ const sourceEventDetail = {
230
+ sourceProp: this,
231
+ value: __privateGet(this, _value),
232
+ generation: ++globalSourceGeneration
233
+ };
234
+ this.markStale(new CustomEvent("stale", {
235
+ detail: sourceEventDetail
236
+ }));
317
237
  }
318
- clear() {
319
- this.contentWrapper.innerHTML = "";
238
+ async get() {
239
+ return __privateGet(this, _value);
240
+ }
241
+ async deriveFromPromiseOrValue(input, oldValuePromise) {
242
+ return this.derive(await input, oldValuePromise);
320
243
  }
321
244
  };
322
- _backViewClassListManager = new WeakMap();
323
- customElementsShim.define("twisty-viewer-wrapper", TwistyViewerWrapper);
324
-
325
- // src/cubing/twisty/old/dom/TwistyPlayerConfig.ts
326
- var centeredCameraOrbitCoordinates = {
327
- latitude: 31.717474411461005,
328
- longitude: 0,
329
- distance: 5.877852522924731
330
- };
331
- var cubeCube3DCameraOrbitCoordinates = {
332
- latitude: 35,
333
- longitude: 30,
334
- distance: 6
335
- };
336
- var cubePG3DCameraOrbitCoordinates = {
337
- latitude: 35,
338
- longitude: 30,
339
- distance: 6.25
245
+ _value = new WeakMap();
246
+ var SimpleTwistyPropSource = class extends TwistyPropSource {
247
+ derive(input) {
248
+ return input;
249
+ }
340
250
  };
341
- var megaminxCameraOrbitCoordinates = {
342
- latitude: Math.atan(1 / 2) * DEGREES_PER_RADIAN,
343
- longitude: 0,
344
- distance: 6.7
251
+ var NO_VALUE = Symbol("no value");
252
+ var _parents, _cachedLastSuccessfulCalculation, _cachedLatestGenerationCalculation, _getParents, getParents_fn, _cacheDerive, cacheDerive_fn;
253
+ var TwistyPropDerived = class extends TwistyPropParent {
254
+ constructor(parents, userVisibleErrorTracker) {
255
+ super();
256
+ this.userVisibleErrorTracker = userVisibleErrorTracker;
257
+ __privateAdd(this, _getParents);
258
+ __privateAdd(this, _cacheDerive);
259
+ __privateAdd(this, _parents, void 0);
260
+ __privateAdd(this, _cachedLastSuccessfulCalculation, null);
261
+ __privateAdd(this, _cachedLatestGenerationCalculation, null);
262
+ __privateSet(this, _parents, parents);
263
+ for (const parent of Object.values(parents)) {
264
+ parent.addChild(this);
265
+ }
266
+ }
267
+ async get() {
268
+ const generation = this.lastSourceGeneration;
269
+ if (__privateGet(this, _cachedLatestGenerationCalculation)?.generation === generation) {
270
+ return __privateGet(this, _cachedLatestGenerationCalculation).output;
271
+ }
272
+ const latestGenerationCalculation = {
273
+ generation,
274
+ output: __privateMethod(this, _cacheDerive, cacheDerive_fn).call(this, __privateMethod(this, _getParents, getParents_fn).call(this), generation, __privateGet(this, _cachedLastSuccessfulCalculation))
275
+ };
276
+ __privateSet(this, _cachedLatestGenerationCalculation, latestGenerationCalculation);
277
+ this.userVisibleErrorTracker?.reset();
278
+ return latestGenerationCalculation.output;
279
+ }
345
280
  };
346
- var pyraminxCameraOrbitCoordinates = {
347
- latitude: 26.56505117707799,
348
- longitude: 0,
349
- distance: 6
281
+ _parents = new WeakMap();
282
+ _cachedLastSuccessfulCalculation = new WeakMap();
283
+ _cachedLatestGenerationCalculation = new WeakMap();
284
+ _getParents = new WeakSet();
285
+ getParents_fn = async function() {
286
+ const inputValuePromises = {};
287
+ for (const [key, parent] of Object.entries(__privateGet(this, _parents))) {
288
+ inputValuePromises[key] = parent.get();
289
+ }
290
+ const inputs = {};
291
+ for (const key in __privateGet(this, _parents)) {
292
+ inputs[key] = await inputValuePromises[key];
293
+ }
294
+ return inputs;
350
295
  };
351
- var pyraminxLookAt = new Vector3(0, 1 / 6, 0);
352
- function defaultCameraOrbitCoordinates(puzzleID, strategy) {
353
- if (puzzleID[1] === "x") {
354
- if (strategy === "Cube3D") {
355
- return cubeCube3DCameraOrbitCoordinates;
356
- } else {
357
- return cubePG3DCameraOrbitCoordinates;
358
- }
359
- } else {
360
- switch (puzzleID) {
361
- case "megaminx":
362
- case "gigaminx":
363
- return megaminxCameraOrbitCoordinates;
364
- case "pyraminx":
365
- case "master_tetraminx":
366
- return pyraminxCameraOrbitCoordinates;
367
- case "skewb":
368
- return cubePG3DCameraOrbitCoordinates;
369
- default:
370
- return centeredCameraOrbitCoordinates;
296
+ _cacheDerive = new WeakSet();
297
+ cacheDerive_fn = async function(inputsPromise, generation, cachedLatestGenerationCalculation = null) {
298
+ const inputs = await inputsPromise;
299
+ const cache = (output) => {
300
+ __privateSet(this, _cachedLastSuccessfulCalculation, {
301
+ inputs,
302
+ output: Promise.resolve(output),
303
+ generation
304
+ });
305
+ return output;
306
+ };
307
+ if (!cachedLatestGenerationCalculation) {
308
+ return cache(await this.derive(inputs));
309
+ }
310
+ const cachedInputs = cachedLatestGenerationCalculation.inputs;
311
+ for (const key in __privateGet(this, _parents)) {
312
+ const parent = __privateGet(this, _parents)[key];
313
+ if (!parent.canReuse(inputs[key], cachedInputs[key])) {
314
+ return cache(await this.derive(inputs));
371
315
  }
372
316
  }
373
- }
374
- var setupToLocations = {
375
- start: true,
376
- end: true
317
+ return cachedLatestGenerationCalculation.output;
377
318
  };
378
- var visualizationFormats = {
379
- "3D": true,
380
- "2D": true,
381
- "experimental-2D-LL": true,
382
- "PG3D": true
383
- };
384
- var backgroundThemes = {
385
- checkered: true,
386
- none: true
319
+ var _disconnectionFunctions;
320
+ var FreshListenerManager = class {
321
+ constructor() {
322
+ __privateAdd(this, _disconnectionFunctions, []);
323
+ }
324
+ addListener(prop, listener) {
325
+ let disconnected = false;
326
+ const wrappedListener = (value) => {
327
+ if (disconnected) {
328
+ return;
329
+ }
330
+ listener(value);
331
+ };
332
+ prop.addFreshListener(wrappedListener);
333
+ __privateGet(this, _disconnectionFunctions).push(() => {
334
+ prop.removeFreshListener(wrappedListener);
335
+ disconnected = true;
336
+ });
337
+ }
338
+ addMultiListener(props, listener) {
339
+ let disconnected = false;
340
+ const wrappedListener = async (_) => {
341
+ if (disconnected) {
342
+ return;
343
+ }
344
+ const promises = props.map((prop) => prop.get());
345
+ const values = await Promise.all(promises);
346
+ listener(values);
347
+ };
348
+ for (const prop of props) {
349
+ prop.addFreshListener(wrappedListener);
350
+ }
351
+ __privateGet(this, _disconnectionFunctions).push(() => {
352
+ for (const prop of props) {
353
+ prop.removeFreshListener(wrappedListener);
354
+ }
355
+ disconnected = true;
356
+ });
357
+ }
358
+ disconnect() {
359
+ for (const disconnectionFunction of __privateGet(this, _disconnectionFunctions)) {
360
+ disconnectionFunction();
361
+ }
362
+ }
387
363
  };
364
+ _disconnectionFunctions = new WeakMap();
365
+
366
+ // src/cubing/twisty/model/props/puzzle/display/HintFaceletProp.ts
388
367
  var hintFaceletStyles = {
389
368
  floating: true,
390
369
  none: true
391
370
  };
371
+ var HintFaceletProp = class extends SimpleTwistyPropSource {
372
+ getDefaultValue() {
373
+ return "auto";
374
+ }
375
+ };
376
+
377
+ // src/cubing/twisty/model/props/puzzle/display/StickeringProp.ts
392
378
  var experimentalStickerings = {
393
379
  "full": true,
394
380
  "centers-only": true,
@@ -432,88 +418,21 @@ var experimentalStickerings = {
432
418
  "experimental-global-custom-1": true,
433
419
  "experimental-global-custom-2": true
434
420
  };
435
- var controlsLocations = {
436
- "bottom-row": true,
437
- "none": true
438
- };
439
- var puzzleIDs = {
440
- "3x3x3": true,
441
- "custom": true,
442
- "2x2x2": true,
443
- "4x4x4": true,
444
- "5x5x5": true,
445
- "6x6x6": true,
446
- "7x7x7": true,
447
- "40x40x40": true,
448
- "megaminx": true,
449
- "pyraminx": true,
450
- "square1": true,
451
- "clock": true,
452
- "skewb": true,
453
- "fto": true,
454
- "gigaminx": true,
455
- "master_tetraminx": true
456
- };
457
- var viewerLinkPages = {
458
- twizzle: true,
459
- none: true
460
- };
461
- var cameraLatitudeLimits = {
462
- auto: true,
463
- none: true
464
- };
465
- var twistyPlayerAttributeMap = {
466
- "alg": "alg",
467
- "experimental-setup-alg": "experimentalSetupAlg",
468
- "experimental-setup-anchor": "experimentalSetupAnchor",
469
- "puzzle": "puzzle",
470
- "visualization": "visualization",
471
- "hint-facelets": "hintFacelets",
472
- "experimental-stickering": "experimentalStickering",
473
- "background": "background",
474
- "control-panel": "controlPanel",
475
- "back-view": "backView",
476
- "experimental-camera-latitude": "experimentalCameraLatitude",
477
- "experimental-camera-longitude": "experimentalCameraLongitude",
478
- "experimental-camera-latitude-limits": "experimentalCameraLatitudeLimits",
479
- "viewer-link": "viewerLink"
480
- };
481
- var TwistyPlayerConfig = class {
482
- constructor(twistyPlayer, initialValues) {
483
- this.twistyPlayer = twistyPlayer;
484
- this.attributes = {
485
- "alg": new AlgAttribute(initialValues.alg),
486
- "experimental-setup-alg": new AlgAttribute(initialValues.experimentalSetupAlg),
487
- "experimental-setup-anchor": new StringEnumAttribute(setupToLocations, initialValues.experimentalSetupAnchor),
488
- "puzzle": new StringEnumAttribute(puzzleIDs, initialValues.puzzle),
489
- "visualization": new StringEnumAttribute(visualizationFormats, initialValues.visualization),
490
- "hint-facelets": new StringEnumAttribute(hintFaceletStyles, initialValues.hintFacelets),
491
- "experimental-stickering": new StringEnumAttribute(experimentalStickerings, initialValues.experimentalStickering),
492
- "background": new StringEnumAttribute(backgroundThemes, initialValues.background),
493
- "control-panel": new StringEnumAttribute(controlsLocations, initialValues.controlPanel),
494
- "back-view": new StringEnumAttribute(backViewLayouts, initialValues["backView"]),
495
- "experimental-camera-latitude": new RangedFloatAttribute(null, -90, 90, initialValues["experimentalCameraLatitude"]),
496
- "experimental-camera-longitude": new RangedFloatAttribute(null, -180, 180, initialValues["experimentalCameraLongitude"]),
497
- "experimental-camera-latitude-limits": new StringEnumAttribute(cameraLatitudeLimits, initialValues["experimentalCameraLatitudeLimits"]),
498
- "viewer-link": new StringEnumAttribute(viewerLinkPages, initialValues.viewerLink)
499
- };
500
- }
501
- static get observedAttributes() {
502
- return Object.keys(twistyPlayerAttributeMap);
503
- }
504
- attributeChangedCallback(attributeName, oldValue, newValue) {
505
- const managedAttribute = this.attributes[attributeName];
506
- if (managedAttribute) {
507
- if (oldValue !== null && managedAttribute.string !== oldValue) {
508
- console.warn("Attribute out of sync!", attributeName, managedAttribute.string, oldValue);
509
- }
510
- managedAttribute.setString(newValue);
511
- const propertyName = twistyPlayerAttributeMap[attributeName];
512
- this.twistyPlayer[propertyName] = managedAttribute.value;
513
- }
421
+ var StickeringProp = class extends SimpleTwistyPropSource {
422
+ getDefaultValue() {
423
+ return "full";
514
424
  }
515
425
  };
516
426
 
427
+ // src/cubing/twisty/controllers/easing.ts
428
+ function smootherStep(x) {
429
+ return x * x * x * (10 - x * (15 - 6 * x));
430
+ }
431
+
432
+ // src/cubing/twisty/views/3D/TAU.ts
433
+ var TAU = Math.PI * 2;
434
+ var DEGREES_PER_RADIAN = 360 / TAU;
435
+
517
436
  // src/cubing/twisty/views/3D/puzzles/Cube3D.ts
518
437
  var svgLoader = new TextureLoader();
519
438
  var ignoredMaterial = new MeshBasicMaterial({
@@ -578,12 +497,12 @@ var AxisInfo = class {
578
497
  }
579
498
  };
580
499
  var axesInfo = [
581
- new AxisInfo(new Vector32(0, 1, 0), new Euler(-TAU / 4, 0, 0), 16777215, 14540253, 1.25),
582
- new AxisInfo(new Vector32(-1, 0, 0), new Euler(0, -TAU / 4, 0), 16746496, 8930304, 1),
583
- new AxisInfo(new Vector32(0, 0, 1), new Euler(0, 0, 0), 65280, 34816, 1),
584
- new AxisInfo(new Vector32(1, 0, 0), new Euler(0, TAU / 4, 0), 16711680, 6684672, 1),
585
- new AxisInfo(new Vector32(0, 0, -1), new Euler(0, TAU / 2, 0), 255, 136, 0.75, { hintColor: 17663, hintDimColor: 8840 }),
586
- new AxisInfo(new Vector32(0, -1, 0), new Euler(TAU / 4, 0, 0), 16776960, 8947712, 1.25)
500
+ new AxisInfo(new Vector3(0, 1, 0), new Euler(-TAU / 4, 0, 0), 16777215, 14540253, 1.25),
501
+ new AxisInfo(new Vector3(-1, 0, 0), new Euler(0, -TAU / 4, 0), 16746496, 8930304, 1),
502
+ new AxisInfo(new Vector3(0, 0, 1), new Euler(0, 0, 0), 65280, 34816, 1),
503
+ new AxisInfo(new Vector3(1, 0, 0), new Euler(0, TAU / 4, 0), 16711680, 6684672, 1),
504
+ new AxisInfo(new Vector3(0, 0, -1), new Euler(0, TAU / 2, 0), 255, 136, 0.75, { hintColor: 17663, hintDimColor: 8840 }),
505
+ new AxisInfo(new Vector3(0, -1, 0), new Euler(TAU / 4, 0, 0), 16776960, 8947712, 1.25)
587
506
  ];
588
507
  var face = {
589
508
  U: 0,
@@ -664,18 +583,18 @@ function t(v, t4) {
664
583
  return new Quaternion().setFromAxisAngle(v, TAU * t4 / 4);
665
584
  }
666
585
  var r = {
667
- O: new Vector32(0, 0, 0),
668
- U: new Vector32(0, -1, 0),
669
- L: new Vector32(1, 0, 0),
670
- F: new Vector32(0, 0, -1),
671
- R: new Vector32(-1, 0, 0),
672
- B: new Vector32(0, 0, 1),
673
- D: new Vector32(0, 1, 0)
586
+ O: new Vector3(0, 0, 0),
587
+ U: new Vector3(0, -1, 0),
588
+ L: new Vector3(1, 0, 0),
589
+ F: new Vector3(0, 0, -1),
590
+ R: new Vector3(-1, 0, 0),
591
+ B: new Vector3(0, 0, 1),
592
+ D: new Vector3(0, 1, 0)
674
593
  };
675
594
  var firstPiecePosition = {
676
- EDGES: new Vector32(0, 1, 1),
677
- CORNERS: new Vector32(1, 1, 1),
678
- CENTERS: new Vector32(0, 1, 0)
595
+ EDGES: new Vector3(0, 1, 1),
596
+ CORNERS: new Vector3(1, 1, 1),
597
+ CENTERS: new Vector3(0, 1, 0)
679
598
  };
680
599
  var orientationRotation = {
681
600
  EDGES: [0, 1].map((i) => new Matrix4().makeRotationAxis(firstPiecePosition.EDGES.clone().normalize(), -i * TAU / 2)),
@@ -880,7 +799,7 @@ function sharedStickerGeometry() {
880
799
  return sharedStickerGeometryCache ?? (sharedStickerGeometryCache = newStickerGeometry());
881
800
  }
882
801
  var Cube3D = class extends Object3D {
883
- constructor(def, cursor, scheduleRenderCallback, options = {}) {
802
+ constructor(def, scheduleRenderCallback, options = {}) {
884
803
  super();
885
804
  this.def = def;
886
805
  this.scheduleRenderCallback = scheduleRenderCallback;
@@ -918,7 +837,6 @@ var Cube3D = class extends Object3D {
918
837
  if (this.options.experimentalStickering) {
919
838
  this.setStickering(this.options.experimentalStickering);
920
839
  }
921
- cursor?.addPositionListener(this);
922
840
  }
923
841
  setSprite(texture) {
924
842
  this.sprite = texture;
@@ -1142,7 +1060,7 @@ import {
1142
1060
  Mesh as Mesh2,
1143
1061
  MeshBasicMaterial as MeshBasicMaterial2,
1144
1062
  Object3D as Object3D2,
1145
- Vector3 as Vector33
1063
+ Vector3 as Vector32
1146
1064
  } from "three";
1147
1065
  var foundationMaterial = new MeshBasicMaterial2({
1148
1066
  side: DoubleSide2,
@@ -1434,7 +1352,7 @@ var StickerDef = class {
1434
1352
  }
1435
1353
  };
1436
1354
  var HitPlaneDef = class {
1437
- constructor(hitface, tm) {
1355
+ constructor(hitface, tm, stickerDat) {
1438
1356
  this.cubie = new Group2();
1439
1357
  const coords = hitface.coords;
1440
1358
  const filler = new Filler(coords.length / 3 - 2, tm);
@@ -1446,35 +1364,38 @@ var HitPlaneDef = class {
1446
1364
  this.geo = new BufferGeometry2();
1447
1365
  filler.setAttributes(this.geo);
1448
1366
  const obj = new Mesh2(this.geo, invisMaterial);
1449
- obj.userData.name = hitface.name;
1367
+ obj.userData.quantumMove = stickerDat.notationMapper.notationToExternal(new Move(hitface.name));
1450
1368
  this.cubie.scale.setScalar(0.99);
1451
1369
  this.cubie.add(obj);
1452
1370
  }
1453
1371
  };
1454
1372
  var AxisInfo2 = class {
1455
1373
  constructor(axisDat) {
1456
- const vec = axisDat[0];
1457
- this.axis = new Vector33(vec[0], vec[1], vec[2]);
1458
- this.order = axisDat[2];
1374
+ const vec = axisDat.coordinates;
1375
+ this.axis = new Vector32(vec[0], vec[1], vec[2]);
1376
+ this.order = axisDat.order;
1459
1377
  }
1460
1378
  };
1461
1379
  var DEFAULT_COLOR_FRACTION = 0.71;
1462
1380
  var PG_SCALE = 0.5;
1463
- var _pendingStickeringUpdate;
1381
+ var _pendingStickeringUpdate, _cachedKPuzzle, _kpuzzle, kpuzzle_get, _isValidMove, isValidMove_fn;
1464
1382
  var PG3D = class extends Object3D2 {
1465
- constructor(cursor, scheduleRenderCallback, definition, pgdat, showFoundation = false, showHintStickers = false, hintStickerHeightScale = 1, params = {}) {
1383
+ constructor(scheduleRenderCallback, definition, stickerDat, enableFoundationOpt = false, enableHintStickersOpt = false, hintStickerHeightScale = 1, params = {}) {
1466
1384
  super();
1467
1385
  this.scheduleRenderCallback = scheduleRenderCallback;
1468
1386
  this.definition = definition;
1469
- this.pgdat = pgdat;
1470
- this.showFoundation = showFoundation;
1471
- this.showHintStickers = showHintStickers;
1387
+ this.stickerDat = stickerDat;
1472
1388
  this.params = params;
1389
+ __privateAdd(this, _kpuzzle);
1390
+ __privateAdd(this, _isValidMove);
1473
1391
  this.stickerTargets = [];
1474
1392
  this.controlTargets = [];
1475
1393
  this.textured = false;
1394
+ this.showHintStickers = false;
1395
+ this.showFoundations = false;
1476
1396
  __privateAdd(this, _pendingStickeringUpdate, false);
1477
- if (pgdat.stickers.length === 0) {
1397
+ __privateAdd(this, _cachedKPuzzle, void 0);
1398
+ if (stickerDat.stickers.length === 0) {
1478
1399
  throw Error("Reuse of stickerdat from pg; please don't do that.");
1479
1400
  }
1480
1401
  this.hintMaterial = new MeshBasicMaterial2({
@@ -1486,27 +1407,27 @@ var PG3D = class extends Object3D2 {
1486
1407
  this.stickerMaterial = basicStickerMaterial;
1487
1408
  this.stickerMaterialDisposable = false;
1488
1409
  this.axesInfo = {};
1489
- const axesDef = this.pgdat.axis;
1410
+ const axesDef = this.stickerDat.axis;
1490
1411
  for (const axis of axesDef) {
1491
- this.axesInfo[axis[1]] = new AxisInfo2(axis);
1412
+ this.axesInfo[axis.quantumMove.family] = new AxisInfo2(axis);
1492
1413
  }
1493
- const stickers = this.pgdat.stickers;
1414
+ const stickers = this.stickerDat.stickers;
1494
1415
  this.stickers = {};
1495
1416
  this.materialArray1 = new Array(8);
1496
1417
  this.materialArray2 = new Array(8);
1497
- this.enableFoundation(showFoundation);
1498
- this.updateMaterialArrays();
1418
+ this.showFoundation(enableFoundationOpt);
1419
+ enableFoundationOpt = true;
1499
1420
  let triangleCount = 0;
1500
1421
  const multiplier = 3;
1501
1422
  for (const sticker of stickers) {
1502
1423
  const sides = sticker.coords.length / 3;
1503
1424
  triangleCount += multiplier * (sides - 2);
1504
1425
  }
1505
- const filler = new Filler(triangleCount, pgdat.textureMapper);
1426
+ const filler = new Filler(triangleCount, stickerDat.textureMapper);
1506
1427
  const black = 0;
1507
1428
  const normals = [];
1508
1429
  let totArea = 0;
1509
- for (const f of pgdat.faces) {
1430
+ for (const f of stickerDat.faces) {
1510
1431
  normals.push(normal(f.coords));
1511
1432
  totArea += polyarea(f.coords);
1512
1433
  }
@@ -1535,18 +1456,22 @@ var PG3D = class extends Object3D2 {
1535
1456
  const stickerdef = new StickerDef(filler, sticker, trim, options);
1536
1457
  this.stickers[orbit][ori][ord] = stickerdef;
1537
1458
  }
1459
+ this.showHintStickers = enableHintStickersOpt;
1460
+ enableHintStickersOpt = true;
1538
1461
  for (const sticker of stickers) {
1539
1462
  const orbit = sticker.orbit;
1540
1463
  const ord = sticker.ord;
1541
1464
  const ori = sticker.ori;
1542
- this.stickers[orbit][ori][ord].addHint(filler, sticker, showHintStickers, hintStickerHeightScale, trim, normals[sticker.face]);
1465
+ this.stickers[orbit][ori][ord].addHint(filler, sticker, enableHintStickersOpt, hintStickerHeightScale, trim, normals[sticker.face]);
1543
1466
  }
1544
1467
  this.foundationBound = filler.ipos;
1545
1468
  for (const sticker of stickers) {
1546
1469
  const orbit = sticker.orbit;
1547
1470
  const ord = sticker.ord;
1548
1471
  const ori = sticker.ori;
1549
- this.stickers[orbit][ori][ord].addFoundation(filler, sticker, black);
1472
+ if (enableFoundationOpt) {
1473
+ this.stickers[orbit][ori][ord].addFoundation(filler, sticker, black);
1474
+ }
1550
1475
  }
1551
1476
  const fixedGeo = new BufferGeometry2();
1552
1477
  filler.setAttributes(fixedGeo);
@@ -1557,19 +1482,19 @@ var PG3D = class extends Object3D2 {
1557
1482
  const obj2 = new Mesh2(fixedGeo, this.materialArray2);
1558
1483
  obj2.scale.set(PG_SCALE, PG_SCALE, PG_SCALE);
1559
1484
  this.add(obj2);
1560
- const hitfaces = this.pgdat.faces;
1485
+ const hitfaces = this.stickerDat.faces;
1561
1486
  this.movingObj = obj2;
1562
1487
  this.fixedGeo = fixedGeo;
1563
1488
  this.filler = filler;
1564
1489
  for (const hitface of hitfaces) {
1565
- const facedef = new HitPlaneDef(hitface, pgdat.textureMapper);
1490
+ const facedef = new HitPlaneDef(hitface, stickerDat.textureMapper, this.stickerDat);
1566
1491
  facedef.cubie.scale.set(PG_SCALE, PG_SCALE, PG_SCALE);
1567
1492
  this.add(facedef.cubie);
1568
1493
  this.controlTargets.push(facedef.cubie.children[0]);
1569
1494
  }
1570
1495
  filler.saveOriginalColors();
1571
- cursor.addPositionListener(this);
1572
- pgdat.stickers = [];
1496
+ stickerDat.stickers = [];
1497
+ this.updateMaterialArrays();
1573
1498
  }
1574
1499
  dispose() {
1575
1500
  if (this.fixedGeo) {
@@ -1592,6 +1517,42 @@ var PG3D = class extends Object3D2 {
1592
1517
  experimentalGetControlTargets() {
1593
1518
  return this.controlTargets;
1594
1519
  }
1520
+ getClosestMoveToAxis(point, transformations) {
1521
+ let closestMove = null;
1522
+ let closestMoveDotProduct = 0;
1523
+ let modify = (m) => m;
1524
+ switch (transformations.depth) {
1525
+ case "secondSlice":
1526
+ modify = (m) => m.modified({ innerLayer: 2 });
1527
+ break;
1528
+ case "rotation":
1529
+ modify = (m) => m.modified({ family: m.family + "v" });
1530
+ break;
1531
+ }
1532
+ for (const axis of this.stickerDat.axis) {
1533
+ const product = point.dot(new Vector32(...axis.coordinates));
1534
+ if (product > closestMoveDotProduct) {
1535
+ const modified = this.stickerDat.notationMapper.notationToExternal(modify(axis.quantumMove));
1536
+ if (!modified) {
1537
+ continue;
1538
+ }
1539
+ if (__privateMethod(this, _isValidMove, isValidMove_fn).call(this, modified)) {
1540
+ closestMoveDotProduct = product;
1541
+ closestMove = modified;
1542
+ }
1543
+ }
1544
+ }
1545
+ if (!closestMove) {
1546
+ return null;
1547
+ }
1548
+ if (transformations.invert) {
1549
+ closestMove = closestMove.invert();
1550
+ }
1551
+ __privateGet(this, _kpuzzle, kpuzzle_get).reset();
1552
+ __privateGet(this, _kpuzzle, kpuzzle_get).applyMove(closestMove);
1553
+ const order = transformationOrder(this.definition, __privateGet(this, _kpuzzle, kpuzzle_get).state);
1554
+ return { move: closestMove, order };
1555
+ }
1595
1556
  experimentalSetAppearance(appearance) {
1596
1557
  this.params.appearance = appearance;
1597
1558
  for (const orbitName in this.definition.orbits) {
@@ -1655,8 +1616,8 @@ var PG3D = class extends Object3D2 {
1655
1616
  let vismods = 0;
1656
1617
  for (const moveProgress of p.movesInProgress) {
1657
1618
  const externalMove = moveProgress.move;
1658
- const unswizzled = this.pgdat.unswizzle(externalMove);
1659
- const move = this.pgdat.notationMapper.notationToInternal(externalMove);
1619
+ const unswizzled = this.stickerDat.unswizzle(externalMove);
1620
+ const move = this.stickerDat.notationMapper.notationToInternal(externalMove);
1660
1621
  if (move === null) {
1661
1622
  throw Error("Bad blockmove " + externalMove.family);
1662
1623
  }
@@ -1733,9 +1694,8 @@ var PG3D = class extends Object3D2 {
1733
1694
  ease(fraction) {
1734
1695
  return smootherStep(fraction);
1735
1696
  }
1736
- enableHintFacelets(v) {
1697
+ showHintFacelets(v) {
1737
1698
  this.showHintStickers = v;
1738
- this.updateMaterialArrays();
1739
1699
  }
1740
1700
  updateMaterialArrays() {
1741
1701
  for (let i = 0; i < 8; i++) {
@@ -1751,7 +1711,7 @@ var PG3D = class extends Object3D2 {
1751
1711
  this.materialArray1[2] = invisMaterial;
1752
1712
  this.materialArray2[3] = invisMaterial;
1753
1713
  }
1754
- if (this.showFoundation) {
1714
+ if (this.showFoundations) {
1755
1715
  this.materialArray1[6] = foundationMaterial;
1756
1716
  this.materialArray2[7] = foundationMaterial;
1757
1717
  } else {
@@ -1759,15 +1719,15 @@ var PG3D = class extends Object3D2 {
1759
1719
  this.materialArray2[7] = invisMaterial;
1760
1720
  }
1761
1721
  }
1762
- enableFoundation(v) {
1763
- this.showFoundation = v;
1764
- this.updateMaterialArrays();
1722
+ showFoundation(v) {
1723
+ this.showFoundations = v;
1765
1724
  }
1766
1725
  setHintStickerOpacity(v) {
1767
1726
  if (this.hintMaterialDisposable) {
1768
1727
  this.hintMaterial.dispose();
1769
1728
  this.hintMaterialDisposable = false;
1770
1729
  }
1730
+ console.log("hint sticker opacity " + v);
1771
1731
  if (v === 0) {
1772
1732
  this.hintMaterial = invisMaterial;
1773
1733
  } else if (v === 1) {
@@ -1783,10 +1743,10 @@ var PG3D = class extends Object3D2 {
1783
1743
  }
1784
1744
  experimentalUpdateOptions(options) {
1785
1745
  if (options.hintFacelets !== void 0) {
1786
- this.enableHintFacelets(options.hintFacelets !== "none");
1746
+ this.showHintFacelets(options.hintFacelets !== "none");
1787
1747
  }
1788
1748
  if (options.showFoundation !== void 0) {
1789
- this.enableFoundation(options.showFoundation);
1749
+ this.showFoundation(options.showFoundation);
1790
1750
  }
1791
1751
  if (options.hintStickerOpacity !== void 0) {
1792
1752
  this.setHintStickerOpacity(options.hintStickerOpacity);
@@ -1795,6 +1755,7 @@ var PG3D = class extends Object3D2 {
1795
1755
  if (this.lastPos) {
1796
1756
  this.onPositionChange(this.lastPos);
1797
1757
  }
1758
+ this.updateMaterialArrays();
1798
1759
  this.scheduleRenderCallback();
1799
1760
  }
1800
1761
  adduvs() {
@@ -1864,595 +1825,23 @@ var PG3D = class extends Object3D2 {
1864
1825
  }
1865
1826
  };
1866
1827
  _pendingStickeringUpdate = new WeakMap();
1867
-
1868
- // src/cubing/twisty/old/dom/viewers/Twisty3DCanvas.ts
1869
- import { PerspectiveCamera, Vector3 as Vector35, WebGLRenderer } from "three";
1870
-
1871
- // src/cubing/twisty/old/animation/RenderScheduler.ts
1872
- var RenderScheduler = class {
1873
- constructor(callback) {
1874
- this.callback = callback;
1875
- this.animFrameID = null;
1876
- this.animFrame = this.animFrameWrapper.bind(this);
1877
- }
1878
- requestAnimFrame() {
1879
- if (!this.animFrameID) {
1880
- this.animFrameID = requestAnimationFrame(this.animFrame);
1881
- }
1882
- }
1883
- cancelAnimFrame() {
1884
- if (this.animFrameID) {
1885
- cancelAnimationFrame(this.animFrameID);
1886
- this.animFrameID = 0;
1887
- }
1888
- }
1889
- animFrameWrapper(timestamp) {
1890
- this.animFrameID = 0;
1891
- this.callback(timestamp);
1892
- }
1828
+ _cachedKPuzzle = new WeakMap();
1829
+ _kpuzzle = new WeakSet();
1830
+ kpuzzle_get = function() {
1831
+ return __privateGet(this, _cachedKPuzzle) ?? __privateSet(this, _cachedKPuzzle, new KPuzzle(this.definition));
1893
1832
  };
1894
-
1895
- // src/cubing/twisty/old/dom/viewers/canvas.ts
1896
- var globalPixelRatioOverride = null;
1897
- function pixelRatio() {
1898
- return globalPixelRatioOverride ?? (devicePixelRatio || 1);
1899
- }
1900
-
1901
- // src/cubing/twisty/old/dom/viewers/Twisty3DCanvas.css.ts
1902
- var twisty3DCanvasCSS = new CSSSource(`
1903
- :host {
1904
- width: 384px;
1905
- height: 256px;
1906
- display: grid;
1907
- }
1908
-
1909
- .wrapper {
1910
- width: 100%;
1911
- height: 100%;
1912
- display: grid;
1913
- overflow: hidden;
1914
- }
1915
-
1916
- /* TODO: This is due to stats hack. Replace with \`canvas\`. */
1917
- .wrapper > canvas {
1918
- max-width: 100%;
1919
- max-height: 100%;
1920
- }
1921
-
1922
- .wrapper.invisible {
1923
- opacity: 0;
1924
- }
1925
- `);
1926
-
1927
- // src/cubing/twisty/old/dom/viewers/TwistyOrbitControls.ts
1928
- import { Spherical, Vector3 as Vector34 } from "three";
1929
- var EPSILON = 1e-8;
1930
- var INERTIA_DEFAULT = true;
1931
- var LATITUDE_LIMITS_DEFAULT = "auto";
1932
- var INERTIA_DURATION_MS = 500;
1933
- var INERTIA_TIMEOUT_MS = 50;
1934
- var VERTICAL_MOVEMENT_BASE_SCALE = 0.75;
1935
- function momentumScale(progress) {
1936
- return (Math.exp(1 - progress) - (1 - progress)) / (1 - Math.E) + 1;
1937
- }
1938
- var Inertia = class {
1939
- constructor(startTimestamp, momentumX, momentumY, callback) {
1940
- this.startTimestamp = startTimestamp;
1941
- this.momentumX = momentumX;
1942
- this.momentumY = momentumY;
1943
- this.callback = callback;
1944
- this.scheduler = new RenderScheduler(this.render.bind(this));
1945
- this.scheduler.requestAnimFrame();
1946
- this.lastTimestamp = startTimestamp;
1947
- }
1948
- render(now) {
1949
- const progressBefore = (this.lastTimestamp - this.startTimestamp) / INERTIA_DURATION_MS;
1950
- const progressAfter = Math.min(1, (now - this.startTimestamp) / INERTIA_DURATION_MS);
1951
- if (progressBefore === 0 && progressAfter > INERTIA_TIMEOUT_MS / INERTIA_DURATION_MS) {
1952
- return;
1953
- }
1954
- const delta = momentumScale(progressAfter) - momentumScale(progressBefore);
1955
- this.callback(this.momentumX * delta * 1e3, this.momentumY * delta * 1e3);
1956
- if (progressAfter < 1) {
1957
- this.scheduler.requestAnimFrame();
1958
- }
1959
- this.lastTimestamp = now;
1960
- }
1961
- };
1962
- var _spherical, _lookAt, _adjust, adjust_fn, _acceptPropagation, _propagateSpherical, propagateSpherical_fn;
1963
- var TwistyOrbitControls = class {
1964
- constructor(camera, canvas, scheduleRender) {
1965
- this.camera = camera;
1966
- this.canvas = canvas;
1967
- this.scheduleRender = scheduleRender;
1968
- __privateAdd(this, _adjust);
1969
- __privateAdd(this, _propagateSpherical);
1970
- __privateAdd(this, _spherical, new Spherical());
1971
- __privateAdd(this, _lookAt, new Vector34(0, 0, 0));
1972
- this.experimentalInertia = INERTIA_DEFAULT;
1973
- this.experimentalLatitudeLimits = LATITUDE_LIMITS_DEFAULT;
1974
- this.lastTouchClientX = 0;
1975
- this.lastTouchClientY = 0;
1976
- this.currentTouchID = null;
1977
- this.onMoveBound = this.onMove.bind(this);
1978
- this.onMouseMoveBound = this.onMouseMove.bind(this);
1979
- this.onMouseEndBound = this.onMouseEnd.bind(this);
1980
- this.onTouchMoveBound = this.onTouchMove.bind(this);
1981
- this.onTouchEndBound = this.onTouchEnd.bind(this);
1982
- this.lastTouchTimestamp = 0;
1983
- this.lastTouchMoveMomentumX = 0;
1984
- this.lastTouchMoveMomentumY = 0;
1985
- this.lastMouseTimestamp = 0;
1986
- this.lastMouseMoveMomentumX = 0;
1987
- this.lastMouseMoveMomentumY = 0;
1988
- this.experimentalHasBeenMoved = false;
1989
- __privateAdd(this, _acceptPropagation, true);
1990
- __privateGet(this, _spherical).setFromVector3(camera.position);
1991
- __privateMethod(this, _propagateSpherical, propagateSpherical_fn).call(this);
1992
- canvas.addEventListener("mousedown", this.onMouseStart.bind(this));
1993
- canvas.addEventListener("touchstart", this.onTouchStart.bind(this));
1994
- }
1995
- lookAt(v) {
1996
- if (!__privateGet(this, _acceptPropagation)) {
1997
- return;
1998
- }
1999
- __privateSet(this, _lookAt, v);
2000
- __privateSet(this, _acceptPropagation, false);
2001
- __privateMethod(this, _adjust, adjust_fn).call(this);
2002
- this.scheduleRender();
2003
- try {
2004
- if (this.mirrorControls) {
2005
- this.mirrorControls.lookAt(v);
2006
- }
2007
- } finally {
2008
- __privateSet(this, _acceptPropagation, true);
2009
- }
2010
- }
2011
- set latitude(newLatitude) {
2012
- __privateGet(this, _spherical).phi = (90 - newLatitude) / DEGREES_PER_RADIAN;
2013
- __privateMethod(this, _propagateSpherical, propagateSpherical_fn).call(this);
2014
- }
2015
- get latitude() {
2016
- return 90 - __privateGet(this, _spherical).phi * DEGREES_PER_RADIAN;
2017
- }
2018
- set longitude(newLongitude) {
2019
- __privateGet(this, _spherical).theta = newLongitude / DEGREES_PER_RADIAN;
2020
- __privateMethod(this, _propagateSpherical, propagateSpherical_fn).call(this);
2021
- }
2022
- get longitude() {
2023
- return __privateGet(this, _spherical).theta * DEGREES_PER_RADIAN;
2024
- }
2025
- set distance(newDistance) {
2026
- __privateGet(this, _spherical).radius = newDistance;
2027
- __privateMethod(this, _propagateSpherical, propagateSpherical_fn).call(this);
2028
- }
2029
- get distance() {
2030
- return __privateGet(this, _spherical).radius;
2031
- }
2032
- get orbitCoordinates() {
2033
- return {
2034
- latitude: this.latitude,
2035
- longitude: this.longitude,
2036
- distance: this.distance
2037
- };
2038
- }
2039
- set orbitCoordinates(orbitCoordinates) {
2040
- this.latitude = orbitCoordinates.latitude;
2041
- this.longitude = orbitCoordinates.longitude;
2042
- this.distance = orbitCoordinates.distance;
2043
- }
2044
- temperMovement(f) {
2045
- return Math.sign(f) * Math.log(Math.abs(f * 10) + 1) / 6;
2046
- }
2047
- onMouseStart(e) {
2048
- this.experimentalHasBeenMoved = true;
2049
- window.addEventListener("mousemove", this.onMouseMoveBound);
2050
- window.addEventListener("mouseup", this.onMouseEndBound);
2051
- this.onStart(e);
2052
- this.lastMouseTimestamp = e.timeStamp;
2053
- }
2054
- onMouseMove(e) {
2055
- if (e.buttons === 0) {
2056
- this.onMouseEnd(e);
2057
- return;
2058
- }
2059
- if (e.movementX === 0 && e.movementY === 0) {
2060
- console.log("short-circuit mouse!");
2061
- return;
2062
- }
2063
- const minDim = Math.min(this.canvas.offsetWidth, this.canvas.offsetHeight);
2064
- const movementX = this.temperMovement(e.movementX / minDim);
2065
- const movementY = this.temperMovement(e.movementY / minDim * VERTICAL_MOVEMENT_BASE_SCALE);
2066
- this.onMove(movementX, movementY);
2067
- const deltaMs = e.timeStamp - this.lastMouseTimestamp;
2068
- if (deltaMs > 0) {
2069
- this.lastMouseMoveMomentumX = movementX / deltaMs;
2070
- this.lastMouseMoveMomentumY = movementY / deltaMs;
2071
- this.lastMouseTimestamp = e.timeStamp;
2072
- }
2073
- }
2074
- onMouseEnd(e) {
2075
- window.removeEventListener("mousemove", this.onMouseMoveBound);
2076
- window.removeEventListener("mouseup", this.onMouseEndBound);
2077
- this.onEnd(e);
2078
- if (this.experimentalInertia) {
2079
- new Inertia(this.lastMouseTimestamp, this.lastMouseMoveMomentumX, this.lastMouseMoveMomentumY, this.onMoveBound);
2080
- }
2081
- }
2082
- onTouchStart(e) {
2083
- this.experimentalHasBeenMoved = true;
2084
- if (this.currentTouchID === null) {
2085
- if (e.touches[0].clientX === 0 && e.touches[0].clientY === 0) {
2086
- console.log("short-circuit touch!");
2087
- return;
2088
- }
2089
- this.currentTouchID = e.changedTouches[0].identifier;
2090
- this.lastTouchClientX = e.touches[0].clientX;
2091
- this.lastTouchClientY = e.touches[0].clientY;
2092
- window.addEventListener("touchmove", this.onTouchMoveBound);
2093
- window.addEventListener("touchend", this.onTouchEndBound);
2094
- window.addEventListener("touchcancel", this.onTouchEndBound);
2095
- this.onStart(e);
2096
- this.lastTouchTimestamp = e.timeStamp;
2097
- }
2098
- }
2099
- onTouchMove(e) {
2100
- for (let i = 0; i < e.changedTouches.length; i++) {
2101
- const touch = e.changedTouches[i];
2102
- if (touch.identifier === this.currentTouchID) {
2103
- const minDim = Math.min(this.canvas.offsetWidth, this.canvas.offsetHeight);
2104
- const movementX = this.temperMovement((touch.clientX - this.lastTouchClientX) / minDim);
2105
- const movementY = this.temperMovement((touch.clientY - this.lastTouchClientY) / minDim * VERTICAL_MOVEMENT_BASE_SCALE);
2106
- this.onMove(movementX, movementY);
2107
- this.lastTouchClientX = touch.clientX;
2108
- this.lastTouchClientY = touch.clientY;
2109
- const deltaMs = e.timeStamp - this.lastTouchTimestamp;
2110
- if (deltaMs > 0) {
2111
- this.lastTouchMoveMomentumX = movementX / deltaMs;
2112
- this.lastTouchMoveMomentumY = movementY / deltaMs;
2113
- this.lastTouchTimestamp = e.timeStamp;
2114
- }
2115
- }
2116
- }
2117
- }
2118
- onTouchEnd(e) {
2119
- for (let i = 0; i < e.changedTouches.length; i++) {
2120
- const touch = e.changedTouches[i];
2121
- if (touch.identifier === this.currentTouchID) {
2122
- this.currentTouchID = null;
2123
- window.removeEventListener("touchmove", this.onTouchMoveBound);
2124
- window.removeEventListener("touchend", this.onTouchEndBound);
2125
- window.removeEventListener("touchcancel", this.onTouchEndBound);
2126
- this.onEnd(e);
2127
- }
2128
- }
2129
- if (this.experimentalInertia) {
2130
- new Inertia(this.lastTouchTimestamp, this.lastTouchMoveMomentumX, this.lastTouchMoveMomentumY, this.onMoveBound);
2131
- }
2132
- }
2133
- onStart(e) {
2134
- e.preventDefault();
2135
- }
2136
- onMove(movementX, movementY) {
2137
- const newSpherical = new Spherical();
2138
- newSpherical.copy(__privateGet(this, _spherical));
2139
- newSpherical.theta += -2 * movementX;
2140
- newSpherical.phi += -2 * movementY;
2141
- if (this.experimentalLatitudeLimits !== "none") {
2142
- newSpherical.phi = Math.max(newSpherical.phi, Math.PI * 0.3);
2143
- newSpherical.phi = Math.min(newSpherical.phi, Math.PI * 0.7);
2144
- } else {
2145
- newSpherical.phi = Math.max(newSpherical.phi, EPSILON);
2146
- newSpherical.phi = Math.min(newSpherical.phi, Math.PI - EPSILON);
2147
- }
2148
- if (isNaN(newSpherical.theta) || newSpherical.theta === Infinity || newSpherical.theta === -Infinity) {
2149
- return;
2150
- }
2151
- if (isNaN(newSpherical.phi) || newSpherical.phi === Infinity || newSpherical.phi === -Infinity) {
2152
- return;
2153
- }
2154
- __privateSet(this, _spherical, newSpherical);
2155
- __privateMethod(this, _propagateSpherical, propagateSpherical_fn).call(this);
2156
- }
2157
- onEnd(e) {
2158
- e.preventDefault();
2159
- }
2160
- setMirror(m) {
2161
- this.mirrorControls = m;
2162
- }
2163
- updateMirroredCamera(orbitCoordinates) {
2164
- if (__privateGet(this, _acceptPropagation)) {
2165
- this.latitude = -orbitCoordinates.latitude;
2166
- this.longitude = orbitCoordinates.longitude + 180;
2167
- this.distance = orbitCoordinates.distance;
2168
- __privateMethod(this, _adjust, adjust_fn).call(this);
2169
- this.scheduleRender();
2170
- }
2171
- }
2172
- };
2173
- _spherical = new WeakMap();
2174
- _lookAt = new WeakMap();
2175
- _adjust = new WeakSet();
2176
- adjust_fn = function() {
2177
- __privateGet(this, _spherical).makeSafe();
2178
- this.camera.position.setFromSpherical(__privateGet(this, _spherical));
2179
- this.camera.lookAt(__privateGet(this, _lookAt));
2180
- };
2181
- _acceptPropagation = new WeakMap();
2182
- _propagateSpherical = new WeakSet();
2183
- propagateSpherical_fn = function() {
2184
- __privateSet(this, _acceptPropagation, false);
1833
+ _isValidMove = new WeakSet();
1834
+ isValidMove_fn = function(move) {
2185
1835
  try {
2186
- __privateMethod(this, _adjust, adjust_fn).call(this);
2187
- this.scheduleRender();
2188
- this.mirrorControls?.updateMirroredCamera({
2189
- latitude: this.latitude,
2190
- longitude: this.longitude,
2191
- distance: this.distance
2192
- });
2193
- } finally {
2194
- __privateSet(this, _acceptPropagation, true);
2195
- }
2196
- };
2197
-
2198
- // src/cubing/vendor/three/examples/jsm/libs/stats.modified.module.ts
2199
- var performance = globalThis.performance;
2200
- var Stats = class {
2201
- constructor() {
2202
- this.mode = 0;
2203
- this.dom = document.createElement("div");
2204
- this.beginTime = (performance || Date).now();
2205
- this.prevTime = this.beginTime;
2206
- this.frames = 0;
2207
- this.fpsPanel = this.addPanel(new StatsPanel("FPS", "#0ff", "#002"));
2208
- this.msPanel = this.addPanel(new StatsPanel("MS", "#0f0", "#020"));
2209
- this.memPanel = performance?.memory ? this.addPanel(new StatsPanel("MB", "#f08", "#201")) : null;
2210
- this.REVISION = 16;
2211
- this.dom.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000";
2212
- this.dom.addEventListener("click", (event) => {
2213
- event.preventDefault();
2214
- this.showPanel(++this.mode % this.dom.children.length);
2215
- }, false);
2216
- this.showPanel(0);
2217
- }
2218
- addPanel(panel) {
2219
- this.dom.appendChild(panel.dom);
2220
- return panel;
2221
- }
2222
- showPanel(id) {
2223
- for (let i = 0; i < this.dom.children.length; i++) {
2224
- this.dom.children[i].style.display = i === id ? "block" : "none";
2225
- }
2226
- this.mode = id;
2227
- }
2228
- begin() {
2229
- this.beginTime = (performance || Date).now();
2230
- }
2231
- end() {
2232
- this.frames++;
2233
- const time = (performance || Date).now();
2234
- this.msPanel.update(time - this.beginTime, 200);
2235
- if (time >= this.prevTime + 1e3) {
2236
- this.fpsPanel.update(this.frames * 1e3 / (time - this.prevTime), 100);
2237
- this.prevTime = time;
2238
- this.frames = 0;
2239
- if (this.memPanel) {
2240
- const memory = performance.memory;
2241
- this.memPanel.update(memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576);
2242
- }
2243
- }
2244
- return time;
2245
- }
2246
- update() {
2247
- this.beginTime = this.end();
2248
- }
2249
- };
2250
- var PR = Math.round(globalThis?.window?.devicePixelRatio ?? 1);
2251
- var WIDTH = 80 * PR;
2252
- var HEIGHT = 48 * PR;
2253
- var TEXT_X = 3 * PR;
2254
- var TEXT_Y = 2 * PR;
2255
- var GRAPH_X = 3 * PR;
2256
- var GRAPH_Y = 15 * PR;
2257
- var GRAPH_WIDTH = 74 * PR;
2258
- var GRAPH_HEIGHT = 30 * PR;
2259
- var StatsPanel = class {
2260
- constructor(name, fg, bg) {
2261
- this.name = name;
2262
- this.fg = fg;
2263
- this.bg = bg;
2264
- this.min = Infinity;
2265
- this.max = 0;
2266
- this.dom = document.createElement("canvas");
2267
- this.context = this.dom.getContext("2d");
2268
- this.dom.width = WIDTH;
2269
- this.dom.height = HEIGHT;
2270
- this.dom.style.cssText = "width:80px;height:48px";
2271
- this.context.font = `bold ${9 * PR}px Helvetica,Arial,sans-serif`;
2272
- this.context.textBaseline = "top";
2273
- this.context.fillStyle = bg;
2274
- this.context.fillRect(0, 0, WIDTH, HEIGHT);
2275
- this.context.fillStyle = fg;
2276
- this.context.fillText(name, TEXT_X, TEXT_Y);
2277
- this.context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
2278
- this.context.fillStyle = bg;
2279
- this.context.globalAlpha = 0.9;
2280
- this.context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
2281
- }
2282
- update(value, maxValue) {
2283
- this.min = Math.min(this.min, value);
2284
- this.max = Math.max(this.max, value);
2285
- this.context.fillStyle = this.bg;
2286
- this.context.globalAlpha = 1;
2287
- this.context.fillRect(0, 0, WIDTH, GRAPH_Y);
2288
- this.context.fillStyle = this.fg;
2289
- this.context.fillText(Math.round(value) + " " + this.name + " (" + Math.round(this.min) + "-" + Math.round(this.max) + ")", TEXT_X, TEXT_Y);
2290
- this.context.drawImage(this.dom, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT);
2291
- this.context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT);
2292
- this.context.fillStyle = this.bg;
2293
- this.context.globalAlpha = 0.9;
2294
- this.context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, Math.round((1 - value / maxValue) * GRAPH_HEIGHT));
1836
+ __privateGet(this, _kpuzzle, kpuzzle_get).applyMove(move);
1837
+ return true;
1838
+ } catch (_) {
1839
+ return false;
2295
1840
  }
2296
1841
  };
2297
1842
 
2298
- // src/cubing/twisty/old/dom/viewers/Twisty3DCanvas.ts
2299
- var SHOW_STATS = false;
2300
- function experimentalShowRenderStats(show) {
2301
- SHOW_STATS = show;
2302
- }
2303
- var shareAllNewRenderers = false;
2304
- var sharedRenderer = null;
2305
- function newRenderer() {
2306
- return new WebGLRenderer({
2307
- antialias: true,
2308
- alpha: true
2309
- });
2310
- }
2311
- function newSharedRenderer() {
2312
- return sharedRenderer ?? (sharedRenderer = newRenderer());
2313
- }
2314
- var _invisible, _onRenderFinish, _resize, resize_fn;
2315
- var Twisty3DCanvas = class extends ManagedCustomElement {
2316
- constructor(scene, options = {}) {
2317
- super();
2318
- __privateAdd(this, _resize);
2319
- this.legacyExperimentalShift = 0;
2320
- this.scheduler = new RenderScheduler(this.render.bind(this));
2321
- this.resizePending = false;
2322
- this.stats = null;
2323
- __privateAdd(this, _invisible, false);
2324
- __privateAdd(this, _onRenderFinish, null);
2325
- this.addCSS(twisty3DCanvasCSS);
2326
- this.scene = scene;
2327
- this.scene?.addRenderTarget(this);
2328
- if (SHOW_STATS) {
2329
- this.stats = new Stats();
2330
- this.stats.dom.style.position = "absolute";
2331
- this.addElement(this.stats.dom);
2332
- }
2333
- this.rendererIsShared = shareAllNewRenderers;
2334
- this.renderer = this.rendererIsShared ? newSharedRenderer() : newRenderer();
2335
- this.canvas = this.rendererIsShared ? document.createElement("canvas") : this.renderer.domElement;
2336
- this.canvas2DContext = this.canvas.getContext("2d");
2337
- this.addElement(this.canvas);
2338
- this.camera = new PerspectiveCamera(20, 1, 0.1, 20);
2339
- this.camera.position.copy(new Vector35(2, 4, 4));
2340
- this.orbitControls = new TwistyOrbitControls(this.camera, this.canvas, this.scheduleRender.bind(this));
2341
- if (options.orbitCoordinates) {
2342
- this.orbitControls.latitude = options.orbitCoordinates.latitude * (options.negateCameraPosition ? -1 : 1);
2343
- }
2344
- if (options.orbitCoordinates) {
2345
- this.orbitControls.longitude = options.orbitCoordinates.longitude + (options.negateCameraPosition ? 180 : 0);
2346
- }
2347
- if (options.orbitCoordinates) {
2348
- this.orbitControls.distance = options.orbitCoordinates.distance;
2349
- }
2350
- this.camera.lookAt(new Vector35(0, 0, 0));
2351
- const observer = new ResizeObserver(this.onResize.bind(this));
2352
- observer.observe(this.contentWrapper);
2353
- }
2354
- setMirror(partner) {
2355
- this.orbitControls.setMirror(partner.orbitControls);
2356
- partner.orbitControls.setMirror(this.orbitControls);
2357
- }
2358
- experimentalSetLatitudeLimits(limits) {
2359
- this.orbitControls.experimentalLatitudeLimits = limits;
2360
- }
2361
- connectedCallback() {
2362
- __privateMethod(this, _resize, resize_fn).call(this);
2363
- this.render();
2364
- }
2365
- scheduleRender() {
2366
- this.scheduler.requestAnimFrame();
2367
- }
2368
- makeInvisibleUntilRender() {
2369
- this.contentWrapper.classList.add("invisible");
2370
- __privateSet(this, _invisible, true);
2371
- }
2372
- experimentalSetOnRenderFinish(f) {
2373
- __privateSet(this, _onRenderFinish, f);
2374
- }
2375
- render() {
2376
- this.stats?.begin();
2377
- this.scheduler.cancelAnimFrame();
2378
- if (this.resizePending) {
2379
- __privateMethod(this, _resize, resize_fn).call(this);
2380
- }
2381
- if (this.rendererIsShared) {
2382
- this.renderer.setSize(this.canvas.width, this.canvas.height, false);
2383
- this.canvas2DContext.clearRect(0, 0, this.canvas.width, this.canvas.height);
2384
- }
2385
- if (this.scene) {
2386
- this.renderer.render(this.scene, this.camera);
2387
- }
2388
- if (this.rendererIsShared) {
2389
- this.canvas2DContext.drawImage(this.renderer.domElement, 0, 0);
2390
- }
2391
- if (__privateGet(this, _invisible)) {
2392
- this.contentWrapper.classList.remove("invisible");
2393
- }
2394
- this.stats?.end();
2395
- if (__privateGet(this, _onRenderFinish)) {
2396
- __privateGet(this, _onRenderFinish).call(this);
2397
- }
2398
- }
2399
- onResize() {
2400
- this.resizePending = true;
2401
- this.scheduleRender();
2402
- }
2403
- renderToDataURL(options = {}) {
2404
- __privateMethod(this, _resize, resize_fn).call(this, options.minWidth, options.minHeight);
2405
- this.render();
2406
- let url;
2407
- if (!options.squareCrop || this.canvas.width === this.canvas.height) {
2408
- url = this.canvas.toDataURL();
2409
- } else {
2410
- const tempCanvas = document.createElement("canvas");
2411
- const squareSize = Math.min(this.canvas.width, this.canvas.height);
2412
- tempCanvas.width = squareSize;
2413
- tempCanvas.height = squareSize;
2414
- const tempCtx = tempCanvas.getContext("2d");
2415
- tempCtx.drawImage(this.canvas, -(this.canvas.width - squareSize) / 2, -(this.canvas.height - squareSize) / 2);
2416
- url = tempCanvas.toDataURL();
2417
- }
2418
- __privateMethod(this, _resize, resize_fn).call(this);
2419
- return url;
2420
- }
2421
- };
2422
- _invisible = new WeakMap();
2423
- _onRenderFinish = new WeakMap();
2424
- _resize = new WeakSet();
2425
- resize_fn = function(minWidth = 0, minHeight = 0) {
2426
- this.resizePending = false;
2427
- const w = Math.max(this.contentWrapper.clientWidth, minWidth);
2428
- const h = Math.max(this.contentWrapper.clientHeight, minHeight);
2429
- let off = 0;
2430
- if (this.legacyExperimentalShift > 0) {
2431
- off = Math.max(0, Math.floor((w - h) * 0.5));
2432
- } else if (this.legacyExperimentalShift < 0) {
2433
- off = -Math.max(0, Math.floor((w - h) * 0.5));
2434
- }
2435
- let yoff = 0;
2436
- let excess = 0;
2437
- if (h > w) {
2438
- excess = h - w;
2439
- yoff = -Math.floor(0.5 * excess);
2440
- }
2441
- this.camera.aspect = w / h;
2442
- this.camera.setViewOffset(w, h - excess, off, yoff, w, h);
2443
- this.camera.updateProjectionMatrix();
2444
- if (this.rendererIsShared) {
2445
- this.canvas.width = w * pixelRatio();
2446
- this.canvas.height = h * pixelRatio();
2447
- this.canvas.style.width = w.toString();
2448
- this.canvas.style.height = w.toString();
2449
- } else {
2450
- this.renderer.setPixelRatio(pixelRatio());
2451
- this.renderer.setSize(w, h, true);
2452
- }
2453
- this.scheduleRender();
2454
- };
2455
- customElementsShim.define("twisty-3d-canvas", Twisty3DCanvas);
1843
+ // src/cubing/twisty/heavy-code-imports/dynamic-entries/3d.ts
1844
+ import * as T3I from "three";
2456
1845
 
2457
1846
  // src/cubing/twisty/views/3D/Twisty3DScene.ts
2458
1847
  import { Scene as ThreeScene } from "three";
@@ -2486,27 +1875,34 @@ var Twisty3DScene = class extends ThreeScene {
2486
1875
  }
2487
1876
  };
2488
1877
 
1878
+ // src/cubing/twisty/heavy-code-imports/dynamic-entries/3d.ts
1879
+ async function cube3DShim(options) {
1880
+ const renderCallbackShim = () => {
1881
+ };
1882
+ return new Cube3D(await cube3x3x3.def(), renderCallbackShim, options);
1883
+ }
1884
+ async function pg3dShim(puzzleLoader, hintFacelets) {
1885
+ const renderCallbackShim = () => {
1886
+ };
1887
+ return new PG3D(renderCallbackShim, await puzzleLoader.def(), (await puzzleLoader.pg()).get3d(), true, hintFacelets === "floating");
1888
+ }
1889
+
2489
1890
  export {
2490
- RenderScheduler,
2491
- ClassListManager,
2492
- HTMLElementShim,
2493
- customElementsShim,
2494
- CSSSource,
2495
- ManagedCustomElement,
1891
+ StaleDropper,
1892
+ from,
1893
+ TwistyPropSource,
1894
+ SimpleTwistyPropSource,
1895
+ NO_VALUE,
1896
+ TwistyPropDerived,
1897
+ FreshListenerManager,
1898
+ HintFaceletProp,
1899
+ StickeringProp,
2496
1900
  DEGREES_PER_RADIAN,
2497
- twistyViewerWrapperCSS,
2498
- TwistyViewerWrapper,
2499
- pyraminxLookAt,
2500
- defaultCameraOrbitCoordinates,
2501
- controlsLocations,
2502
- TwistyPlayerConfig,
2503
1901
  Cube3D,
2504
1902
  PG3D,
2505
- pixelRatio,
2506
- twisty3DCanvasCSS,
2507
- Stats,
2508
- experimentalShowRenderStats,
2509
- Twisty3DCanvas,
2510
- Twisty3DScene
1903
+ Twisty3DScene,
1904
+ cube3DShim,
1905
+ pg3dShim,
1906
+ T3I
2511
1907
  };
2512
- //# sourceMappingURL=chunk-5DN4DAAX.js.map
1908
+ //# sourceMappingURL=chunk-DLN5QS4V.js.map