cubing 0.28.0 → 0.28.4

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 (107) hide show
  1. package/README.md +3 -1
  2. package/dist/esm/alg/index.js +4 -4
  3. package/dist/esm/bluetooth/index.js +222 -86
  4. package/dist/esm/bluetooth/index.js.map +3 -3
  5. package/dist/esm/{chunk-F4WWCPVE.js → chunk-2IZUSAXQ.js} +2 -2
  6. package/dist/esm/{chunk-F4WWCPVE.js.map → chunk-2IZUSAXQ.js.map} +1 -1
  7. package/dist/esm/{chunk-KBOIUBUE.js → chunk-DGJ3VGQO.js} +28 -12
  8. package/dist/esm/{chunk-KBOIUBUE.js.map → chunk-DGJ3VGQO.js.map} +1 -1
  9. package/dist/esm/{chunk-NJPSC7SH.js → chunk-GW4FGG42.js} +8 -4
  10. package/dist/esm/{chunk-NJPSC7SH.js.map → chunk-GW4FGG42.js.map} +1 -1
  11. package/dist/esm/{chunk-4KIZAW2Z.js → chunk-LSCTPPWV.js} +22 -8
  12. package/dist/esm/{chunk-4KIZAW2Z.js.map → chunk-LSCTPPWV.js.map} +1 -1
  13. package/dist/esm/{chunk-GXZIBFSN.js → chunk-NI7U4XAZ.js} +380 -242
  14. package/dist/esm/chunk-NI7U4XAZ.js.map +7 -0
  15. package/dist/esm/{chunk-GVPTO3OF.js → chunk-OX6O2ZO5.js} +1 -1
  16. package/dist/esm/{chunk-GVPTO3OF.js.map → chunk-OX6O2ZO5.js.map} +1 -1
  17. package/dist/esm/{chunk-LTPPXK6F.js → chunk-PYWGREIP.js} +44 -13
  18. package/dist/esm/chunk-PYWGREIP.js.map +7 -0
  19. package/dist/esm/{chunk-JAGHV77R.js → chunk-QDVCP6G7.js} +179 -76
  20. package/dist/esm/chunk-QDVCP6G7.js.map +7 -0
  21. package/dist/esm/chunk-RQGVI4ZL.js +1137 -0
  22. package/dist/esm/chunk-RQGVI4ZL.js.map +7 -0
  23. package/dist/esm/{chunk-MGJA5U5O.js → chunk-SBZRVSPK.js} +1 -12
  24. package/dist/esm/{chunk-MGJA5U5O.js.map → chunk-SBZRVSPK.js.map} +0 -0
  25. package/dist/esm/{chunk-V55YSWJY.js → chunk-WXCNEGW3.js} +10 -4
  26. package/dist/esm/{chunk-V55YSWJY.js.map → chunk-WXCNEGW3.js.map} +1 -1
  27. package/dist/esm/{chunk-UP6RBLG2.js → chunk-XU5ILFX5.js} +137 -66
  28. package/dist/esm/{chunk-UP6RBLG2.js.map → chunk-XU5ILFX5.js.map} +3 -3
  29. package/dist/esm/{chunk-4V4RM3YJ.js → chunk-Y22I7F7D.js} +21 -12
  30. package/dist/esm/{chunk-4V4RM3YJ.js.map → chunk-Y22I7F7D.js.map} +2 -2
  31. package/dist/esm/{chunk-ALBEW4DJ.js → chunk-ZB3P5AZN.js} +1 -1
  32. package/dist/esm/{chunk-ALBEW4DJ.js.map → chunk-ZB3P5AZN.js.map} +1 -1
  33. package/dist/esm/{chunk-47SWOA3X.js → chunk-ZNAYJGVL.js} +2 -2
  34. package/dist/esm/{chunk-47SWOA3X.js.map → chunk-ZNAYJGVL.js.map} +1 -1
  35. package/dist/esm/kpuzzle/index.js +3 -3
  36. package/dist/esm/notation/index.js +3 -3
  37. package/dist/esm/protocol/index.js +5 -5
  38. package/dist/esm/puzzle-geometry/index.js +4570 -15
  39. package/dist/esm/puzzle-geometry/index.js.map +4 -4
  40. package/dist/esm/puzzles/index.js +5 -5
  41. package/dist/esm/{puzzles-dynamic-3x3x3-NB2PEZTV.js → puzzles-dynamic-3x3x3-KIG5A6QR.js} +2 -2
  42. package/dist/esm/{puzzles-dynamic-3x3x3-NB2PEZTV.js.map → puzzles-dynamic-3x3x3-KIG5A6QR.js.map} +0 -0
  43. package/dist/esm/puzzles-dynamic-4x4x4-PEDAPUZK.js +126 -0
  44. package/dist/esm/puzzles-dynamic-4x4x4-PEDAPUZK.js.map +7 -0
  45. package/dist/esm/{puzzles-dynamic-side-events-WZI4Y3N6.js → puzzles-dynamic-side-events-5C7LMBWX.js} +2 -2
  46. package/dist/esm/{puzzles-dynamic-side-events-WZI4Y3N6.js.map → puzzles-dynamic-side-events-5C7LMBWX.js.map} +0 -0
  47. package/dist/esm/{puzzles-dynamic-unofficial-FUG3JBMH.js → puzzles-dynamic-unofficial-WWJ4NJMX.js} +2 -2
  48. package/dist/esm/{puzzles-dynamic-unofficial-FUG3JBMH.js.map → puzzles-dynamic-unofficial-WWJ4NJMX.js.map} +0 -0
  49. package/dist/esm/scramble/index.js +5 -5
  50. package/dist/esm/search/index.js +10 -10
  51. package/dist/esm/{search-dynamic-sgs-side-events-ZTOWSMQT.js → search-dynamic-sgs-side-events-MZN22QGN.js} +37 -21
  52. package/dist/esm/search-dynamic-sgs-side-events-MZN22QGN.js.map +7 -0
  53. package/dist/esm/{search-dynamic-sgs-unofficial-V6HZTLGM.js → search-dynamic-sgs-unofficial-AHPCH5XJ.js} +35 -14
  54. package/dist/esm/{search-dynamic-sgs-unofficial-V6HZTLGM.js.map → search-dynamic-sgs-unofficial-AHPCH5XJ.js.map} +2 -2
  55. package/dist/esm/{search-dynamic-solve-3x3x3-K42IWMQV.js → search-dynamic-solve-3x3x3-7XZTYQMO.js} +795 -142
  56. package/dist/esm/{search-dynamic-solve-3x3x3-K42IWMQV.js.map → search-dynamic-solve-3x3x3-7XZTYQMO.js.map} +1 -1
  57. package/dist/esm/{search-dynamic-solve-4x4x4-YH6SB2WB.js → search-dynamic-solve-4x4x4-IBS66QTP.js} +135 -29
  58. package/dist/esm/{search-dynamic-solve-4x4x4-YH6SB2WB.js.map → search-dynamic-solve-4x4x4-IBS66QTP.js.map} +1 -1
  59. package/dist/esm/{search-dynamic-solve-fto-O6UXF7EC.js → search-dynamic-solve-fto-4LI23P6K.js} +253 -69
  60. package/dist/esm/{search-dynamic-solve-fto-O6UXF7EC.js.map → search-dynamic-solve-fto-4LI23P6K.js.map} +2 -2
  61. package/dist/esm/{search-dynamic-solve-kilominx-ZPEOK4DY.js → search-dynamic-solve-kilominx-3HEVQ4MC.js} +32 -8
  62. package/dist/esm/{search-dynamic-solve-kilominx-ZPEOK4DY.js.map → search-dynamic-solve-kilominx-3HEVQ4MC.js.map} +2 -2
  63. package/dist/esm/{search-dynamic-solve-master_tetraminx-3RKD3IAN.js → search-dynamic-solve-master_tetraminx-UB32C7MM.js} +111 -42
  64. package/dist/esm/{search-dynamic-solve-master_tetraminx-3RKD3IAN.js.map → search-dynamic-solve-master_tetraminx-UB32C7MM.js.map} +2 -2
  65. package/dist/esm/{search-dynamic-solve-sq1-WIJEGVLP.js → search-dynamic-solve-sq1-HA72TYF2.js} +54 -9
  66. package/dist/esm/{search-dynamic-solve-sq1-WIJEGVLP.js.map → search-dynamic-solve-sq1-HA72TYF2.js.map} +2 -2
  67. package/dist/esm/search-worker-inside-generated-string-AMEXYCKK.js +3886 -0
  68. package/dist/esm/search-worker-inside-generated-string-AMEXYCKK.js.map +7 -0
  69. package/dist/esm/{search-worker-js-entry-3VKCL3RX.js → search-worker-js-entry-HUD3PWTB.js} +147 -53
  70. package/dist/esm/{search-worker-js-entry-3VKCL3RX.js.map → search-worker-js-entry-HUD3PWTB.js.map} +2 -2
  71. package/dist/esm/{search-worker-ts-entry-J3TDBCMV.js → search-worker-ts-entry-HER6WT5D.js} +5 -5
  72. package/dist/esm/{search-worker-ts-entry-J3TDBCMV.js.map → search-worker-ts-entry-HER6WT5D.js.map} +1 -1
  73. package/dist/esm/stream/index.js +12 -8
  74. package/dist/esm/stream/index.js.map +1 -1
  75. package/dist/esm/twisty/index.js +1164 -1513
  76. package/dist/esm/twisty/index.js.map +4 -4
  77. package/dist/esm/{twisty-dynamic-3d-UQJETF7O.js → twisty-dynamic-3d-NJUXK7KI.js} +358 -146
  78. package/dist/esm/twisty-dynamic-3d-NJUXK7KI.js.map +7 -0
  79. package/dist/types/{Alg-e2a80975.d.ts → Alg-137fb0d5.d.ts} +19 -16
  80. package/dist/types/{KState-a2f0e651.d.ts → KState-a73111d7.d.ts} +1 -9
  81. package/dist/types/{TwizzleLink-cd0fa192.d.ts → TwizzleLink-bef52ecd.d.ts} +47 -13
  82. package/dist/types/alg/index.d.ts +7 -6
  83. package/dist/types/bluetooth/index.d.ts +4 -4
  84. package/dist/types/{bluetooth-puzzle-3670a6a1.d.ts → bluetooth-puzzle-8a678993.d.ts} +9 -9
  85. package/dist/types/kpuzzle/index.d.ts +2 -2
  86. package/dist/types/notation/index.d.ts +1 -1
  87. package/dist/types/{outside-0ce1b145.d.ts → outside-e55f28a0.d.ts} +2 -2
  88. package/dist/types/{parse-ec97687c.d.ts → parseAlg-a28f7568.d.ts} +1 -1
  89. package/dist/types/protocol/index.d.ts +2 -2
  90. package/dist/types/puzzle-geometry/index.d.ts +3 -3
  91. package/dist/types/puzzles/index.d.ts +5 -5
  92. package/dist/types/scramble/index.d.ts +3 -3
  93. package/dist/types/search/index.d.ts +3 -3
  94. package/dist/types/stream/index.d.ts +5 -5
  95. package/dist/types/twisty/index.d.ts +13 -6
  96. package/package.json +43 -40
  97. package/dist/esm/chunk-7BLWQDZX.js +0 -342
  98. package/dist/esm/chunk-7BLWQDZX.js.map +0 -7
  99. package/dist/esm/chunk-GXZIBFSN.js.map +0 -7
  100. package/dist/esm/chunk-JAGHV77R.js.map +0 -7
  101. package/dist/esm/chunk-LTPPXK6F.js.map +0 -7
  102. package/dist/esm/chunk-ROGN5SXC.js +0 -4386
  103. package/dist/esm/chunk-ROGN5SXC.js.map +0 -7
  104. package/dist/esm/search-dynamic-sgs-side-events-ZTOWSMQT.js.map +0 -7
  105. package/dist/esm/search-worker-inside-generated-string-T43JGYSP.js +0 -3768
  106. package/dist/esm/search-worker-inside-generated-string-T43JGYSP.js.map +0 -7
  107. package/dist/esm/twisty-dynamic-3d-UQJETF7O.js.map +0 -7
@@ -2,9 +2,8 @@ import {
2
2
  __privateAdd,
3
3
  __privateGet,
4
4
  __privateMethod,
5
- __privateSet,
6
- __privateWrapper
7
- } from "./chunk-MGJA5U5O.js";
5
+ __privateSet
6
+ } from "./chunk-SBZRVSPK.js";
8
7
 
9
8
  // src/cubing/alg/common.ts
10
9
  var writeAlgDebugField = false;
@@ -65,13 +64,10 @@ var MAX_INT_DESCRIPTION = "2^31 - 1";
65
64
  var MIN_INT = -2147483648;
66
65
 
67
66
  // src/cubing/alg/AlgBuilder.ts
68
- var _algNode;
69
67
  var AlgBuilder = class {
70
- constructor() {
71
- __privateAdd(this, _algNode, []);
72
- }
68
+ #algNode = [];
73
69
  push(u) {
74
- __privateGet(this, _algNode).push(u);
70
+ this.#algNode.push(u);
75
71
  }
76
72
  experimentalPushAlg(alg) {
77
73
  for (const u of alg.childAlgNodes()) {
@@ -79,16 +75,15 @@ var AlgBuilder = class {
79
75
  }
80
76
  }
81
77
  experimentalNumAlgNodes() {
82
- return __privateGet(this, _algNode).length;
78
+ return this.#algNode.length;
83
79
  }
84
80
  toAlg() {
85
- return new Alg(__privateGet(this, _algNode));
81
+ return new Alg(this.#algNode);
86
82
  }
87
83
  reset() {
88
- __privateSet(this, _algNode, []);
84
+ this.#algNode = [];
89
85
  }
90
86
  };
91
- _algNode = new WeakMap();
92
87
 
93
88
  // src/cubing/alg/debug.ts
94
89
  var algDebugGlobals = {
@@ -101,27 +96,26 @@ function setAlgDebug(options) {
101
96
  }
102
97
 
103
98
  // src/cubing/alg/alg-nodes/containers/Commutator.ts
104
- var _A, _B;
105
- var _Commutator = class extends AlgCommon {
99
+ var Commutator = class extends AlgCommon {
100
+ #A;
101
+ #B;
106
102
  constructor(aSource, bSource) {
107
103
  super();
108
- __privateAdd(this, _A, void 0);
109
- __privateAdd(this, _B, void 0);
110
- __privateSet(this, _A, experimentalEnsureAlg(aSource));
111
- __privateSet(this, _B, experimentalEnsureAlg(bSource));
104
+ this.#A = experimentalEnsureAlg(aSource);
105
+ this.#B = experimentalEnsureAlg(bSource);
112
106
  }
113
107
  get A() {
114
- return __privateGet(this, _A);
108
+ return this.#A;
115
109
  }
116
110
  get B() {
117
- return __privateGet(this, _B);
111
+ return this.#B;
118
112
  }
119
113
  isIdentical(other) {
120
- const otherAsCommutator = other.as(_Commutator);
114
+ const otherAsCommutator = other.as(Commutator);
121
115
  return !!(otherAsCommutator?.A.isIdentical(this.A) && otherAsCommutator?.B.isIdentical(this.B));
122
116
  }
123
117
  invert() {
124
- return new _Commutator(__privateGet(this, _B), __privateGet(this, _A));
118
+ return new Commutator(this.#B, this.#A);
125
119
  }
126
120
  *experimentalExpand(iterDir = 1 /* Forwards */, depth) {
127
121
  depth ?? (depth = Infinity);
@@ -129,48 +123,68 @@ var _Commutator = class extends AlgCommon {
129
123
  yield iterDir === 1 /* Forwards */ ? this : this.invert();
130
124
  } else {
131
125
  if (iterDir === 1 /* Forwards */) {
132
- yield* this.A.experimentalExpand(1 /* Forwards */, depth - 1);
133
- yield* this.B.experimentalExpand(1 /* Forwards */, depth - 1);
134
- yield* this.A.experimentalExpand(-1 /* Backwards */, depth - 1);
135
- yield* this.B.experimentalExpand(-1 /* Backwards */, depth - 1);
126
+ yield* this.A.experimentalExpand(
127
+ 1 /* Forwards */,
128
+ depth - 1
129
+ );
130
+ yield* this.B.experimentalExpand(
131
+ 1 /* Forwards */,
132
+ depth - 1
133
+ );
134
+ yield* this.A.experimentalExpand(
135
+ -1 /* Backwards */,
136
+ depth - 1
137
+ );
138
+ yield* this.B.experimentalExpand(
139
+ -1 /* Backwards */,
140
+ depth - 1
141
+ );
136
142
  } else {
137
- yield* this.B.experimentalExpand(1 /* Forwards */, depth - 1);
138
- yield* this.A.experimentalExpand(1 /* Forwards */, depth - 1);
139
- yield* this.B.experimentalExpand(-1 /* Backwards */, depth - 1);
140
- yield* this.A.experimentalExpand(-1 /* Backwards */, depth - 1);
143
+ yield* this.B.experimentalExpand(
144
+ 1 /* Forwards */,
145
+ depth - 1
146
+ );
147
+ yield* this.A.experimentalExpand(
148
+ 1 /* Forwards */,
149
+ depth - 1
150
+ );
151
+ yield* this.B.experimentalExpand(
152
+ -1 /* Backwards */,
153
+ depth - 1
154
+ );
155
+ yield* this.A.experimentalExpand(
156
+ -1 /* Backwards */,
157
+ depth - 1
158
+ );
141
159
  }
142
160
  }
143
161
  }
144
162
  toString() {
145
- return `[${__privateGet(this, _A).toString()}, ${__privateGet(this, _B).toString()}]`;
163
+ return `[${this.#A.toString()}, ${this.#B.toString()}]`;
146
164
  }
147
165
  };
148
- var Commutator = _Commutator;
149
- _A = new WeakMap();
150
- _B = new WeakMap();
151
166
 
152
167
  // src/cubing/alg/alg-nodes/containers/Conjugate.ts
153
- var _A2, _B2;
154
- var _Conjugate = class extends AlgCommon {
168
+ var Conjugate = class extends AlgCommon {
169
+ #A;
170
+ #B;
155
171
  constructor(aSource, bSource) {
156
172
  super();
157
- __privateAdd(this, _A2, void 0);
158
- __privateAdd(this, _B2, void 0);
159
- __privateSet(this, _A2, experimentalEnsureAlg(aSource));
160
- __privateSet(this, _B2, experimentalEnsureAlg(bSource));
173
+ this.#A = experimentalEnsureAlg(aSource);
174
+ this.#B = experimentalEnsureAlg(bSource);
161
175
  }
162
176
  get A() {
163
- return __privateGet(this, _A2);
177
+ return this.#A;
164
178
  }
165
179
  get B() {
166
- return __privateGet(this, _B2);
180
+ return this.#B;
167
181
  }
168
182
  isIdentical(other) {
169
- const otherAsConjugate = other.as(_Conjugate);
183
+ const otherAsConjugate = other.as(Conjugate);
170
184
  return !!(otherAsConjugate?.A.isIdentical(this.A) && otherAsConjugate?.B.isIdentical(this.B));
171
185
  }
172
186
  invert() {
173
- return new _Conjugate(__privateGet(this, _A2), __privateGet(this, _B2).invert());
187
+ return new Conjugate(this.#A, this.#B.invert());
174
188
  }
175
189
  *experimentalExpand(iterDir, depth) {
176
190
  depth ?? (depth = Infinity);
@@ -186,27 +200,23 @@ var _Conjugate = class extends AlgCommon {
186
200
  return `[${this.A}: ${this.B}]`;
187
201
  }
188
202
  };
189
- var Conjugate = _Conjugate;
190
- _A2 = new WeakMap();
191
- _B2 = new WeakMap();
192
203
 
193
204
  // src/cubing/alg/alg-nodes/leaves/LineComment.ts
194
- var _text;
195
- var _LineComment = class extends AlgCommon {
205
+ var LineComment = class extends AlgCommon {
206
+ #text;
196
207
  constructor(commentText) {
197
208
  super();
198
- __privateAdd(this, _text, void 0);
199
209
  if (commentText.includes("\n") || commentText.includes("\r")) {
200
210
  throw new Error("LineComment cannot contain newline");
201
211
  }
202
- __privateSet(this, _text, commentText);
212
+ this.#text = commentText;
203
213
  }
204
214
  get text() {
205
- return __privateGet(this, _text);
215
+ return this.#text;
206
216
  }
207
217
  isIdentical(other) {
208
218
  const otherAsLineComment = other;
209
- return other.is(_LineComment) && __privateGet(this, _text) === __privateGet(otherAsLineComment, _text);
219
+ return other.is(LineComment) && this.#text === otherAsLineComment.#text;
210
220
  }
211
221
  invert() {
212
222
  return this;
@@ -215,11 +225,9 @@ var _LineComment = class extends AlgCommon {
215
225
  yield this;
216
226
  }
217
227
  toString() {
218
- return `//${__privateGet(this, _text)}`;
228
+ return `//${this.#text}`;
219
229
  }
220
230
  };
221
- var LineComment = _LineComment;
222
- _text = new WeakMap();
223
231
 
224
232
  // src/cubing/alg/alg-nodes/leaves/Newline.ts
225
233
  var Newline = class extends AlgCommon {
@@ -254,7 +262,7 @@ var Pause = class extends AlgCommon {
254
262
  }
255
263
  };
256
264
 
257
- // src/cubing/alg/parse.ts
265
+ // src/cubing/alg/parseAlg.ts
258
266
  function parseIntWithEmptyFallback(n, emptyFallback) {
259
267
  return n ? parseInt(n) : emptyFallback;
260
268
  }
@@ -288,100 +296,124 @@ function transferCharIndex(from, to) {
288
296
  }
289
297
  return to;
290
298
  }
291
- var _input, _idx, _nissQueue;
292
299
  var AlgParser = class {
293
- constructor() {
294
- __privateAdd(this, _input, "");
295
- __privateAdd(this, _idx, 0);
296
- __privateAdd(this, _nissQueue, []);
297
- }
300
+ #input = "";
301
+ #idx = 0;
302
+ #nissQueue = [];
298
303
  parseAlg(input) {
299
- __privateSet(this, _input, input);
300
- __privateSet(this, _idx, 0);
304
+ this.#input = input;
305
+ this.#idx = 0;
301
306
  const alg = this.parseAlgWithStopping([]);
302
307
  this.mustBeAtEndOfInput();
303
308
  const algNodes = Array.from(alg.childAlgNodes());
304
- if (__privateGet(this, _nissQueue).length > 0) {
305
- for (const nissGrouping of __privateGet(this, _nissQueue).reverse()) {
309
+ if (this.#nissQueue.length > 0) {
310
+ for (const nissGrouping of this.#nissQueue.reverse()) {
306
311
  algNodes.push(nissGrouping);
307
312
  }
308
313
  }
309
- return new Alg(algNodes);
314
+ const newAlg = new Alg(algNodes);
315
+ const { startCharIndex, endCharIndex } = alg;
316
+ addCharIndices(newAlg, startCharIndex, endCharIndex);
317
+ return newAlg;
310
318
  }
311
319
  parseMove(input) {
312
- __privateSet(this, _input, input);
313
- __privateSet(this, _idx, 0);
320
+ this.#input = input;
321
+ this.#idx = 0;
314
322
  const move = this.parseMoveImpl();
315
323
  this.mustBeAtEndOfInput();
316
324
  return move;
317
325
  }
318
326
  parseQuantumMove(input) {
319
- __privateSet(this, _input, input);
320
- __privateSet(this, _idx, 0);
327
+ this.#input = input;
328
+ this.#idx = 0;
321
329
  const quantumMove = this.parseQuantumMoveImpl();
322
330
  this.mustBeAtEndOfInput();
323
331
  return quantumMove;
324
332
  }
325
333
  mustBeAtEndOfInput() {
326
- if (__privateGet(this, _idx) !== __privateGet(this, _input).length) {
334
+ if (this.#idx !== this.#input.length) {
327
335
  throw new Error("parsing unexpectedly ended early");
328
336
  }
329
337
  }
330
338
  parseAlgWithStopping(stopBefore) {
331
- let algStartIdx = __privateGet(this, _idx);
332
- let algEndIdx = __privateGet(this, _idx);
339
+ let algStartIdx = this.#idx;
340
+ let algEndIdx = this.#idx;
333
341
  const algBuilder = new AlgBuilder();
334
342
  let crowded = false;
335
343
  const mustNotBeCrowded = (idx) => {
336
344
  if (crowded) {
337
- throw new Error(`Unexpected character at index ${idx}. Are you missing a space?`);
345
+ throw new Error(
346
+ `Unexpected character at index ${idx}. Are you missing a space?`
347
+ );
338
348
  }
339
349
  };
340
350
  mainLoop:
341
- while (__privateGet(this, _idx) < __privateGet(this, _input).length) {
342
- const savedCharIndex = __privateGet(this, _idx);
343
- if (stopBefore.includes(__privateGet(this, _input)[__privateGet(this, _idx)])) {
351
+ while (this.#idx < this.#input.length) {
352
+ const savedCharIndex = this.#idx;
353
+ if (stopBefore.includes(this.#input[this.#idx])) {
344
354
  return addCharIndices(algBuilder.toAlg(), algStartIdx, algEndIdx);
345
355
  }
346
356
  if (this.tryConsumeNext(" ")) {
347
357
  crowded = false;
348
358
  if (algBuilder.experimentalNumAlgNodes() === 0) {
349
- algStartIdx = __privateGet(this, _idx);
359
+ algStartIdx = this.#idx;
350
360
  }
351
361
  continue mainLoop;
352
- } else if (MOVE_START_REGEX.test(__privateGet(this, _input)[__privateGet(this, _idx)])) {
362
+ } else if (MOVE_START_REGEX.test(this.#input[this.#idx])) {
353
363
  mustNotBeCrowded(savedCharIndex);
354
364
  const move = this.parseMoveImpl();
355
365
  algBuilder.push(move);
356
366
  crowded = true;
357
- algEndIdx = __privateGet(this, _idx);
367
+ algEndIdx = this.#idx;
358
368
  continue mainLoop;
359
369
  } else if (this.tryConsumeNext("(")) {
360
370
  mustNotBeCrowded(savedCharIndex);
361
371
  const sq1PairStartMatch = this.tryRegex(SQUARE1_PAIR_START_REGEX);
362
372
  if (sq1PairStartMatch) {
363
373
  const topAmountString = sq1PairStartMatch[1];
364
- const savedCharIndexD = __privateGet(this, _idx);
374
+ const savedCharIndexD = this.#idx;
365
375
  const sq1PairEndMatch = this.parseRegex(SQUARE1_PAIR_END_REGEX);
366
- const uMove = addCharIndices(new Move(new QuantumMove("U_SQ_"), parseInt(topAmountString)), savedCharIndex + 1, savedCharIndex + 1 + topAmountString.length);
367
- const dMove = addCharIndices(new Move(new QuantumMove("D_SQ_"), parseInt(sq1PairEndMatch[1])), savedCharIndexD, __privateGet(this, _idx) - 1);
368
- const alg = addCharIndices(new Alg([uMove, dMove]), savedCharIndex + 1, __privateGet(this, _idx) - 1);
369
- algBuilder.push(addCharIndices(new Grouping(alg), savedCharIndex, __privateGet(this, _idx)));
376
+ const uMove = addCharIndices(
377
+ new Move(new QuantumMove("U_SQ_"), parseInt(topAmountString)),
378
+ savedCharIndex + 1,
379
+ savedCharIndex + 1 + topAmountString.length
380
+ );
381
+ const dMove = addCharIndices(
382
+ new Move(new QuantumMove("D_SQ_"), parseInt(sq1PairEndMatch[1])),
383
+ savedCharIndexD,
384
+ this.#idx - 1
385
+ );
386
+ const alg = addCharIndices(
387
+ new Alg([uMove, dMove]),
388
+ savedCharIndex + 1,
389
+ this.#idx - 1
390
+ );
391
+ algBuilder.push(
392
+ addCharIndices(new Grouping(alg), savedCharIndex, this.#idx)
393
+ );
370
394
  crowded = true;
371
- algEndIdx = __privateGet(this, _idx);
395
+ algEndIdx = this.#idx;
372
396
  continue mainLoop;
373
397
  } else {
374
398
  const alg = this.parseAlgWithStopping([")"]);
375
399
  this.mustConsumeNext(")");
376
400
  const amount = this.parseAmount();
377
- algBuilder.push(addCharIndices(new Grouping(alg, amount), savedCharIndex, __privateGet(this, _idx)));
401
+ algBuilder.push(
402
+ addCharIndices(
403
+ new Grouping(alg, amount),
404
+ savedCharIndex,
405
+ this.#idx
406
+ )
407
+ );
378
408
  crowded = true;
379
- algEndIdx = __privateGet(this, _idx);
409
+ algEndIdx = this.#idx;
380
410
  continue mainLoop;
381
411
  }
382
412
  } else if (this.tryConsumeNext("^")) {
383
413
  if (!algDebugGlobals.caratNISSNotationEnabled) {
384
- throw new Error("Alg contained a carat but carat NISS notation is not enabled.");
414
+ throw new Error(
415
+ "Alg contained a carat but carat NISS notation is not enabled."
416
+ );
385
417
  }
386
418
  this.mustConsumeNext("(");
387
419
  const alg = this.parseAlgWithStopping([")"]);
@@ -390,7 +422,7 @@ var AlgParser = class {
390
422
  const placeholder = new Pause();
391
423
  grouping.experimentalNISSPlaceholder = placeholder;
392
424
  placeholder.experimentalNISSGrouping = grouping;
393
- __privateGet(this, _nissQueue).push(grouping);
425
+ this.#nissQueue.push(grouping);
394
426
  algBuilder.push(placeholder);
395
427
  } else if (this.tryConsumeNext("[")) {
396
428
  mustNotBeCrowded(savedCharIndex);
@@ -400,48 +432,58 @@ var AlgParser = class {
400
432
  this.mustConsumeNext("]");
401
433
  switch (separator) {
402
434
  case ":":
403
- algBuilder.push(addCharIndices(new Conjugate(A, B), savedCharIndex, __privateGet(this, _idx)));
435
+ algBuilder.push(
436
+ addCharIndices(new Conjugate(A, B), savedCharIndex, this.#idx)
437
+ );
404
438
  crowded = true;
405
- algEndIdx = __privateGet(this, _idx);
439
+ algEndIdx = this.#idx;
406
440
  continue mainLoop;
407
441
  case ",":
408
- algBuilder.push(addCharIndices(new Commutator(A, B), savedCharIndex, __privateGet(this, _idx)));
442
+ algBuilder.push(
443
+ addCharIndices(new Commutator(A, B), savedCharIndex, this.#idx)
444
+ );
409
445
  crowded = true;
410
- algEndIdx = __privateGet(this, _idx);
446
+ algEndIdx = this.#idx;
411
447
  continue mainLoop;
412
448
  default:
413
449
  throw new Error("unexpected parsing error");
414
450
  }
415
451
  } else if (this.tryConsumeNext("\n")) {
416
- algBuilder.push(addCharIndices(new Newline(), savedCharIndex, __privateGet(this, _idx)));
452
+ algBuilder.push(
453
+ addCharIndices(new Newline(), savedCharIndex, this.#idx)
454
+ );
417
455
  crowded = false;
418
- algEndIdx = __privateGet(this, _idx);
456
+ algEndIdx = this.#idx;
419
457
  continue mainLoop;
420
458
  } else if (this.tryConsumeNext("/")) {
421
459
  if (this.tryConsumeNext("/")) {
422
460
  mustNotBeCrowded(savedCharIndex);
423
461
  const [text] = this.parseRegex(COMMENT_TEXT_REGEX);
424
- algBuilder.push(addCharIndices(new LineComment(text), savedCharIndex, __privateGet(this, _idx)));
462
+ algBuilder.push(
463
+ addCharIndices(new LineComment(text), savedCharIndex, this.#idx)
464
+ );
425
465
  crowded = false;
426
- algEndIdx = __privateGet(this, _idx);
466
+ algEndIdx = this.#idx;
427
467
  continue mainLoop;
428
468
  } else {
429
- algBuilder.push(addCharIndices(new Move("_SLASH_"), savedCharIndex, __privateGet(this, _idx)));
469
+ algBuilder.push(
470
+ addCharIndices(new Move("_SLASH_"), savedCharIndex, this.#idx)
471
+ );
430
472
  crowded = true;
431
- algEndIdx = __privateGet(this, _idx);
473
+ algEndIdx = this.#idx;
432
474
  continue mainLoop;
433
475
  }
434
476
  } else if (this.tryConsumeNext(".")) {
435
477
  mustNotBeCrowded(savedCharIndex);
436
- algBuilder.push(addCharIndices(new Pause(), savedCharIndex, __privateGet(this, _idx)));
478
+ algBuilder.push(addCharIndices(new Pause(), savedCharIndex, this.#idx));
437
479
  crowded = true;
438
- algEndIdx = __privateGet(this, _idx);
480
+ algEndIdx = this.#idx;
439
481
  continue mainLoop;
440
482
  } else {
441
483
  throw new Error(`Unexpected character: ${this.popNext()}`);
442
484
  }
443
485
  }
444
- if (__privateGet(this, _idx) !== __privateGet(this, _input).length) {
486
+ if (this.#idx !== this.#input.length) {
445
487
  throw new Error("did not finish parsing?");
446
488
  }
447
489
  if (stopBefore.length > 0) {
@@ -451,12 +493,16 @@ var AlgParser = class {
451
493
  }
452
494
  parseQuantumMoveImpl() {
453
495
  const [, , , outerLayerStr, innerLayerStr, family] = this.parseRegex(QUANTUM_MOVE_REGEX);
454
- return new QuantumMove(family, parseIntWithEmptyFallback(innerLayerStr, void 0), parseIntWithEmptyFallback(outerLayerStr, void 0));
496
+ return new QuantumMove(
497
+ family,
498
+ parseIntWithEmptyFallback(innerLayerStr, void 0),
499
+ parseIntWithEmptyFallback(outerLayerStr, void 0)
500
+ );
455
501
  }
456
502
  parseMoveImpl() {
457
- const savedCharIndex = __privateGet(this, _idx);
503
+ const savedCharIndex = this.#idx;
458
504
  if (this.tryConsumeNext("/")) {
459
- return addCharIndices(new Move("_SLASH_"), savedCharIndex, __privateGet(this, _idx));
505
+ return addCharIndices(new Move("_SLASH_"), savedCharIndex, this.#idx);
460
506
  }
461
507
  let quantumMove = this.parseQuantumMoveImpl();
462
508
  let [amount, hadEmptyAbsAmount] = this.parseAmountAndTrackEmptyAbsAmount();
@@ -466,13 +512,19 @@ var AlgParser = class {
466
512
  throw new Error("uh-oh");
467
513
  }
468
514
  if ((suffix === "++" || suffix === "--") && amount !== 1) {
469
- throw new Error("Pochmann ++ or -- moves cannot have an amount other than 1.");
515
+ throw new Error(
516
+ "Pochmann ++ or -- moves cannot have an amount other than 1."
517
+ );
470
518
  }
471
519
  if ((suffix === "++" || suffix === "--") && !hadEmptyAbsAmount) {
472
- throw new Error("Pochmann ++ or -- moves cannot have an amount written as a number.");
520
+ throw new Error(
521
+ "Pochmann ++ or -- moves cannot have an amount written as a number."
522
+ );
473
523
  }
474
524
  if ((suffix === "+" || suffix === "-") && hadEmptyAbsAmount) {
475
- throw new Error("Clock dial moves must have an amount written as a natural number followed by + or -.");
525
+ throw new Error(
526
+ "Clock dial moves must have an amount written as a natural number followed by + or -."
527
+ );
476
528
  }
477
529
  if (suffix.startsWith("+")) {
478
530
  quantumMove = quantumMove.modified({
@@ -486,7 +538,11 @@ var AlgParser = class {
486
538
  amount *= -1;
487
539
  }
488
540
  }
489
- const move = addCharIndices(new Move(quantumMove, amount), savedCharIndex, __privateGet(this, _idx));
541
+ const move = addCharIndices(
542
+ new Move(quantumMove, amount),
543
+ savedCharIndex,
544
+ this.#idx
545
+ );
490
546
  return move;
491
547
  }
492
548
  parseMoveSuffix() {
@@ -505,10 +561,12 @@ var AlgParser = class {
505
561
  return null;
506
562
  }
507
563
  parseAmountAndTrackEmptyAbsAmount() {
508
- const savedIdx = __privateGet(this, _idx);
564
+ const savedIdx = this.#idx;
509
565
  const [, absAmountStr, primeStr] = this.parseRegex(AMOUNT_REGEX);
510
566
  if (absAmountStr?.startsWith("0") && absAmountStr !== "0") {
511
- throw new Error(`Error at char index ${savedIdx}: An amount can only start with 0 if it's exactly the digit 0.`);
567
+ throw new Error(
568
+ `Error at char index ${savedIdx}: An amount can only start with 0 if it's exactly the digit 0.`
569
+ );
512
570
  }
513
571
  return [
514
572
  parseIntWithEmptyFallback(absAmountStr, 1) * (primeStr === "'" ? -1 : 1),
@@ -516,10 +574,12 @@ var AlgParser = class {
516
574
  ];
517
575
  }
518
576
  parseAmount() {
519
- const savedIdx = __privateGet(this, _idx);
577
+ const savedIdx = this.#idx;
520
578
  const [, absAmountStr, primeStr] = this.parseRegex(AMOUNT_REGEX);
521
579
  if (absAmountStr?.startsWith("0") && absAmountStr !== "0") {
522
- throw new Error(`Error at char index ${savedIdx}: An amount number can only start with 0 if it's exactly the digit 0.`);
580
+ throw new Error(
581
+ `Error at char index ${savedIdx}: An amount number can only start with 0 if it's exactly the digit 0.`
582
+ );
523
583
  }
524
584
  return parseIntWithEmptyFallback(absAmountStr, 1) * (primeStr === "'" ? -1 : 1);
525
585
  }
@@ -528,7 +588,7 @@ var AlgParser = class {
528
588
  if (arr === null) {
529
589
  throw new Error("internal parsing error");
530
590
  }
531
- __privateSet(this, _idx, __privateGet(this, _idx) + arr[0].length);
591
+ this.#idx += arr[0].length;
532
592
  return arr;
533
593
  }
534
594
  tryRegex(regex) {
@@ -536,20 +596,20 @@ var AlgParser = class {
536
596
  if (arr === null) {
537
597
  return null;
538
598
  }
539
- __privateSet(this, _idx, __privateGet(this, _idx) + arr[0].length);
599
+ this.#idx += arr[0].length;
540
600
  return arr;
541
601
  }
542
602
  remaining() {
543
- return __privateGet(this, _input).slice(__privateGet(this, _idx));
603
+ return this.#input.slice(this.#idx);
544
604
  }
545
605
  popNext() {
546
- const next = __privateGet(this, _input)[__privateGet(this, _idx)];
547
- __privateWrapper(this, _idx)._++;
606
+ const next = this.#input[this.#idx];
607
+ this.#idx++;
548
608
  return next;
549
609
  }
550
610
  tryConsumeNext(expected) {
551
- if (__privateGet(this, _input)[__privateGet(this, _idx)] === expected) {
552
- __privateWrapper(this, _idx)._++;
611
+ if (this.#input[this.#idx] === expected) {
612
+ this.#idx++;
553
613
  return true;
554
614
  }
555
615
  return false;
@@ -557,14 +617,13 @@ var AlgParser = class {
557
617
  mustConsumeNext(expected) {
558
618
  const next = this.popNext();
559
619
  if (next !== expected) {
560
- throw new Error(`expected \`${expected}\` while parsing, encountered ${next}`);
620
+ throw new Error(
621
+ `expected \`${expected}\` while parsing, encountered ${next}`
622
+ );
561
623
  }
562
624
  return next;
563
625
  }
564
626
  };
565
- _input = new WeakMap();
566
- _idx = new WeakMap();
567
- _nissQueue = new WeakMap();
568
627
 
569
628
  // src/cubing/alg/warnOnce.ts
570
629
  var warned = /* @__PURE__ */ new Set();
@@ -581,7 +640,9 @@ var QuantumWithAmount = class {
581
640
  this.quantum = quantum;
582
641
  this.amount = amount;
583
642
  if (!Number.isInteger(this.amount) || this.amount < MIN_INT || this.amount > MAX_INT) {
584
- throw new Error(`AlgNode amount absolute value must be a non-negative integer below ${MAX_INT_DESCRIPTION}.`);
643
+ throw new Error(
644
+ `AlgNode amount absolute value must be a non-negative integer below ${MAX_INT_DESCRIPTION}.`
645
+ );
585
646
  }
586
647
  }
587
648
  suffix() {
@@ -608,88 +669,105 @@ var QuantumWithAmount = class {
608
669
  };
609
670
 
610
671
  // src/cubing/alg/alg-nodes/leaves/Move.ts
611
- var _family, _innerLayer, _outerLayer;
612
- var _QuantumMove = class extends Comparable {
672
+ var QuantumMove = class extends Comparable {
673
+ #family;
674
+ #innerLayer;
675
+ #outerLayer;
613
676
  constructor(family, innerLayer, outerLayer) {
614
677
  super();
615
- __privateAdd(this, _family, void 0);
616
- __privateAdd(this, _innerLayer, void 0);
617
- __privateAdd(this, _outerLayer, void 0);
618
- __privateSet(this, _family, family);
619
- __privateSet(this, _innerLayer, innerLayer ?? null);
620
- __privateSet(this, _outerLayer, outerLayer ?? null);
678
+ this.#family = family;
679
+ this.#innerLayer = innerLayer ?? null;
680
+ this.#outerLayer = outerLayer ?? null;
621
681
  Object.freeze(this);
622
- if (__privateGet(this, _innerLayer) !== null && (!Number.isInteger(__privateGet(this, _innerLayer)) || __privateGet(this, _innerLayer) < 1 || __privateGet(this, _innerLayer) > MAX_INT)) {
623
- throw new Error(`QuantumMove inner layer must be a positive integer below ${MAX_INT_DESCRIPTION}.`);
682
+ if (this.#innerLayer !== null && (!Number.isInteger(this.#innerLayer) || this.#innerLayer < 1 || this.#innerLayer > MAX_INT)) {
683
+ throw new Error(
684
+ `QuantumMove inner layer must be a positive integer below ${MAX_INT_DESCRIPTION}.`
685
+ );
624
686
  }
625
- if (__privateGet(this, _outerLayer) !== null && (!Number.isInteger(__privateGet(this, _outerLayer)) || __privateGet(this, _outerLayer) < 1 || __privateGet(this, _outerLayer) > MAX_INT)) {
626
- throw new Error(`QuantumMove outer layer must be a positive integer below ${MAX_INT_DESCRIPTION}.`);
687
+ if (this.#outerLayer !== null && (!Number.isInteger(this.#outerLayer) || this.#outerLayer < 1 || this.#outerLayer > MAX_INT)) {
688
+ throw new Error(
689
+ `QuantumMove outer layer must be a positive integer below ${MAX_INT_DESCRIPTION}.`
690
+ );
627
691
  }
628
- if (__privateGet(this, _outerLayer) !== null && __privateGet(this, _innerLayer) !== null && __privateGet(this, _innerLayer) <= __privateGet(this, _outerLayer)) {
629
- throw new Error("QuantumMove outer layer must be smaller than inner layer.");
692
+ if (this.#outerLayer !== null && this.#innerLayer !== null && this.#innerLayer <= this.#outerLayer) {
693
+ throw new Error(
694
+ "QuantumMove outer layer must be smaller than inner layer."
695
+ );
630
696
  }
631
- if (__privateGet(this, _outerLayer) !== null && __privateGet(this, _innerLayer) === null) {
632
- throw new Error("QuantumMove with an outer layer must have an inner layer");
697
+ if (this.#outerLayer !== null && this.#innerLayer === null) {
698
+ throw new Error(
699
+ "QuantumMove with an outer layer must have an inner layer"
700
+ );
633
701
  }
634
702
  }
635
703
  static fromString(s) {
636
704
  return parseQuantumMove(s);
637
705
  }
638
706
  modified(modifications) {
639
- return new _QuantumMove(modifications.family ?? __privateGet(this, _family), modifications.innerLayer ?? __privateGet(this, _innerLayer), modifications.outerLayer ?? __privateGet(this, _outerLayer));
707
+ return new QuantumMove(
708
+ modifications.family ?? this.#family,
709
+ modifications.innerLayer ?? this.#innerLayer,
710
+ modifications.outerLayer ?? this.#outerLayer
711
+ );
640
712
  }
641
713
  isIdentical(other) {
642
714
  const otherAsQuantumMove = other;
643
- return other.is(_QuantumMove) && __privateGet(this, _family) === __privateGet(otherAsQuantumMove, _family) && __privateGet(this, _innerLayer) === __privateGet(otherAsQuantumMove, _innerLayer) && __privateGet(this, _outerLayer) === __privateGet(otherAsQuantumMove, _outerLayer);
715
+ return other.is(QuantumMove) && this.#family === otherAsQuantumMove.#family && this.#innerLayer === otherAsQuantumMove.#innerLayer && this.#outerLayer === otherAsQuantumMove.#outerLayer;
644
716
  }
645
717
  get family() {
646
- return __privateGet(this, _family);
718
+ return this.#family;
647
719
  }
648
720
  get outerLayer() {
649
- return __privateGet(this, _outerLayer);
721
+ return this.#outerLayer;
650
722
  }
651
723
  get innerLayer() {
652
- return __privateGet(this, _innerLayer);
724
+ return this.#innerLayer;
653
725
  }
654
726
  experimentalExpand() {
655
- throw new Error("experimentalExpand() cannot be called on a `QuantumMove` directly.");
727
+ throw new Error(
728
+ "experimentalExpand() cannot be called on a `QuantumMove` directly."
729
+ );
656
730
  }
657
731
  toString() {
658
- let s = __privateGet(this, _family);
659
- if (__privateGet(this, _innerLayer) !== null) {
660
- s = String(__privateGet(this, _innerLayer)) + s;
661
- if (__privateGet(this, _outerLayer) !== null) {
662
- s = String(__privateGet(this, _outerLayer)) + "-" + s;
732
+ let s = this.#family;
733
+ if (this.#innerLayer !== null) {
734
+ s = String(this.#innerLayer) + s;
735
+ if (this.#outerLayer !== null) {
736
+ s = String(this.#outerLayer) + "-" + s;
663
737
  }
664
738
  }
665
739
  return s;
666
740
  }
667
741
  };
668
- var QuantumMove = _QuantumMove;
669
- _family = new WeakMap();
670
- _innerLayer = new WeakMap();
671
- _outerLayer = new WeakMap();
672
- var _quantumWithAmount;
673
- var _Move = class extends AlgCommon {
742
+ var Move = class extends AlgCommon {
743
+ #quantumWithAmount;
674
744
  constructor(...args) {
675
745
  super();
676
- __privateAdd(this, _quantumWithAmount, void 0);
677
746
  if (typeof args[0] === "string") {
678
747
  if (args[1] ?? null) {
679
- __privateSet(this, _quantumWithAmount, new QuantumWithAmount(QuantumMove.fromString(args[0]), args[1]));
748
+ this.#quantumWithAmount = new QuantumWithAmount(
749
+ QuantumMove.fromString(args[0]),
750
+ args[1]
751
+ );
680
752
  return;
681
753
  } else {
682
- return _Move.fromString(args[0]);
754
+ return Move.fromString(args[0]);
683
755
  }
684
756
  }
685
- __privateSet(this, _quantumWithAmount, new QuantumWithAmount(args[0], args[1]));
757
+ this.#quantumWithAmount = new QuantumWithAmount(
758
+ args[0],
759
+ args[1]
760
+ );
686
761
  }
687
762
  isIdentical(other) {
688
- const otherAsMove = other.as(_Move);
689
- return !!otherAsMove && __privateGet(this, _quantumWithAmount).isIdentical(__privateGet(otherAsMove, _quantumWithAmount));
763
+ const otherAsMove = other.as(Move);
764
+ return !!otherAsMove && this.#quantumWithAmount.isIdentical(otherAsMove.#quantumWithAmount);
690
765
  }
691
766
  invert() {
692
- return transferCharIndex(this, new _Move(__privateGet(this, _quantumWithAmount).quantum, -this.amount));
767
+ return transferCharIndex(
768
+ this,
769
+ new Move(this.#quantumWithAmount.quantum, -this.amount)
770
+ );
693
771
  }
694
772
  *experimentalExpand(iterDir = 1 /* Forwards */) {
695
773
  if (iterDir === 1 /* Forwards */) {
@@ -701,46 +779,47 @@ var _Move = class extends AlgCommon {
701
779
  }
702
780
  }
703
781
  get quantum() {
704
- return __privateGet(this, _quantumWithAmount).quantum;
782
+ return this.#quantumWithAmount.quantum;
705
783
  }
706
784
  modified(modifications) {
707
- return new _Move(__privateGet(this, _quantumWithAmount).quantum.modified(modifications), modifications.amount ?? this.amount);
785
+ return new Move(
786
+ this.#quantumWithAmount.quantum.modified(modifications),
787
+ modifications.amount ?? this.amount
788
+ );
708
789
  }
709
790
  static fromString(s) {
710
791
  return parseMove(s);
711
792
  }
712
793
  get amount() {
713
- return __privateGet(this, _quantumWithAmount).amount;
794
+ return this.#quantumWithAmount.amount;
714
795
  }
715
796
  get type() {
716
797
  warnOnce("deprecated: type");
717
798
  return "blockMove";
718
799
  }
719
800
  get family() {
720
- return __privateGet(this, _quantumWithAmount).quantum.family ?? void 0;
801
+ return this.#quantumWithAmount.quantum.family ?? void 0;
721
802
  }
722
803
  get outerLayer() {
723
- return __privateGet(this, _quantumWithAmount).quantum.outerLayer ?? void 0;
804
+ return this.#quantumWithAmount.quantum.outerLayer ?? void 0;
724
805
  }
725
806
  get innerLayer() {
726
- return __privateGet(this, _quantumWithAmount).quantum.innerLayer ?? void 0;
807
+ return this.#quantumWithAmount.quantum.innerLayer ?? void 0;
727
808
  }
728
809
  toString() {
729
810
  if (this.family === "_SLASH_") {
730
811
  return "/";
731
812
  }
732
813
  if (this.family.endsWith("_PLUS_")) {
733
- return __privateGet(this, _quantumWithAmount).quantum.toString().slice(0, -6) + Math.abs(this.amount) + (this.amount < 0 ? "-" : "+");
814
+ return this.#quantumWithAmount.quantum.toString().slice(0, -6) + Math.abs(this.amount) + (this.amount < 0 ? "-" : "+");
734
815
  }
735
816
  if (this.family.endsWith("_PLUSPLUS_")) {
736
817
  const absAmount = Math.abs(this.amount);
737
- return __privateGet(this, _quantumWithAmount).quantum.toString().slice(0, -10) + (absAmount === 1 ? "" : absAmount) + (this.amount < 0 ? "--" : "++");
818
+ return this.#quantumWithAmount.quantum.toString().slice(0, -10) + (absAmount === 1 ? "" : absAmount) + (this.amount < 0 ? "--" : "++");
738
819
  }
739
- return __privateGet(this, _quantumWithAmount).quantum.toString() + __privateGet(this, _quantumWithAmount).suffix();
820
+ return this.#quantumWithAmount.quantum.toString() + this.#quantumWithAmount.suffix();
740
821
  }
741
822
  };
742
- var Move = _Move;
743
- _quantumWithAmount = new WeakMap();
744
823
 
745
824
  // src/cubing/alg/alg-nodes/containers/Grouping.ts
746
825
  var Square1TupleFormatter = class {
@@ -763,7 +842,9 @@ var Square1TupleFormatter = class {
763
842
  const [U, D] = quantumAlg.childAlgNodes();
764
843
  if (U.as(Move)?.quantum.isIdentical(this.quantumU_SQ_) && D.as(Move)?.quantum.isIdentical(this.quantumD_SQ_)) {
765
844
  if (grouping.amount !== 1) {
766
- throw new Error("Square-1 tuples cannot have an amount other than 1.");
845
+ throw new Error(
846
+ "Square-1 tuples cannot have an amount other than 1."
847
+ );
767
848
  }
768
849
  return [U, D];
769
850
  }
@@ -772,50 +853,50 @@ var Square1TupleFormatter = class {
772
853
  }
773
854
  };
774
855
  var square1TupleFormatterInstance = new Square1TupleFormatter();
775
- var _quantumWithAmount2;
776
- var _Grouping = class extends AlgCommon {
856
+ var Grouping = class extends AlgCommon {
777
857
  constructor(algSource, amount) {
778
858
  super();
779
- __privateAdd(this, _quantumWithAmount2, void 0);
780
859
  const alg = experimentalEnsureAlg(algSource);
781
- __privateSet(this, _quantumWithAmount2, new QuantumWithAmount(alg, amount));
860
+ this.#quantumWithAmount = new QuantumWithAmount(alg, amount);
782
861
  }
862
+ #quantumWithAmount;
783
863
  isIdentical(other) {
784
864
  const otherAsGrouping = other;
785
- return other.is(_Grouping) && __privateGet(this, _quantumWithAmount2).isIdentical(__privateGet(otherAsGrouping, _quantumWithAmount2));
865
+ return other.is(Grouping) && this.#quantumWithAmount.isIdentical(otherAsGrouping.#quantumWithAmount);
786
866
  }
787
867
  get alg() {
788
- return __privateGet(this, _quantumWithAmount2).quantum;
868
+ return this.#quantumWithAmount.quantum;
789
869
  }
790
870
  get amount() {
791
- return __privateGet(this, _quantumWithAmount2).amount;
871
+ return this.#quantumWithAmount.amount;
792
872
  }
793
873
  get experimentalRepetitionSuffix() {
794
- return __privateGet(this, _quantumWithAmount2).suffix();
874
+ return this.#quantumWithAmount.suffix();
795
875
  }
796
876
  invert() {
797
- return new _Grouping(__privateGet(this, _quantumWithAmount2).quantum, -__privateGet(this, _quantumWithAmount2).amount);
877
+ return new Grouping(
878
+ this.#quantumWithAmount.quantum,
879
+ -this.#quantumWithAmount.amount
880
+ );
798
881
  }
799
882
  *experimentalExpand(iterDir = 1 /* Forwards */, depth) {
800
883
  depth ?? (depth = Infinity);
801
884
  if (depth === 0) {
802
885
  yield iterDir === 1 /* Forwards */ ? this : this.invert();
803
886
  } else {
804
- yield* __privateGet(this, _quantumWithAmount2).experimentalExpand(iterDir, depth - 1);
887
+ yield* this.#quantumWithAmount.experimentalExpand(iterDir, depth - 1);
805
888
  }
806
889
  }
807
890
  static fromString() {
808
891
  throw new Error("unimplemented");
809
892
  }
810
893
  toString() {
811
- return square1TupleFormatterInstance.format(this) ?? `(${__privateGet(this, _quantumWithAmount2).quantum.toString()})${__privateGet(this, _quantumWithAmount2).suffix()}`;
894
+ return square1TupleFormatterInstance.format(this) ?? `(${this.#quantumWithAmount.quantum.toString()})${this.#quantumWithAmount.suffix()}`;
812
895
  }
813
896
  experimentalAsSquare1Tuple() {
814
897
  return square1TupleFormatterInstance.tuple(this);
815
898
  }
816
899
  };
817
- var Grouping = _Grouping;
818
- _quantumWithAmount2 = new WeakMap();
819
900
 
820
901
  // src/cubing/alg/is.ts
821
902
  function experimentalIs(v, c) {
@@ -866,7 +947,11 @@ var TraversalDownUp = class {
866
947
  };
867
948
  var TraversalUp = class extends TraversalDownUp {
868
949
  traverseAlgNode(algNode) {
869
- return dispatch(this, algNode, void 0);
950
+ return dispatch(
951
+ this,
952
+ algNode,
953
+ void 0
954
+ );
870
955
  }
871
956
  traverseIntoAlgNode(algNode) {
872
957
  return mustBeAlgNode(this.traverseAlgNode(algNode));
@@ -901,7 +986,10 @@ var _Simplify = class extends TraversalDownUp {
901
986
  function appendCollapsed(newAlgNode) {
902
987
  if (collapseMoves && lastAlgNode?.is(Move) && newAlgNode.is(Move) && lastAlgNode.quantum.isIdentical(newAlgNode.quantum)) {
903
988
  newAlgNodes.pop();
904
- if (!appendMoveWithNewAmount(lastAlgNode, newAlgNode.amount)) {
989
+ if (!appendMoveWithNewAmount(
990
+ lastAlgNode,
991
+ newAlgNode.amount
992
+ )) {
905
993
  lastAlgNode = newAlgNodes.slice(-1)[0];
906
994
  }
907
995
  } else {
@@ -933,7 +1021,10 @@ var _Simplify = class extends TraversalDownUp {
933
1021
  const newOptions = {
934
1022
  depth: options.depth ? options.depth - 1 : null
935
1023
  };
936
- const newGrouping = new Grouping(this.traverseAlg(grouping.alg, newOptions), grouping.amount);
1024
+ const newGrouping = new Grouping(
1025
+ this.traverseAlg(grouping.alg, newOptions),
1026
+ grouping.amount
1027
+ );
937
1028
  const newPlaceholder = __privateMethod(this, _newPlaceholderAssociations, newPlaceholderAssociations_fn).call(this).get(grouping);
938
1029
  if (newPlaceholder) {
939
1030
  newGrouping.experimentalNISSPlaceholder = newPlaceholder;
@@ -952,7 +1043,10 @@ var _Simplify = class extends TraversalDownUp {
952
1043
  const newOptions = {
953
1044
  depth: options.depth ? options.depth - 1 : null
954
1045
  };
955
- yield new Commutator(this.traverseAlg(commutator.A, newOptions), this.traverseAlg(commutator.B, newOptions));
1046
+ yield new Commutator(
1047
+ this.traverseAlg(commutator.A, newOptions),
1048
+ this.traverseAlg(commutator.B, newOptions)
1049
+ );
956
1050
  }
957
1051
  *traverseConjugate(conjugate, options) {
958
1052
  if (options.depth === 0) {
@@ -962,12 +1056,18 @@ var _Simplify = class extends TraversalDownUp {
962
1056
  const newOptions = {
963
1057
  depth: options.depth ? options.depth - 1 : null
964
1058
  };
965
- yield new Conjugate(this.traverseAlg(conjugate.A, newOptions), this.traverseAlg(conjugate.B, newOptions));
1059
+ yield new Conjugate(
1060
+ this.traverseAlg(conjugate.A, newOptions),
1061
+ this.traverseAlg(conjugate.B, newOptions)
1062
+ );
966
1063
  }
967
1064
  *traversePause(pause, _options) {
968
1065
  if (pause.experimentalNISSGrouping) {
969
1066
  const newPause = new Pause();
970
- __privateMethod(this, _newPlaceholderAssociations, newPlaceholderAssociations_fn).call(this).set(pause.experimentalNISSGrouping, newPause);
1067
+ __privateMethod(this, _newPlaceholderAssociations, newPlaceholderAssociations_fn).call(this).set(
1068
+ pause.experimentalNISSGrouping,
1069
+ newPause
1070
+ );
971
1071
  yield newPause;
972
1072
  } else {
973
1073
  yield pause;
@@ -1023,13 +1123,12 @@ function experimentalEnsureAlg(alg) {
1023
1123
  }
1024
1124
  return new Alg(alg);
1025
1125
  }
1026
- var _algNodes;
1027
- var _Alg = class extends AlgCommon {
1126
+ var Alg = class extends AlgCommon {
1127
+ #algNodes;
1028
1128
  constructor(alg) {
1029
1129
  super();
1030
- __privateAdd(this, _algNodes, void 0);
1031
- __privateSet(this, _algNodes, Array.from(toIterable(alg)));
1032
- for (const algNode of __privateGet(this, _algNodes)) {
1130
+ this.#algNodes = Array.from(toIterable(alg));
1131
+ for (const algNode of this.#algNodes) {
1033
1132
  if (!experimentalIsAlgNode(algNode)) {
1034
1133
  throw new Error("An alg can only contain alg nodes.");
1035
1134
  }
@@ -1037,11 +1136,11 @@ var _Alg = class extends AlgCommon {
1037
1136
  }
1038
1137
  isIdentical(other) {
1039
1138
  const otherAsAlg = other;
1040
- if (!other.is(_Alg)) {
1139
+ if (!other.is(Alg)) {
1041
1140
  return false;
1042
1141
  }
1043
- const l1 = Array.from(__privateGet(this, _algNodes));
1044
- const l2 = Array.from(__privateGet(otherAsAlg, _algNodes));
1142
+ const l1 = Array.from(this.#algNodes);
1143
+ const l2 = Array.from(otherAsAlg.#algNodes);
1045
1144
  if (l1.length !== l2.length) {
1046
1145
  return false;
1047
1146
  }
@@ -1053,16 +1152,21 @@ var _Alg = class extends AlgCommon {
1053
1152
  return true;
1054
1153
  }
1055
1154
  invert() {
1056
- return new _Alg(reverse(Array.from(__privateGet(this, _algNodes)).map((u) => u.invert())));
1155
+ return new Alg(reverse(Array.from(this.#algNodes).map((u) => u.invert())));
1057
1156
  }
1058
1157
  *experimentalExpand(iterDir = 1 /* Forwards */, depth) {
1059
1158
  depth ?? (depth = Infinity);
1060
- for (const algNode of direct(__privateGet(this, _algNodes), iterDir)) {
1159
+ for (const algNode of direct(this.#algNodes, iterDir)) {
1061
1160
  yield* algNode.experimentalExpand(iterDir, depth);
1062
1161
  }
1063
1162
  }
1064
1163
  expand(options) {
1065
- return new _Alg(this.experimentalExpand(1 /* Forwards */, options?.depth ?? Infinity));
1164
+ return new Alg(
1165
+ this.experimentalExpand(
1166
+ 1 /* Forwards */,
1167
+ options?.depth ?? Infinity
1168
+ )
1169
+ );
1066
1170
  }
1067
1171
  *experimentalLeafMoves() {
1068
1172
  for (const leaf of this.experimentalExpand()) {
@@ -1072,10 +1176,12 @@ var _Alg = class extends AlgCommon {
1072
1176
  }
1073
1177
  }
1074
1178
  concat(input) {
1075
- return new _Alg(Array.from(__privateGet(this, _algNodes)).concat(Array.from(toIterable(input))));
1179
+ return new Alg(
1180
+ Array.from(this.#algNodes).concat(Array.from(toIterable(input)))
1181
+ );
1076
1182
  }
1077
1183
  experimentalIsEmpty() {
1078
- for (const _ of __privateGet(this, _algNodes)) {
1184
+ for (const _ of this.#algNodes) {
1079
1185
  return false;
1080
1186
  }
1081
1187
  return true;
@@ -1087,7 +1193,7 @@ var _Alg = class extends AlgCommon {
1087
1193
  return this.childAlgNodes();
1088
1194
  }
1089
1195
  *childAlgNodes() {
1090
- for (const algNode of __privateGet(this, _algNodes)) {
1196
+ for (const algNode of this.#algNodes) {
1091
1197
  yield algNode;
1092
1198
  }
1093
1199
  }
@@ -1095,7 +1201,7 @@ var _Alg = class extends AlgCommon {
1095
1201
  return this.experimentalNumChildAlgNodes();
1096
1202
  }
1097
1203
  experimentalNumChildAlgNodes() {
1098
- return Array.from(__privateGet(this, _algNodes)).length;
1204
+ return Array.from(this.#algNodes).length;
1099
1205
  }
1100
1206
  get type() {
1101
1207
  warnOnce("deprecated: type");
@@ -1104,7 +1210,7 @@ var _Alg = class extends AlgCommon {
1104
1210
  toString() {
1105
1211
  let output = "";
1106
1212
  let previousVisibleAlgNode = null;
1107
- for (const algNode of __privateGet(this, _algNodes)) {
1213
+ for (const algNode of this.#algNodes) {
1108
1214
  if (previousVisibleAlgNode) {
1109
1215
  output += spaceBetween(previousVisibleAlgNode, algNode);
1110
1216
  }
@@ -1123,11 +1229,9 @@ var _Alg = class extends AlgCommon {
1123
1229
  return output;
1124
1230
  }
1125
1231
  simplify(options) {
1126
- return new _Alg(simplify(this, options ?? {}));
1232
+ return new Alg(simplify(this, options ?? {}));
1127
1233
  }
1128
1234
  };
1129
- var Alg = _Alg;
1130
- _algNodes = new WeakMap();
1131
1235
  function spaceBetween(u1, u2) {
1132
1236
  if (u1.is(Newline) || u2.is(Newline)) {
1133
1237
  return "";
@@ -1162,9 +1266,12 @@ var Example = {
1162
1266
  new Move("R", -1)
1163
1267
  ]),
1164
1268
  SuneCommutator: new Alg([
1165
- new Commutator(new Alg([new Move("R", 1), new Move("U", 1), new Move("R", -2)]), new Alg([
1166
- new Conjugate(new Alg([new Move("R", 1)]), new Alg([new Move("U", 1)]))
1167
- ]))
1269
+ new Commutator(
1270
+ new Alg([new Move("R", 1), new Move("U", 1), new Move("R", -2)]),
1271
+ new Alg([
1272
+ new Conjugate(new Alg([new Move("R", 1)]), new Alg([new Move("U", 1)]))
1273
+ ])
1274
+ )
1168
1275
  ]),
1169
1276
  Niklas: new Alg([
1170
1277
  new Move("R", 1),
@@ -1178,23 +1285,44 @@ var Example = {
1178
1285
  ]),
1179
1286
  EPerm: new Alg([
1180
1287
  new Move("x", -1),
1181
- new Commutator(new Alg([
1182
- new Conjugate(new Alg([new Move("R", 1)]), new Alg([new Move("U", -1)]))
1183
- ]), new Alg([new Move("D", 1)])),
1184
- new Commutator(new Alg([
1185
- new Conjugate(new Alg([new Move("R", 1)]), new Alg([new Move("U", 1)]))
1186
- ]), new Alg([new Move("D", 1)])),
1288
+ new Commutator(
1289
+ new Alg([
1290
+ new Conjugate(
1291
+ new Alg([new Move("R", 1)]),
1292
+ new Alg([new Move("U", -1)])
1293
+ )
1294
+ ]),
1295
+ new Alg([new Move("D", 1)])
1296
+ ),
1297
+ new Commutator(
1298
+ new Alg([
1299
+ new Conjugate(new Alg([new Move("R", 1)]), new Alg([new Move("U", 1)]))
1300
+ ]),
1301
+ new Alg([new Move("D", 1)])
1302
+ ),
1187
1303
  new Move("x", 1)
1188
1304
  ]),
1189
1305
  FURURFCompact: new Alg([
1190
- new Conjugate(new Alg([new Move("F", 1)]), new Alg([
1191
- new Commutator(new Alg([new Move("U", 1)]), new Alg([new Move("R", 1)]))
1192
- ]))
1306
+ new Conjugate(
1307
+ new Alg([new Move("F", 1)]),
1308
+ new Alg([
1309
+ new Commutator(
1310
+ new Alg([new Move("U", 1)]),
1311
+ new Alg([new Move("R", 1)])
1312
+ )
1313
+ ])
1314
+ )
1193
1315
  ]),
1194
1316
  APermCompact: new Alg([
1195
- new Conjugate(new Alg([new Move("R", 2)]), new Alg([
1196
- new Commutator(new Alg([new Move("F", 2)]), new Alg([new Move("R", -1), new Move("B", -1), new Move("R", 1)]))
1197
- ]))
1317
+ new Conjugate(
1318
+ new Alg([new Move("R", 2)]),
1319
+ new Alg([
1320
+ new Commutator(
1321
+ new Alg([new Move("F", 2)]),
1322
+ new Alg([new Move("R", -1), new Move("B", -1), new Move("R", 1)])
1323
+ )
1324
+ ])
1325
+ )
1198
1326
  ]),
1199
1327
  FURURFMoves: new Alg([
1200
1328
  new Move("F", 1),
@@ -1221,11 +1349,20 @@ var Example = {
1221
1349
  new Move("F", -1)
1222
1350
  ]),
1223
1351
  HeadlightSwaps: new Alg([
1224
- new Conjugate(new Alg([new Move("F", 1)]), new Alg([
1225
- new Grouping(new Alg([
1226
- new Commutator(new Alg([new Move("R", 1)]), new Alg([new Move("U", 1)]))
1227
- ]), 3)
1228
- ]))
1352
+ new Conjugate(
1353
+ new Alg([new Move("F", 1)]),
1354
+ new Alg([
1355
+ new Grouping(
1356
+ new Alg([
1357
+ new Commutator(
1358
+ new Alg([new Move("R", 1)]),
1359
+ new Alg([new Move("U", 1)])
1360
+ )
1361
+ ]),
1362
+ 3
1363
+ )
1364
+ ])
1365
+ )
1229
1366
  ]),
1230
1367
  TriplePause: new Alg([new Pause(), new Pause(), new Pause()])
1231
1368
  };
@@ -1260,7 +1397,8 @@ var cubeKeyMapping = {
1260
1397
  80: new Move("z"),
1261
1398
  81: new Move("z'"),
1262
1399
  90: new Move("M'"),
1263
- 190: new Move("M'")
1400
+ 190: new Move("M'"),
1401
+ 192: new Pause()
1264
1402
  };
1265
1403
  function keyToMove(e) {
1266
1404
  if (e.altKey || e.ctrlKey) {
@@ -1277,7 +1415,7 @@ function serializeURLParam(a) {
1277
1415
  escaped = escaped.replace(/-/g, "&#45;").replace(/'/g, "-");
1278
1416
  return escaped;
1279
1417
  }
1280
- function algCubingNetLink(options) {
1418
+ function experimentalAlgCubingNetLink(options) {
1281
1419
  const url = new URL("https://alg.cubing.net");
1282
1420
  if (!options.alg) {
1283
1421
  throw new Error("An alg parameter is required.");
@@ -1394,7 +1532,7 @@ export {
1394
1532
  Alg,
1395
1533
  Example,
1396
1534
  keyToMove,
1397
- algCubingNetLink,
1535
+ experimentalAlgCubingNetLink,
1398
1536
  experimentalAppendMove
1399
1537
  };
1400
- //# sourceMappingURL=chunk-GXZIBFSN.js.map
1538
+ //# sourceMappingURL=chunk-NI7U4XAZ.js.map