xstate 4.35.2 → 5.0.0-alpha.1

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 (203) hide show
  1. package/README.md +25 -16
  2. package/actions/dist/xstate-actions.cjs.d.ts +1 -0
  3. package/actions/dist/xstate-actions.cjs.dev.js +30 -0
  4. package/actions/dist/xstate-actions.cjs.js +7 -0
  5. package/actions/dist/xstate-actions.cjs.prod.js +30 -0
  6. package/actions/dist/xstate-actions.esm.js +2 -0
  7. package/actions/dist/xstate-actions.umd.min.js +2 -0
  8. package/actions/dist/xstate-actions.umd.min.js.map +1 -0
  9. package/actions/dynamicAction.ts +34 -0
  10. package/actions/package.json +8 -0
  11. package/actors/dist/xstate-actors.cjs.d.ts +1 -0
  12. package/actors/dist/xstate-actors.cjs.dev.js +20 -0
  13. package/actors/dist/xstate-actors.cjs.js +7 -0
  14. package/actors/dist/xstate-actors.cjs.prod.js +20 -0
  15. package/actors/dist/xstate-actors.esm.js +2 -0
  16. package/actors/dist/xstate-actors.umd.min.js +2 -0
  17. package/actors/dist/xstate-actors.umd.min.js.map +1 -0
  18. package/actors/package.json +8 -0
  19. package/dev/dist/xstate-dev.cjs.d.ts +1 -0
  20. package/dev/dist/xstate-dev.cjs.dev.js +11 -0
  21. package/dev/dist/xstate-dev.cjs.js +7 -0
  22. package/{lib/devTools.js → dev/dist/xstate-dev.cjs.prod.js} +17 -10
  23. package/dev/dist/xstate-dev.esm.js +1 -0
  24. package/dev/dist/xstate-dev.umd.min.js +2 -0
  25. package/dev/dist/xstate-dev.umd.min.js.map +1 -0
  26. package/dev/package.json +8 -0
  27. package/dist/actions-7ea9280f.cjs.prod.js +4674 -0
  28. package/dist/actions-b08d0da8.cjs.dev.js +4718 -0
  29. package/dist/actions-b673cb13.esm.js +4660 -0
  30. package/dist/declarations/actions/dynamicAction.d.ts +5 -0
  31. package/dist/declarations/src/Machine.d.ts +4 -0
  32. package/dist/declarations/src/Mailbox.d.ts +12 -0
  33. package/{es → dist/declarations/src}/SimulatedClock.d.ts +16 -17
  34. package/dist/declarations/src/State.d.ts +97 -0
  35. package/dist/declarations/src/StateMachine.d.ts +120 -0
  36. package/dist/declarations/src/StateNode.d.ts +127 -0
  37. package/{es → dist/declarations/src}/actionTypes.d.ts +16 -20
  38. package/dist/declarations/src/actions/assign.d.ts +7 -0
  39. package/dist/declarations/src/actions/cancel.d.ts +10 -0
  40. package/dist/declarations/src/actions/choose.d.ts +3 -0
  41. package/dist/declarations/src/actions/invoke.d.ts +3 -0
  42. package/dist/declarations/src/actions/log.d.ts +11 -0
  43. package/dist/declarations/src/actions/pure.d.ts +3 -0
  44. package/dist/declarations/src/actions/raise.d.ts +9 -0
  45. package/dist/declarations/src/actions/send.d.ts +51 -0
  46. package/dist/declarations/src/actions/stop.d.ts +7 -0
  47. package/dist/declarations/src/actions.d.ts +43 -0
  48. package/dist/declarations/src/actors.d.ts +37 -0
  49. package/dist/declarations/src/constants.d.ts +5 -0
  50. package/{lib/devTools.d.ts → dist/declarations/src/dev/index.d.ts} +14 -14
  51. package/{es → dist/declarations/src}/environment.d.ts +1 -2
  52. package/dist/declarations/src/guards.d.ts +8 -0
  53. package/dist/declarations/src/index.d.ts +44 -0
  54. package/dist/declarations/src/interpreter.d.ts +108 -0
  55. package/{es → dist/declarations/src}/mapState.d.ts +3 -4
  56. package/dist/declarations/src/memo.d.ts +2 -0
  57. package/dist/declarations/src/registry.d.ts +8 -0
  58. package/{es → dist/declarations/src}/schema.d.ts +2 -3
  59. package/dist/declarations/src/spawn.d.ts +2 -0
  60. package/dist/declarations/src/stateUtils.d.ts +70 -0
  61. package/dist/declarations/src/symbolObservable.d.ts +1 -0
  62. package/{lib → dist/declarations/src}/typegenTypes.d.ts +132 -133
  63. package/dist/declarations/src/types.d.ts +1001 -0
  64. package/dist/declarations/src/utils.d.ts +54 -0
  65. package/{es/devTools.js → dist/index-20b364c4.esm.js} +18 -6
  66. package/dist/index-2a564d03.cjs.dev.js +64 -0
  67. package/dist/xstate.cjs.d.ts +1 -0
  68. package/dist/xstate.cjs.dev.js +993 -0
  69. package/dist/xstate.cjs.js +7 -0
  70. package/dist/xstate.cjs.prod.js +993 -0
  71. package/dist/xstate.esm.js +952 -0
  72. package/dist/xstate.umd.min.js +2 -0
  73. package/dist/xstate.umd.min.js.map +1 -0
  74. package/guards/dist/xstate-guards.cjs.d.ts +1 -0
  75. package/guards/dist/xstate-guards.cjs.dev.js +15 -0
  76. package/guards/dist/xstate-guards.cjs.js +7 -0
  77. package/guards/dist/xstate-guards.cjs.prod.js +15 -0
  78. package/guards/dist/xstate-guards.esm.js +2 -0
  79. package/guards/dist/xstate-guards.umd.min.js +2 -0
  80. package/guards/dist/xstate-guards.umd.min.js.map +1 -0
  81. package/guards/package.json +8 -0
  82. package/invoke/package.json +4 -0
  83. package/package.json +44 -30
  84. package/dist/xstate.interpreter.js +0 -15
  85. package/dist/xstate.js +0 -15
  86. package/dist/xstate.web.js +0 -15
  87. package/es/Actor.d.ts +0 -25
  88. package/es/Actor.js +0 -99
  89. package/es/Machine.d.ts +0 -12
  90. package/es/Machine.js +0 -21
  91. package/es/SimulatedClock.js +0 -81
  92. package/es/State.d.ts +0 -123
  93. package/es/State.js +0 -274
  94. package/es/StateNode.d.ts +0 -282
  95. package/es/StateNode.js +0 -1587
  96. package/es/_virtual/_tslib.js +0 -78
  97. package/es/actionTypes.js +0 -22
  98. package/es/actions.d.ts +0 -157
  99. package/es/actions.js +0 -630
  100. package/es/behaviors.d.ts +0 -37
  101. package/es/behaviors.js +0 -131
  102. package/es/constants.d.ts +0 -6
  103. package/es/constants.js +0 -6
  104. package/es/devTools.d.ts +0 -14
  105. package/es/each.d.ts +0 -4
  106. package/es/each.js +0 -13
  107. package/es/environment.js +0 -3
  108. package/es/index.d.ts +0 -22
  109. package/es/index.js +0 -25
  110. package/es/interpreter.d.ts +0 -217
  111. package/es/interpreter.js +0 -1488
  112. package/es/invoke.d.ts +0 -11
  113. package/es/invokeUtils.d.ts +0 -7
  114. package/es/invokeUtils.js +0 -40
  115. package/es/json.d.ts +0 -31
  116. package/es/json.js +0 -86
  117. package/es/mapState.js +0 -32
  118. package/es/match.d.ts +0 -9
  119. package/es/match.js +0 -34
  120. package/es/model.d.ts +0 -8
  121. package/es/model.js +0 -50
  122. package/es/model.types.d.ts +0 -56
  123. package/es/patterns.d.ts +0 -14
  124. package/es/patterns.js +0 -48
  125. package/es/registry.d.ts +0 -9
  126. package/es/registry.js +0 -19
  127. package/es/scheduler.d.ts +0 -17
  128. package/es/scheduler.js +0 -79
  129. package/es/schema.js +0 -6
  130. package/es/scxml.d.ts +0 -6
  131. package/es/serviceScope.d.ts +0 -4
  132. package/es/serviceScope.js +0 -16
  133. package/es/stateUtils.d.ts +0 -18
  134. package/es/stateUtils.js +0 -262
  135. package/es/typegenTypes.d.ts +0 -133
  136. package/es/types.d.ts +0 -1040
  137. package/es/types.js +0 -33
  138. package/es/utils.d.ts +0 -72
  139. package/es/utils.js +0 -622
  140. package/es/waitFor.d.ts +0 -34
  141. package/es/waitFor.js +0 -73
  142. package/lib/Actor.d.ts +0 -25
  143. package/lib/Actor.js +0 -108
  144. package/lib/Machine.d.ts +0 -12
  145. package/lib/Machine.js +0 -26
  146. package/lib/SimulatedClock.d.ts +0 -17
  147. package/lib/SimulatedClock.js +0 -85
  148. package/lib/State.d.ts +0 -123
  149. package/lib/State.js +0 -282
  150. package/lib/StateNode.d.ts +0 -282
  151. package/lib/StateNode.js +0 -1591
  152. package/lib/_virtual/_tslib.js +0 -85
  153. package/lib/actionTypes.d.ts +0 -20
  154. package/lib/actionTypes.js +0 -43
  155. package/lib/actions.d.ts +0 -157
  156. package/lib/actions.js +0 -662
  157. package/lib/behaviors.d.ts +0 -37
  158. package/lib/behaviors.js +0 -137
  159. package/lib/constants.d.ts +0 -6
  160. package/lib/constants.js +0 -13
  161. package/lib/each.d.ts +0 -4
  162. package/lib/each.js +0 -17
  163. package/lib/environment.d.ts +0 -2
  164. package/lib/environment.js +0 -7
  165. package/lib/index.d.ts +0 -22
  166. package/lib/index.js +0 -64
  167. package/lib/interpreter.d.ts +0 -217
  168. package/lib/interpreter.js +0 -1494
  169. package/lib/invoke.d.ts +0 -11
  170. package/lib/invoke.js +0 -20
  171. package/lib/invokeUtils.d.ts +0 -7
  172. package/lib/invokeUtils.js +0 -45
  173. package/lib/json.d.ts +0 -31
  174. package/lib/json.js +0 -94
  175. package/lib/mapState.d.ts +0 -4
  176. package/lib/mapState.js +0 -36
  177. package/lib/match.d.ts +0 -9
  178. package/lib/match.js +0 -38
  179. package/lib/model.d.ts +0 -8
  180. package/lib/model.js +0 -54
  181. package/lib/model.types.d.ts +0 -56
  182. package/lib/model.types.js +0 -2
  183. package/lib/patterns.d.ts +0 -14
  184. package/lib/patterns.js +0 -53
  185. package/lib/registry.d.ts +0 -9
  186. package/lib/registry.js +0 -23
  187. package/lib/scheduler.d.ts +0 -17
  188. package/lib/scheduler.js +0 -83
  189. package/lib/schema.d.ts +0 -3
  190. package/lib/schema.js +0 -11
  191. package/lib/scxml.d.ts +0 -6
  192. package/lib/scxml.js +0 -350
  193. package/lib/serviceScope.d.ts +0 -4
  194. package/lib/serviceScope.js +0 -21
  195. package/lib/stateUtils.d.ts +0 -18
  196. package/lib/stateUtils.js +0 -277
  197. package/lib/typegenTypes.js +0 -2
  198. package/lib/types.d.ts +0 -1040
  199. package/lib/types.js +0 -35
  200. package/lib/utils.d.ts +0 -72
  201. package/lib/utils.js +0 -669
  202. package/lib/waitFor.d.ts +0 -34
  203. package/lib/waitFor.js +0 -77
@@ -0,0 +1,993 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var actors_dist_xstateActors = require('./actions-b08d0da8.cjs.dev.js');
6
+ require('./index-2a564d03.cjs.dev.js');
7
+
8
+ function pure(getActions) {
9
+ return actors_dist_xstateActors.createDynamicAction({
10
+ type: actors_dist_xstateActors.pure,
11
+ params: {
12
+ get: getActions
13
+ }
14
+ }, function (_event, _ref) {
15
+ var _toArray;
16
+
17
+ var state = _ref.state;
18
+ return [state, {
19
+ type: actors_dist_xstateActors.pure,
20
+ params: {
21
+ actions: (_toArray = actors_dist_xstateActors.toArray(getActions(state.context, _event.data))) !== null && _toArray !== void 0 ? _toArray : []
22
+ }
23
+ }];
24
+ });
25
+ }
26
+
27
+ var _excluded = ["onDone", "onError"];
28
+ var EMPTY_OBJECT = {};
29
+ var StateNode = /*#__PURE__*/function () {
30
+ /**
31
+ * The relative key of the state node, which represents its location in the overall state value.
32
+ */
33
+
34
+ /**
35
+ * The unique ID of the state node.
36
+ */
37
+
38
+ /**
39
+ * The type of this state node:
40
+ *
41
+ * - `'atomic'` - no child state nodes
42
+ * - `'compound'` - nested child state nodes (XOR)
43
+ * - `'parallel'` - orthogonal nested child state nodes (AND)
44
+ * - `'history'` - history state node
45
+ * - `'final'` - final state node
46
+ */
47
+
48
+ /**
49
+ * The string path from the root machine node to this node.
50
+ */
51
+
52
+ /**
53
+ * The child state nodes.
54
+ */
55
+
56
+ /**
57
+ * The type of history on this state node. Can be:
58
+ *
59
+ * - `'shallow'` - recalls only top-level historical state value
60
+ * - `'deep'` - recalls historical state value at all levels
61
+ */
62
+
63
+ /**
64
+ * The action(s) to be executed upon entering the state node.
65
+ */
66
+
67
+ /**
68
+ * The action(s) to be executed upon exiting the state node.
69
+ */
70
+
71
+ /**
72
+ * The parent state node.
73
+ */
74
+
75
+ /**
76
+ * The root machine node.
77
+ */
78
+
79
+ /**
80
+ * The meta data associated with this state node, which will be returned in State instances.
81
+ */
82
+
83
+ /**
84
+ * The data sent with the "done.state._id_" event if this is a final state node.
85
+ */
86
+
87
+ /**
88
+ * The order this state node appears. Corresponds to the implicit SCXML document order.
89
+ */
90
+ function StateNode(
91
+ /**
92
+ * The raw config used to create the machine.
93
+ */
94
+ config, options) {
95
+ var _this = this;
96
+
97
+ actors_dist_xstateActors._classCallCheck(this, StateNode);
98
+
99
+ this.config = config;
100
+
101
+ actors_dist_xstateActors._defineProperty(this, "key", void 0);
102
+
103
+ actors_dist_xstateActors._defineProperty(this, "id", void 0);
104
+
105
+ actors_dist_xstateActors._defineProperty(this, "type", void 0);
106
+
107
+ actors_dist_xstateActors._defineProperty(this, "path", void 0);
108
+
109
+ actors_dist_xstateActors._defineProperty(this, "states", void 0);
110
+
111
+ actors_dist_xstateActors._defineProperty(this, "history", void 0);
112
+
113
+ actors_dist_xstateActors._defineProperty(this, "entry", void 0);
114
+
115
+ actors_dist_xstateActors._defineProperty(this, "exit", void 0);
116
+
117
+ actors_dist_xstateActors._defineProperty(this, "parent", void 0);
118
+
119
+ actors_dist_xstateActors._defineProperty(this, "machine", void 0);
120
+
121
+ actors_dist_xstateActors._defineProperty(this, "meta", void 0);
122
+
123
+ actors_dist_xstateActors._defineProperty(this, "doneData", void 0);
124
+
125
+ actors_dist_xstateActors._defineProperty(this, "order", -1);
126
+
127
+ actors_dist_xstateActors._defineProperty(this, "description", void 0);
128
+
129
+ actors_dist_xstateActors._defineProperty(this, "tags", []);
130
+
131
+ actors_dist_xstateActors._defineProperty(this, "transitions", void 0);
132
+
133
+ actors_dist_xstateActors._defineProperty(this, "always", void 0);
134
+
135
+ this.parent = options._parent;
136
+ this.key = options._key;
137
+ this.machine = options._machine;
138
+ this.path = this.parent ? this.parent.path.concat(this.key) : [];
139
+ this.id = this.config.id || [this.machine.id].concat(actors_dist_xstateActors._toConsumableArray(this.path)).join(this.machine.delimiter);
140
+ this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? 'compound' : this.config.history ? 'history' : 'atomic');
141
+ this.description = this.config.description;
142
+ this.order = this.machine.idMap.size;
143
+ this.machine.idMap.set(this.id, this);
144
+ this.states = this.config.states ? actors_dist_xstateActors.mapValues(this.config.states, function (stateConfig, key) {
145
+ var stateNode = new StateNode(stateConfig, {
146
+ _parent: _this,
147
+ _key: key,
148
+ _machine: _this.machine
149
+ });
150
+ return stateNode;
151
+ }) : EMPTY_OBJECT;
152
+
153
+ if (this.type === 'compound' && !this.config.initial) {
154
+ throw new Error("No initial state specified for compound state node \"#".concat(this.id, "\". Try adding { initial: \"").concat(Object.keys(this.states)[0], "\" } to the state config."));
155
+ } // History config
156
+
157
+
158
+ this.history = this.config.history === true ? 'shallow' : this.config.history || false;
159
+ this.entry = actors_dist_xstateActors.toActionObjects(this.config.entry);
160
+ this.exit = actors_dist_xstateActors.toActionObjects(this.config.exit);
161
+ this.meta = this.config.meta;
162
+ this.doneData = this.type === 'final' ? this.config.data : undefined;
163
+ this.tags = actors_dist_xstateActors.toArray(config.tags);
164
+ }
165
+
166
+ actors_dist_xstateActors._createClass(StateNode, [{
167
+ key: "_initialize",
168
+ value: function _initialize() {
169
+ var _this2 = this;
170
+
171
+ this.transitions = actors_dist_xstateActors.formatTransitions(this);
172
+
173
+ if (this.config.always) {
174
+ this.always = actors_dist_xstateActors.toTransitionConfigArray(actors_dist_xstateActors.NULL_EVENT, this.config.always).map(function (t) {
175
+ return actors_dist_xstateActors.formatTransition(_this2, t);
176
+ });
177
+ }
178
+
179
+ Object.keys(this.states).forEach(function (key) {
180
+ _this2.states[key]._initialize();
181
+ });
182
+ }
183
+ /**
184
+ * The well-structured state node definition.
185
+ */
186
+
187
+ }, {
188
+ key: "definition",
189
+ get: function get() {
190
+ var _this3 = this;
191
+
192
+ return {
193
+ id: this.id,
194
+ key: this.key,
195
+ version: this.machine.version,
196
+ type: this.type,
197
+ initial: this.initial ? {
198
+ target: this.initial.target,
199
+ source: this,
200
+ actions: this.initial.actions,
201
+ eventType: null,
202
+ toJSON: function toJSON() {
203
+ return {
204
+ target: _this3.initial.target.map(function (t) {
205
+ return "#".concat(t.id);
206
+ }),
207
+ source: "#".concat(_this3.id),
208
+ actions: _this3.initial.actions,
209
+ eventType: null
210
+ };
211
+ }
212
+ } : undefined,
213
+ history: this.history,
214
+ states: actors_dist_xstateActors.mapValues(this.states, function (state) {
215
+ return state.definition;
216
+ }),
217
+ on: this.on,
218
+ transitions: this.transitions,
219
+ entry: this.entry,
220
+ exit: this.exit,
221
+ meta: this.meta,
222
+ order: this.order || -1,
223
+ data: this.doneData,
224
+ invoke: this.invoke,
225
+ description: this.description,
226
+ tags: this.tags
227
+ };
228
+ }
229
+ }, {
230
+ key: "toJSON",
231
+ value: function toJSON() {
232
+ return this.definition;
233
+ }
234
+ /**
235
+ * The behaviors invoked as actors by this state node.
236
+ */
237
+
238
+ }, {
239
+ key: "invoke",
240
+ get: function get() {
241
+ var _this4 = this;
242
+
243
+ return actors_dist_xstateActors.memo(this, 'invoke', function () {
244
+ return actors_dist_xstateActors.toArray(_this4.config.invoke).map(function (invocable, i) {
245
+ var generatedId = actors_dist_xstateActors.createInvokeId(_this4.id, i);
246
+ var invokeConfig = actors_dist_xstateActors.toInvokeConfig(invocable, generatedId);
247
+ var resolvedId = invokeConfig.id || generatedId;
248
+ var src = invokeConfig.src;
249
+ var resolvedSrc = actors_dist_xstateActors.toInvokeSource(actors_dist_xstateActors.isString(src) ? src : !('type' in src) ? resolvedId : src);
250
+
251
+ if (!_this4.machine.options.actors[resolvedId] && typeof src !== 'string' && !('type' in src)) {
252
+ _this4.machine.options.actors = actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, _this4.machine.options.actors), {}, actors_dist_xstateActors._defineProperty({}, resolvedId, typeof src === 'function' ? src : function () {
253
+ return src;
254
+ }));
255
+ }
256
+
257
+ return actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({
258
+ type: actors_dist_xstateActors.invoke
259
+ }, invokeConfig), {}, {
260
+ src: resolvedSrc,
261
+ id: resolvedId,
262
+ toJSON: function toJSON() {
263
+ var onDone = invokeConfig.onDone,
264
+ onError = invokeConfig.onError,
265
+ invokeDefValues = actors_dist_xstateActors._objectWithoutProperties(invokeConfig, _excluded);
266
+
267
+ return actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, invokeDefValues), {}, {
268
+ type: actors_dist_xstateActors.invoke,
269
+ src: resolvedSrc,
270
+ id: resolvedId
271
+ });
272
+ }
273
+ });
274
+ });
275
+ });
276
+ }
277
+ /**
278
+ * The mapping of events to transitions.
279
+ */
280
+
281
+ }, {
282
+ key: "on",
283
+ get: function get() {
284
+ var _this5 = this;
285
+
286
+ return actors_dist_xstateActors.memo(this, 'on', function () {
287
+ var transitions = _this5.transitions;
288
+ return transitions.reduce(function (map, transition) {
289
+ map[transition.eventType] = map[transition.eventType] || [];
290
+ map[transition.eventType].push(transition);
291
+ return map;
292
+ }, {});
293
+ });
294
+ }
295
+ }, {
296
+ key: "after",
297
+ get: function get() {
298
+ var _this6 = this;
299
+
300
+ return actors_dist_xstateActors.memo(this, 'delayedTransitions', function () {
301
+ return actors_dist_xstateActors.getDelayedTransitions(_this6);
302
+ });
303
+ }
304
+ }, {
305
+ key: "initial",
306
+ get: function get() {
307
+ var _this7 = this;
308
+
309
+ return actors_dist_xstateActors.memo(this, 'initial', function () {
310
+ return actors_dist_xstateActors.formatInitialTransition(_this7, _this7.config.initial || []);
311
+ });
312
+ }
313
+ /**
314
+ * Returns `true` if this state node explicitly handles the given event.
315
+ *
316
+ * @param event The event in question
317
+ */
318
+
319
+ }, {
320
+ key: "handles",
321
+ value: function handles(event) {
322
+ return this.events.includes(event.type);
323
+ }
324
+ }, {
325
+ key: "next",
326
+ value: function next(state, _event) {
327
+ var _this8 = this;
328
+
329
+ var eventName = _event.name;
330
+ var actions = [];
331
+ var selectedTransition;
332
+ var candidates = actors_dist_xstateActors.memo(this, "candidates-".concat(eventName.toString()), function () {
333
+ return actors_dist_xstateActors.getCandidates(_this8, eventName, _this8.machine.config.scxml // Whether token matching should be used
334
+ );
335
+ });
336
+
337
+ var _iterator = actors_dist_xstateActors._createForOfIteratorHelper(candidates),
338
+ _step;
339
+
340
+ try {
341
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
342
+ var candidate = _step.value;
343
+ var guard = candidate.guard;
344
+ var resolvedContext = state.context;
345
+ var guardPassed = false;
346
+
347
+ try {
348
+ guardPassed = !guard || actors_dist_xstateActors.evaluateGuard(guard, resolvedContext, _event, state);
349
+ } catch (err) {
350
+ throw new Error("Unable to evaluate guard '".concat(guard.type, "' in transition for event '").concat(eventName, "' in state node '").concat(this.id, "':\n").concat(err.message));
351
+ }
352
+
353
+ if (guardPassed) {
354
+ actions.push.apply(actions, actors_dist_xstateActors._toConsumableArray(candidate.actions));
355
+ selectedTransition = candidate;
356
+ break;
357
+ }
358
+ }
359
+ } catch (err) {
360
+ _iterator.e(err);
361
+ } finally {
362
+ _iterator.f();
363
+ }
364
+
365
+ return selectedTransition ? [selectedTransition] : undefined;
366
+ }
367
+ /**
368
+ * The target state value of the history state node, if it exists. This represents the
369
+ * default state value to transition to if no history value exists yet.
370
+ */
371
+
372
+ }, {
373
+ key: "target",
374
+ get: function get() {
375
+ if (this.type === 'history') {
376
+ var historyConfig = this.config;
377
+ return historyConfig.target;
378
+ }
379
+
380
+ return undefined;
381
+ }
382
+ /**
383
+ * All the state node IDs of this state node and its descendant state nodes.
384
+ */
385
+
386
+ }, {
387
+ key: "stateIds",
388
+ get: function get() {
389
+ var _this9 = this;
390
+
391
+ var childStateIds = actors_dist_xstateActors.flatten(Object.keys(this.states).map(function (stateKey) {
392
+ return _this9.states[stateKey].stateIds;
393
+ }));
394
+ return [this.id].concat(childStateIds);
395
+ }
396
+ /**
397
+ * All the event types accepted by this state node and its descendants.
398
+ */
399
+
400
+ }, {
401
+ key: "events",
402
+ get: function get() {
403
+ var _this10 = this;
404
+
405
+ return actors_dist_xstateActors.memo(this, 'events', function () {
406
+ var states = _this10.states;
407
+ var events = new Set(_this10.ownEvents);
408
+
409
+ if (states) {
410
+ for (var _i = 0, _Object$keys = Object.keys(states); _i < _Object$keys.length; _i++) {
411
+ var stateId = _Object$keys[_i];
412
+ var state = states[stateId];
413
+
414
+ if (state.states) {
415
+ var _iterator2 = actors_dist_xstateActors._createForOfIteratorHelper(state.events),
416
+ _step2;
417
+
418
+ try {
419
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
420
+ var event = _step2.value;
421
+ events.add("".concat(event));
422
+ }
423
+ } catch (err) {
424
+ _iterator2.e(err);
425
+ } finally {
426
+ _iterator2.f();
427
+ }
428
+ }
429
+ }
430
+ }
431
+
432
+ return Array.from(events);
433
+ });
434
+ }
435
+ /**
436
+ * All the events that have transitions directly from this state node.
437
+ *
438
+ * Excludes any inert events.
439
+ */
440
+
441
+ }, {
442
+ key: "ownEvents",
443
+ get: function get() {
444
+ var events = new Set(this.transitions.filter(function (transition) {
445
+ return !(!transition.target && !transition.actions.length && transition.internal);
446
+ }).map(function (transition) {
447
+ return transition.eventType;
448
+ }));
449
+ return Array.from(events);
450
+ }
451
+ }]);
452
+
453
+ return StateNode;
454
+ }();
455
+
456
+ var STATE_IDENTIFIER = '#';
457
+
458
+ function createDefaultOptions() {
459
+ return {
460
+ actions: {},
461
+ actors: {},
462
+ delays: {},
463
+ guards: {},
464
+ context: {}
465
+ };
466
+ }
467
+
468
+ function resolveContext(context, partialContext) {
469
+ if (actors_dist_xstateActors.isFunction(partialContext)) {
470
+ return actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, context), partialContext);
471
+ }
472
+
473
+ return actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, context), partialContext);
474
+ }
475
+
476
+ var StateMachine = /*#__PURE__*/function () {
477
+ function StateMachine(
478
+ /**
479
+ * The raw config used to create the machine.
480
+ */
481
+ config, options) {
482
+ var _this$config$schema;
483
+
484
+ actors_dist_xstateActors._classCallCheck(this, StateMachine);
485
+
486
+ this.config = config;
487
+
488
+ actors_dist_xstateActors._defineProperty(this, "_contextFactory", void 0);
489
+
490
+ actors_dist_xstateActors._defineProperty(this, "version", void 0);
491
+
492
+ actors_dist_xstateActors._defineProperty(this, "delimiter", void 0);
493
+
494
+ actors_dist_xstateActors._defineProperty(this, "options", void 0);
495
+
496
+ actors_dist_xstateActors._defineProperty(this, "schema", void 0);
497
+
498
+ actors_dist_xstateActors._defineProperty(this, "__xstatenode", true);
499
+
500
+ actors_dist_xstateActors._defineProperty(this, "idMap", new Map());
501
+
502
+ actors_dist_xstateActors._defineProperty(this, "root", void 0);
503
+
504
+ actors_dist_xstateActors._defineProperty(this, "id", void 0);
505
+
506
+ actors_dist_xstateActors._defineProperty(this, "states", void 0);
507
+
508
+ actors_dist_xstateActors._defineProperty(this, "events", void 0);
509
+
510
+ actors_dist_xstateActors._defineProperty(this, "__TContext", void 0);
511
+
512
+ actors_dist_xstateActors._defineProperty(this, "__TEvent", void 0);
513
+
514
+ actors_dist_xstateActors._defineProperty(this, "__TAction", void 0);
515
+
516
+ actors_dist_xstateActors._defineProperty(this, "__TActorMap", void 0);
517
+
518
+ actors_dist_xstateActors._defineProperty(this, "__TResolvedTypesMeta", void 0);
519
+
520
+ this.id = config.id || '(machine)';
521
+ this.options = Object.assign(createDefaultOptions(), options);
522
+ this._contextFactory = actors_dist_xstateActors.isFunction(config.context) ? config.context : function (stuff) {
523
+ var partialContext = typeof (options === null || options === void 0 ? void 0 : options.context) === 'function' ? options.context(stuff) : options === null || options === void 0 ? void 0 : options.context;
524
+ return resolveContext(config.context, partialContext);
525
+ }; // TODO: fix types
526
+ // this.context = resolveContext(config.context, options?.context);
527
+
528
+ this.delimiter = this.config.delimiter || actors_dist_xstateActors.STATE_DELIMITER;
529
+ this.version = this.config.version;
530
+ this.schema = (_this$config$schema = this.config.schema) !== null && _this$config$schema !== void 0 ? _this$config$schema : {};
531
+ this.transition = this.transition.bind(this);
532
+ this.root = new StateNode(config, {
533
+ _key: this.id,
534
+ _machine: this
535
+ });
536
+
537
+ this.root._initialize();
538
+
539
+ this.states = this.root.states; // TODO: remove!
540
+
541
+ this.events = this.root.events;
542
+ }
543
+ /**
544
+ * Clones this state machine with the provided implementations
545
+ * and merges the `context` (if provided).
546
+ *
547
+ * @param implementations Options (`actions`, `guards`, `actors`, `delays`, `context`)
548
+ * to recursively merge with the existing options.
549
+ *
550
+ * @returns A new `StateMachine` instance with the provided implementations.
551
+ */
552
+
553
+
554
+ actors_dist_xstateActors._createClass(StateMachine, [{
555
+ key: "context",
556
+ get: function get() {
557
+ return this.getContextAndActions()[0];
558
+ }
559
+ }, {
560
+ key: "getContextAndActions",
561
+ value: function getContextAndActions() {
562
+ var actions = []; // TODO: merge with this.options.context
563
+
564
+ var context = this._contextFactory({
565
+ spawn: actors_dist_xstateActors.createSpawner(this, null, null, actions) // TODO: fix types
566
+
567
+ });
568
+
569
+ return [context, actions];
570
+ }
571
+ /**
572
+ * The machine's own version.
573
+ */
574
+
575
+ }, {
576
+ key: "provide",
577
+ value: function provide(implementations) {
578
+ var _this$options = this.options,
579
+ actions = _this$options.actions,
580
+ guards = _this$options.guards,
581
+ actors = _this$options.actors,
582
+ delays = _this$options.delays;
583
+ return new StateMachine(this.config, {
584
+ actions: actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, actions), implementations.actions),
585
+ guards: actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, guards), implementations.guards),
586
+ actors: actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, actors), implementations.actors),
587
+ delays: actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, delays), implementations.delays),
588
+ context: implementations.context
589
+ });
590
+ }
591
+ /**
592
+ * Clones this state machine with custom `context`.
593
+ *
594
+ * The `context` provided can be partial `context`, which will be combined with the original `context`.
595
+ *
596
+ * @param context Custom context (will override predefined context, not recursive)
597
+ */
598
+
599
+ }, {
600
+ key: "withContext",
601
+ value: function withContext(context) {
602
+ return this.provide({
603
+ context: context
604
+ });
605
+ }
606
+ /**
607
+ * Resolves the given `state` to a new `State` instance relative to this machine.
608
+ *
609
+ * This ensures that `.nextEvents` represent the correct values.
610
+ *
611
+ * @param state The state to resolve
612
+ */
613
+
614
+ }, {
615
+ key: "resolveState",
616
+ value: function resolveState(state) {
617
+ var configurationSet = actors_dist_xstateActors.getConfiguration(actors_dist_xstateActors.getStateNodes(this.root, state.value));
618
+ var configuration = Array.from(configurationSet);
619
+ return this.createState(actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, state), {}, {
620
+ value: actors_dist_xstateActors.resolveStateValue(this.root, state.value),
621
+ configuration: configuration,
622
+ done: actors_dist_xstateActors.isInFinalState(configuration)
623
+ }));
624
+ }
625
+ }, {
626
+ key: "resolveStateValue",
627
+ value: function resolveStateValue(stateValue) {
628
+ var resolvedStateValue = actors_dist_xstateActors.resolveStateValue(this.root, stateValue);
629
+
630
+ var resolvedContext = this.context;
631
+ return this.resolveState(actors_dist_xstateActors.State.from(resolvedStateValue, resolvedContext, this));
632
+ }
633
+ /**
634
+ * Determines the next state given the current `state` and received `event`.
635
+ * Calculates a full macrostep from all microsteps.
636
+ *
637
+ * @param state The current State instance or state value
638
+ * @param event The received event
639
+ */
640
+
641
+ }, {
642
+ key: "transition",
643
+ value: function transition() {
644
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.initialState;
645
+ var event = arguments.length > 1 ? arguments[1] : undefined;
646
+ var actorCtx = arguments.length > 2 ? arguments[2] : undefined;
647
+ var currentState = state instanceof actors_dist_xstateActors.State ? state : this.resolveStateValue(state); // TODO: handle error events in a better way
648
+
649
+ var scxmlEvent = actors_dist_xstateActors.toSCXMLEvent(event);
650
+
651
+ if (actors_dist_xstateActors.isSCXMLErrorEvent(scxmlEvent) && !currentState.nextEvents.some(function (nextEvent) {
652
+ return nextEvent === scxmlEvent.name;
653
+ })) {
654
+ throw scxmlEvent.data.data;
655
+ }
656
+
657
+ var _macrostep = actors_dist_xstateActors.macrostep(currentState, scxmlEvent, actorCtx),
658
+ nextState = _macrostep.state;
659
+
660
+ return nextState;
661
+ }
662
+ /**
663
+ * Determines the next state given the current `state` and `event`.
664
+ * Calculates a microstep.
665
+ *
666
+ * @param state The current state
667
+ * @param event The received event
668
+ */
669
+
670
+ }, {
671
+ key: "microstep",
672
+ value: function microstep() {
673
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.initialState;
674
+ var event = arguments.length > 1 ? arguments[1] : undefined;
675
+ var actorCtx = arguments.length > 2 ? arguments[2] : undefined;
676
+ var scxmlEvent = actors_dist_xstateActors.toSCXMLEvent(event);
677
+
678
+ var _macrostep2 = actors_dist_xstateActors.macrostep(state, scxmlEvent, actorCtx),
679
+ microstates = _macrostep2.microstates;
680
+
681
+ return microstates;
682
+ }
683
+ }, {
684
+ key: "getTransitionData",
685
+ value: function getTransitionData(state, _event) {
686
+ return actors_dist_xstateActors.transitionNode(this.root, state.value, state, _event) || [];
687
+ }
688
+ /**
689
+ * The initial state _before_ evaluating any microsteps.
690
+ * This "pre-initial" state is provided to initial actions executed in the initial state.
691
+ */
692
+
693
+ }, {
694
+ key: "getPreInitialState",
695
+ value: function getPreInitialState(actorCtx) {
696
+ var _actorCtx$sessionId, _preInitial$actions;
697
+
698
+ var _this$getContextAndAc = this.getContextAndActions(),
699
+ _this$getContextAndAc2 = actors_dist_xstateActors._slicedToArray(_this$getContextAndAc, 2),
700
+ context = _this$getContextAndAc2[0],
701
+ actions = _this$getContextAndAc2[1];
702
+
703
+ var config = actors_dist_xstateActors.getInitialConfiguration(this.root);
704
+ var preInitial = this.resolveState(this.createState({
705
+ value: {},
706
+ // TODO: this is computed in state constructor
707
+ context: context,
708
+ _event: actors_dist_xstateActors.initEvent,
709
+ _sessionid: (_actorCtx$sessionId = actorCtx === null || actorCtx === void 0 ? void 0 : actorCtx.sessionId) !== null && _actorCtx$sessionId !== void 0 ? _actorCtx$sessionId : undefined,
710
+ actions: [],
711
+ meta: undefined,
712
+ configuration: config,
713
+ transitions: [],
714
+ children: {}
715
+ }));
716
+ preInitial._initial = true;
717
+
718
+ (_preInitial$actions = preInitial.actions).unshift.apply(_preInitial$actions, actors_dist_xstateActors._toConsumableArray(actions));
719
+
720
+ if (actorCtx) {
721
+ var _resolveActionsAndCon = actors_dist_xstateActors.resolveActionsAndContext(actions, actors_dist_xstateActors.initEvent, preInitial, actorCtx),
722
+ nextState = _resolveActionsAndCon.nextState;
723
+
724
+ preInitial.children = nextState.children;
725
+ preInitial.actions = nextState.actions;
726
+ }
727
+
728
+ return preInitial;
729
+ }
730
+ /**
731
+ * The initial State instance, which includes all actions to be executed from
732
+ * entering the initial state.
733
+ */
734
+
735
+ }, {
736
+ key: "initialState",
737
+ get: function get() {
738
+ return this.getInitialState();
739
+ }
740
+ /**
741
+ * Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
742
+ */
743
+
744
+ }, {
745
+ key: "getInitialState",
746
+ value: function getInitialState(actorCtx) {
747
+ var _nextState$actions;
748
+
749
+ var preInitialState = this.getPreInitialState(actorCtx);
750
+ var nextState = actors_dist_xstateActors.microstep([], preInitialState, actorCtx, actors_dist_xstateActors.initEvent);
751
+
752
+ (_nextState$actions = nextState.actions).unshift.apply(_nextState$actions, actors_dist_xstateActors._toConsumableArray(preInitialState.actions));
753
+
754
+ var _macrostep3 = actors_dist_xstateActors.macrostep(nextState, actors_dist_xstateActors.initEvent, actorCtx),
755
+ macroState = _macrostep3.state;
756
+
757
+ return macroState;
758
+ }
759
+ }, {
760
+ key: "start",
761
+ value: function start(state, actorCtx) {
762
+ // When starting from a restored state, execute the actions
763
+ state.actions.forEach(function (action) {
764
+ var _action$execute;
765
+
766
+ (_action$execute = action.execute) === null || _action$execute === void 0 ? void 0 : _action$execute.call(action, actorCtx);
767
+ });
768
+ return state;
769
+ }
770
+ }, {
771
+ key: "getStateNodeById",
772
+ value: function getStateNodeById(stateId) {
773
+ var resolvedStateId = actors_dist_xstateActors.isStateId(stateId) ? stateId.slice(STATE_IDENTIFIER.length) : stateId;
774
+ var stateNode = this.idMap.get(resolvedStateId);
775
+
776
+ if (!stateNode) {
777
+ throw new Error("Child state node '#".concat(resolvedStateId, "' does not exist on machine '").concat(this.id, "'"));
778
+ }
779
+
780
+ return stateNode;
781
+ }
782
+ }, {
783
+ key: "definition",
784
+ get: function get() {
785
+ return actors_dist_xstateActors._objectSpread2({
786
+ context: this.context
787
+ }, this.root.definition);
788
+ }
789
+ }, {
790
+ key: "toJSON",
791
+ value: function toJSON() {
792
+ return this.definition;
793
+ }
794
+ }, {
795
+ key: "createState",
796
+ value: function createState(stateConfig) {
797
+ var state = stateConfig instanceof actors_dist_xstateActors.State ? stateConfig : new actors_dist_xstateActors.State(stateConfig, this);
798
+
799
+ var _resolveActionsAndCon2 = actors_dist_xstateActors.resolveActionsAndContext(state.actions, state._event, state, undefined),
800
+ resolvedState = _resolveActionsAndCon2.nextState;
801
+
802
+ return resolvedState;
803
+ }
804
+ }, {
805
+ key: "getStatus",
806
+ value: function getStatus(state) {
807
+ return state.done ? {
808
+ status: 'done',
809
+ data: state.output
810
+ } : {
811
+ status: 'active'
812
+ };
813
+ }
814
+ }, {
815
+ key: "restoreState",
816
+ value: function restoreState(state, _actorCtx) {
817
+ var restoredState = actors_dist_xstateActors.isStateConfig(state) ? this.resolveState(state) : this.resolveState(actors_dist_xstateActors.State.from(state, this.context, this));
818
+ return restoredState;
819
+ }
820
+ /**@deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
821
+
822
+ }]);
823
+
824
+ return StateMachine;
825
+ }();
826
+
827
+ function createMachine(config, implementations) {
828
+ return new StateMachine(config, implementations);
829
+ }
830
+
831
+ function mapState(stateMap, stateId) {
832
+ var foundStateId;
833
+
834
+ for (var _i = 0, _Object$keys = Object.keys(stateMap); _i < _Object$keys.length; _i++) {
835
+ var mappedStateId = _Object$keys[_i];
836
+
837
+ if (actors_dist_xstateActors.matchesState(mappedStateId, stateId) && (!foundStateId || stateId.length > foundStateId.length)) {
838
+ foundStateId = mappedStateId;
839
+ }
840
+ }
841
+
842
+ return stateMap[foundStateId];
843
+ }
844
+
845
+ function createSchema(schema) {
846
+ return schema;
847
+ }
848
+ var t = createSchema;
849
+
850
+ var SimulatedClock = /*#__PURE__*/function () {
851
+ function SimulatedClock() {
852
+ actors_dist_xstateActors._classCallCheck(this, SimulatedClock);
853
+
854
+ actors_dist_xstateActors._defineProperty(this, "timeouts", new Map());
855
+
856
+ actors_dist_xstateActors._defineProperty(this, "_now", 0);
857
+
858
+ actors_dist_xstateActors._defineProperty(this, "_id", 0);
859
+ }
860
+
861
+ actors_dist_xstateActors._createClass(SimulatedClock, [{
862
+ key: "now",
863
+ value: function now() {
864
+ return this._now;
865
+ }
866
+ }, {
867
+ key: "getId",
868
+ value: function getId() {
869
+ return this._id++;
870
+ }
871
+ }, {
872
+ key: "setTimeout",
873
+ value: function setTimeout(fn, timeout) {
874
+ var id = this.getId();
875
+ this.timeouts.set(id, {
876
+ start: this.now(),
877
+ timeout: timeout,
878
+ fn: fn
879
+ });
880
+ return id;
881
+ }
882
+ }, {
883
+ key: "clearTimeout",
884
+ value: function clearTimeout(id) {
885
+ this.timeouts["delete"](id);
886
+ }
887
+ }, {
888
+ key: "set",
889
+ value: function set(time) {
890
+ if (this._now > time) {
891
+ throw new Error('Unable to travel back in time');
892
+ }
893
+
894
+ this._now = time;
895
+ this.flushTimeouts();
896
+ }
897
+ }, {
898
+ key: "flushTimeouts",
899
+ value: function flushTimeouts() {
900
+ var _this = this;
901
+
902
+ actors_dist_xstateActors._toConsumableArray(this.timeouts).sort(function (_ref, _ref2) {
903
+ var _ref3 = actors_dist_xstateActors._slicedToArray(_ref, 2),
904
+ _idA = _ref3[0],
905
+ timeoutA = _ref3[1];
906
+
907
+ var _ref4 = actors_dist_xstateActors._slicedToArray(_ref2, 2),
908
+ _idB = _ref4[0],
909
+ timeoutB = _ref4[1];
910
+
911
+ var endA = timeoutA.start + timeoutA.timeout;
912
+ var endB = timeoutB.start + timeoutB.timeout;
913
+ return endB > endA ? -1 : 1;
914
+ }).forEach(function (_ref5) {
915
+ var _ref6 = actors_dist_xstateActors._slicedToArray(_ref5, 2),
916
+ id = _ref6[0],
917
+ timeout = _ref6[1];
918
+
919
+ if (_this.now() - timeout.start >= timeout.timeout) {
920
+ _this.timeouts["delete"](id);
921
+
922
+ timeout.fn.call(null);
923
+ }
924
+ });
925
+ }
926
+ }, {
927
+ key: "increment",
928
+ value: function increment(ms) {
929
+ this._now += ms;
930
+ this.flushTimeouts();
931
+ }
932
+ }]);
933
+
934
+ return SimulatedClock;
935
+ }();
936
+
937
+ var actions = {
938
+ raise: actors_dist_xstateActors.raise,
939
+ send: actors_dist_xstateActors.send,
940
+ sendParent: actors_dist_xstateActors.sendParent,
941
+ sendTo: actors_dist_xstateActors.sendTo,
942
+ log: actors_dist_xstateActors.log,
943
+ cancel: actors_dist_xstateActors.cancel,
944
+ stop: actors_dist_xstateActors.stop,
945
+ assign: actors_dist_xstateActors.assign,
946
+ after: actors_dist_xstateActors.after,
947
+ done: actors_dist_xstateActors.done,
948
+ respond: actors_dist_xstateActors.respond,
949
+ forwardTo: actors_dist_xstateActors.forwardTo,
950
+ escalate: actors_dist_xstateActors.escalate,
951
+ choose: actors_dist_xstateActors.choose,
952
+ pure: pure
953
+ };
954
+
955
+ Object.defineProperty(exports, 'ActionTypes', {
956
+ enumerable: true,
957
+ get: function () {
958
+ return actors_dist_xstateActors.ActionTypes;
959
+ }
960
+ });
961
+ exports.Interpreter = actors_dist_xstateActors.Interpreter;
962
+ Object.defineProperty(exports, 'InterpreterStatus', {
963
+ enumerable: true,
964
+ get: function () {
965
+ return actors_dist_xstateActors.ActorStatus;
966
+ }
967
+ });
968
+ Object.defineProperty(exports, 'SpecialTargets', {
969
+ enumerable: true,
970
+ get: function () {
971
+ return actors_dist_xstateActors.SpecialTargets;
972
+ }
973
+ });
974
+ exports.State = actors_dist_xstateActors.State;
975
+ exports.assign = actors_dist_xstateActors.assign;
976
+ exports.doneInvoke = actors_dist_xstateActors.doneInvoke;
977
+ exports.forwardTo = actors_dist_xstateActors.forwardTo;
978
+ exports.getStateNodes = actors_dist_xstateActors.getStateNodes;
979
+ exports.interpret = actors_dist_xstateActors.interpret;
980
+ exports.matchesState = actors_dist_xstateActors.matchesState;
981
+ exports.pathToStateValue = actors_dist_xstateActors.pathToStateValue;
982
+ exports.send = actors_dist_xstateActors.send;
983
+ exports.sendParent = actors_dist_xstateActors.sendParent;
984
+ exports.toObserver = actors_dist_xstateActors.toObserver;
985
+ exports.toSCXMLEvent = actors_dist_xstateActors.toSCXMLEvent;
986
+ exports.SimulatedClock = SimulatedClock;
987
+ exports.StateMachine = StateMachine;
988
+ exports.StateNode = StateNode;
989
+ exports.actions = actions;
990
+ exports.createMachine = createMachine;
991
+ exports.createSchema = createSchema;
992
+ exports.mapState = mapState;
993
+ exports.t = t;