xstate 5.0.0-beta.40 → 5.0.0-beta.41

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 (43) hide show
  1. package/actions/dist/xstate-actions.cjs.js +3 -3
  2. package/actions/dist/xstate-actions.development.cjs.js +3 -3
  3. package/actions/dist/xstate-actions.development.esm.js +3 -3
  4. package/actions/dist/xstate-actions.esm.js +3 -3
  5. package/actions/dist/xstate-actions.umd.min.js +1 -1
  6. package/actions/dist/xstate-actions.umd.min.js.map +1 -1
  7. package/actors/dist/xstate-actors.cjs.js +1 -1
  8. package/actors/dist/xstate-actors.development.cjs.js +1 -1
  9. package/actors/dist/xstate-actors.development.esm.js +1 -1
  10. package/actors/dist/xstate-actors.esm.js +1 -1
  11. package/actors/dist/xstate-actors.umd.min.js +1 -1
  12. package/actors/dist/xstate-actors.umd.min.js.map +1 -1
  13. package/dist/declarations/src/State.d.ts +1 -1
  14. package/dist/declarations/src/StateMachine.d.ts +1 -1
  15. package/dist/declarations/src/index.d.ts +2 -2
  16. package/dist/declarations/src/interpreter.d.ts +2 -10
  17. package/dist/declarations/src/types.d.ts +4 -9
  18. package/dist/{interpreter-ed0fac7e.esm.js → interpreter-480db258.esm.js} +26 -31
  19. package/dist/{interpreter-bae5c279.development.cjs.js → interpreter-70ed981b.development.cjs.js} +26 -32
  20. package/dist/{interpreter-410d7ca9.development.esm.js → interpreter-936da690.development.esm.js} +26 -31
  21. package/dist/{interpreter-586abde4.cjs.js → interpreter-fb2829f1.cjs.js} +26 -32
  22. package/dist/{raise-8325e2df.development.cjs.js → raise-5ab465ed.development.cjs.js} +9 -9
  23. package/dist/{raise-2b2fdec3.esm.js → raise-9d6921da.esm.js} +8 -8
  24. package/dist/{raise-27909189.cjs.js → raise-beae3fd3.cjs.js} +8 -8
  25. package/dist/{raise-37f9f3b8.development.esm.js → raise-f757be00.development.esm.js} +9 -9
  26. package/dist/{send-59f66c58.esm.js → send-a931d1b8.esm.js} +4 -5
  27. package/dist/{send-f6b49072.development.esm.js → send-b26e3812.development.esm.js} +4 -5
  28. package/dist/{send-4fdf275e.cjs.js → send-ca5f706c.cjs.js} +4 -5
  29. package/dist/{send-c45d0d2c.development.cjs.js → send-fb87a01a.development.cjs.js} +4 -5
  30. package/dist/xstate.cjs.js +7 -10
  31. package/dist/xstate.cjs.mjs +0 -2
  32. package/dist/xstate.development.cjs.js +7 -10
  33. package/dist/xstate.development.cjs.mjs +0 -2
  34. package/dist/xstate.development.esm.js +10 -11
  35. package/dist/xstate.esm.js +10 -11
  36. package/dist/xstate.umd.min.js +1 -1
  37. package/dist/xstate.umd.min.js.map +1 -1
  38. package/guards/dist/xstate-guards.cjs.js +2 -2
  39. package/guards/dist/xstate-guards.development.cjs.js +2 -2
  40. package/guards/dist/xstate-guards.development.esm.js +2 -2
  41. package/guards/dist/xstate-guards.esm.js +2 -2
  42. package/guards/dist/xstate-guards.umd.min.js.map +1 -1
  43. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var interpreter = require('./interpreter-bae5c279.development.cjs.js');
3
+ var interpreter = require('./interpreter-70ed981b.development.cjs.js');
4
4
 
5
5
  const cache = new WeakMap();
6
6
  function memo(object, key, fn) {
@@ -63,7 +63,7 @@ function resolveSpawn(actorScope, state, actionArgs, _actionParams, {
63
63
  const configuredInput = input || referenced.input;
64
64
  actorRef = interpreter.createActor(referenced.src, {
65
65
  id: resolvedId,
66
- src: typeof src === 'string' ? src : undefined,
66
+ src,
67
67
  parent: actorScope?.self,
68
68
  systemId,
69
69
  input: typeof configuredInput === 'function' ? configuredInput({
@@ -107,7 +107,7 @@ function executeSpawn(actorScope, {
107
107
  return;
108
108
  }
109
109
  actorScope.defer(() => {
110
- if (actorRef.status === interpreter.ActorStatus.Stopped) {
110
+ if (actorRef._processingStatus === interpreter.ProcessingStatus.Stopped) {
111
111
  return;
112
112
  }
113
113
  try {
@@ -168,7 +168,7 @@ function executeStop(actorScope, actorRef) {
168
168
 
169
169
  // this allows us to prevent an actor from being started if it gets stopped within the same macrostep
170
170
  // this can happen, for example, when the invoking state is being exited immediately by an always transition
171
- if (actorRef.status !== interpreter.ActorStatus.Running) {
171
+ if (actorRef._processingStatus !== interpreter.ProcessingStatus.Running) {
172
172
  actorScope.stopChild(actorRef);
173
173
  return;
174
174
  }
@@ -1129,7 +1129,7 @@ function resolveActionsAndContextWorker(currentState, event, actorScope, actions
1129
1129
  event
1130
1130
  }) : action.params : undefined;
1131
1131
  if (!('resolve' in resolvedAction)) {
1132
- if (actorScope?.self.status === interpreter.ActorStatus.Running) {
1132
+ if (actorScope?.self._processingStatus === interpreter.ProcessingStatus.Running) {
1133
1133
  resolvedAction(actionArgs, actionParams);
1134
1134
  } else {
1135
1135
  actorScope?.defer(() => {
@@ -1147,7 +1147,7 @@ function resolveActionsAndContextWorker(currentState, event, actorScope, actions
1147
1147
  retries?.push([builtinAction, params]);
1148
1148
  }
1149
1149
  if ('execute' in builtinAction) {
1150
- if (actorScope?.self.status === interpreter.ActorStatus.Running) {
1150
+ if (actorScope?.self._processingStatus === interpreter.ProcessingStatus.Running) {
1151
1151
  builtinAction.execute(actorScope, params);
1152
1152
  } else {
1153
1153
  actorScope?.defer(builtinAction.execute.bind(null, actorScope, params));
@@ -1428,7 +1428,7 @@ function cloneState(state, config = {}) {
1428
1428
  ...config
1429
1429
  }, state.machine);
1430
1430
  }
1431
- function getPersistedState(state) {
1431
+ function getPersistedState(state, options) {
1432
1432
  const {
1433
1433
  configuration,
1434
1434
  tags,
@@ -1440,11 +1440,11 @@ function getPersistedState(state) {
1440
1440
  const childrenJson = {};
1441
1441
  for (const id in children) {
1442
1442
  const child = children[id];
1443
- if (typeof child.src !== 'string') {
1443
+ if (typeof child.src !== 'string' && (!options || !('__unsafeAllowInlineActors' in options))) {
1444
1444
  throw new Error('An inline child actor cannot be persisted.');
1445
1445
  }
1446
1446
  childrenJson[id] = {
1447
- state: child.getPersistedState(),
1447
+ state: child.getPersistedState(options),
1448
1448
  src: child.src,
1449
1449
  systemId: child._systemId
1450
1450
  };
@@ -1,4 +1,4 @@
1
- import { r as resolveReferencedActor, d as createActor, f as ActorStatus, j as createErrorActorEvent, k as toStateValue, l as STATE_IDENTIFIER, n as normalizeTarget, t as toArray, N as NULL_EVENT, a as toTransitionConfigArray, S as STATE_DELIMITER, o as toStatePath, q as createDoneStateEvent, s as resolveOutput, X as XSTATE_STOP, u as XSTATE_INIT, W as WILDCARD, v as createAfterEvent, w as flatten, e as matchesState, $ as $$ACTOR_TYPE } from './interpreter-ed0fac7e.esm.js';
1
+ import { r as resolveReferencedActor, d as createActor, P as ProcessingStatus, h as createErrorActorEvent, j as toStateValue, k as STATE_IDENTIFIER, n as normalizeTarget, t as toArray, N as NULL_EVENT, a as toTransitionConfigArray, S as STATE_DELIMITER, l as toStatePath, o as createDoneStateEvent, q as resolveOutput, X as XSTATE_STOP, s as XSTATE_INIT, W as WILDCARD, u as createAfterEvent, v as flatten, e as matchesState, $ as $$ACTOR_TYPE } from './interpreter-480db258.esm.js';
2
2
 
3
3
  const cache = new WeakMap();
4
4
  function memo(object, key, fn) {
@@ -58,7 +58,7 @@ function resolveSpawn(actorScope, state, actionArgs, _actionParams, {
58
58
  const configuredInput = input || referenced.input;
59
59
  actorRef = createActor(referenced.src, {
60
60
  id: resolvedId,
61
- src: typeof src === 'string' ? src : undefined,
61
+ src,
62
62
  parent: actorScope?.self,
63
63
  systemId,
64
64
  input: typeof configuredInput === 'function' ? configuredInput({
@@ -99,7 +99,7 @@ function executeSpawn(actorScope, {
99
99
  return;
100
100
  }
101
101
  actorScope.defer(() => {
102
- if (actorRef.status === ActorStatus.Stopped) {
102
+ if (actorRef._processingStatus === ProcessingStatus.Stopped) {
103
103
  return;
104
104
  }
105
105
  try {
@@ -157,7 +157,7 @@ function executeStop(actorScope, actorRef) {
157
157
 
158
158
  // this allows us to prevent an actor from being started if it gets stopped within the same macrostep
159
159
  // this can happen, for example, when the invoking state is being exited immediately by an always transition
160
- if (actorRef.status !== ActorStatus.Running) {
160
+ if (actorRef._processingStatus !== ProcessingStatus.Running) {
161
161
  actorScope.stopChild(actorRef);
162
162
  return;
163
163
  }
@@ -1096,7 +1096,7 @@ function resolveActionsAndContextWorker(currentState, event, actorScope, actions
1096
1096
  event
1097
1097
  }) : action.params : undefined;
1098
1098
  if (!('resolve' in resolvedAction)) {
1099
- if (actorScope?.self.status === ActorStatus.Running) {
1099
+ if (actorScope?.self._processingStatus === ProcessingStatus.Running) {
1100
1100
  resolvedAction(actionArgs, actionParams);
1101
1101
  } else {
1102
1102
  actorScope?.defer(() => {
@@ -1114,7 +1114,7 @@ function resolveActionsAndContextWorker(currentState, event, actorScope, actions
1114
1114
  retries?.push([builtinAction, params]);
1115
1115
  }
1116
1116
  if ('execute' in builtinAction) {
1117
- if (actorScope?.self.status === ActorStatus.Running) {
1117
+ if (actorScope?.self._processingStatus === ProcessingStatus.Running) {
1118
1118
  builtinAction.execute(actorScope, params);
1119
1119
  } else {
1120
1120
  actorScope?.defer(builtinAction.execute.bind(null, actorScope, params));
@@ -1389,7 +1389,7 @@ function cloneState(state, config = {}) {
1389
1389
  ...config
1390
1390
  }, state.machine);
1391
1391
  }
1392
- function getPersistedState(state) {
1392
+ function getPersistedState(state, options) {
1393
1393
  const {
1394
1394
  configuration,
1395
1395
  tags,
@@ -1402,7 +1402,7 @@ function getPersistedState(state) {
1402
1402
  for (const id in children) {
1403
1403
  const child = children[id];
1404
1404
  childrenJson[id] = {
1405
- state: child.getPersistedState(),
1405
+ state: child.getPersistedState(options),
1406
1406
  src: child.src,
1407
1407
  systemId: child._systemId
1408
1408
  };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var interpreter = require('./interpreter-586abde4.cjs.js');
3
+ var interpreter = require('./interpreter-fb2829f1.cjs.js');
4
4
 
5
5
  const cache = new WeakMap();
6
6
  function memo(object, key, fn) {
@@ -60,7 +60,7 @@ function resolveSpawn(actorScope, state, actionArgs, _actionParams, {
60
60
  const configuredInput = input || referenced.input;
61
61
  actorRef = interpreter.createActor(referenced.src, {
62
62
  id: resolvedId,
63
- src: typeof src === 'string' ? src : undefined,
63
+ src,
64
64
  parent: actorScope?.self,
65
65
  systemId,
66
66
  input: typeof configuredInput === 'function' ? configuredInput({
@@ -101,7 +101,7 @@ function executeSpawn(actorScope, {
101
101
  return;
102
102
  }
103
103
  actorScope.defer(() => {
104
- if (actorRef.status === interpreter.ActorStatus.Stopped) {
104
+ if (actorRef._processingStatus === interpreter.ProcessingStatus.Stopped) {
105
105
  return;
106
106
  }
107
107
  try {
@@ -159,7 +159,7 @@ function executeStop(actorScope, actorRef) {
159
159
 
160
160
  // this allows us to prevent an actor from being started if it gets stopped within the same macrostep
161
161
  // this can happen, for example, when the invoking state is being exited immediately by an always transition
162
- if (actorRef.status !== interpreter.ActorStatus.Running) {
162
+ if (actorRef._processingStatus !== interpreter.ProcessingStatus.Running) {
163
163
  actorScope.stopChild(actorRef);
164
164
  return;
165
165
  }
@@ -1098,7 +1098,7 @@ function resolveActionsAndContextWorker(currentState, event, actorScope, actions
1098
1098
  event
1099
1099
  }) : action.params : undefined;
1100
1100
  if (!('resolve' in resolvedAction)) {
1101
- if (actorScope?.self.status === interpreter.ActorStatus.Running) {
1101
+ if (actorScope?.self._processingStatus === interpreter.ProcessingStatus.Running) {
1102
1102
  resolvedAction(actionArgs, actionParams);
1103
1103
  } else {
1104
1104
  actorScope?.defer(() => {
@@ -1116,7 +1116,7 @@ function resolveActionsAndContextWorker(currentState, event, actorScope, actions
1116
1116
  retries?.push([builtinAction, params]);
1117
1117
  }
1118
1118
  if ('execute' in builtinAction) {
1119
- if (actorScope?.self.status === interpreter.ActorStatus.Running) {
1119
+ if (actorScope?.self._processingStatus === interpreter.ProcessingStatus.Running) {
1120
1120
  builtinAction.execute(actorScope, params);
1121
1121
  } else {
1122
1122
  actorScope?.defer(builtinAction.execute.bind(null, actorScope, params));
@@ -1391,7 +1391,7 @@ function cloneState(state, config = {}) {
1391
1391
  ...config
1392
1392
  }, state.machine);
1393
1393
  }
1394
- function getPersistedState(state) {
1394
+ function getPersistedState(state, options) {
1395
1395
  const {
1396
1396
  configuration,
1397
1397
  tags,
@@ -1404,7 +1404,7 @@ function getPersistedState(state) {
1404
1404
  for (const id in children) {
1405
1405
  const child = children[id];
1406
1406
  childrenJson[id] = {
1407
- state: child.getPersistedState(),
1407
+ state: child.getPersistedState(options),
1408
1408
  src: child.src,
1409
1409
  systemId: child._systemId
1410
1410
  };
@@ -1,4 +1,4 @@
1
- import { r as resolveReferencedActor, d as createActor, f as ActorStatus, j as createErrorActorEvent, k as toStateValue, l as STATE_IDENTIFIER, n as normalizeTarget, t as toArray, N as NULL_EVENT, a as toTransitionConfigArray, S as STATE_DELIMITER, o as toStatePath, q as createDoneStateEvent, s as resolveOutput, W as WILDCARD, X as XSTATE_STOP, u as XSTATE_INIT, v as createAfterEvent, w as flatten, e as matchesState, $ as $$ACTOR_TYPE } from './interpreter-410d7ca9.development.esm.js';
1
+ import { r as resolveReferencedActor, d as createActor, P as ProcessingStatus, h as createErrorActorEvent, j as toStateValue, k as STATE_IDENTIFIER, n as normalizeTarget, t as toArray, N as NULL_EVENT, a as toTransitionConfigArray, S as STATE_DELIMITER, l as toStatePath, o as createDoneStateEvent, q as resolveOutput, W as WILDCARD, X as XSTATE_STOP, s as XSTATE_INIT, u as createAfterEvent, v as flatten, e as matchesState, $ as $$ACTOR_TYPE } from './interpreter-936da690.development.esm.js';
2
2
 
3
3
  const cache = new WeakMap();
4
4
  function memo(object, key, fn) {
@@ -61,7 +61,7 @@ function resolveSpawn(actorScope, state, actionArgs, _actionParams, {
61
61
  const configuredInput = input || referenced.input;
62
62
  actorRef = createActor(referenced.src, {
63
63
  id: resolvedId,
64
- src: typeof src === 'string' ? src : undefined,
64
+ src,
65
65
  parent: actorScope?.self,
66
66
  systemId,
67
67
  input: typeof configuredInput === 'function' ? configuredInput({
@@ -105,7 +105,7 @@ function executeSpawn(actorScope, {
105
105
  return;
106
106
  }
107
107
  actorScope.defer(() => {
108
- if (actorRef.status === ActorStatus.Stopped) {
108
+ if (actorRef._processingStatus === ProcessingStatus.Stopped) {
109
109
  return;
110
110
  }
111
111
  try {
@@ -166,7 +166,7 @@ function executeStop(actorScope, actorRef) {
166
166
 
167
167
  // this allows us to prevent an actor from being started if it gets stopped within the same macrostep
168
168
  // this can happen, for example, when the invoking state is being exited immediately by an always transition
169
- if (actorRef.status !== ActorStatus.Running) {
169
+ if (actorRef._processingStatus !== ProcessingStatus.Running) {
170
170
  actorScope.stopChild(actorRef);
171
171
  return;
172
172
  }
@@ -1127,7 +1127,7 @@ function resolveActionsAndContextWorker(currentState, event, actorScope, actions
1127
1127
  event
1128
1128
  }) : action.params : undefined;
1129
1129
  if (!('resolve' in resolvedAction)) {
1130
- if (actorScope?.self.status === ActorStatus.Running) {
1130
+ if (actorScope?.self._processingStatus === ProcessingStatus.Running) {
1131
1131
  resolvedAction(actionArgs, actionParams);
1132
1132
  } else {
1133
1133
  actorScope?.defer(() => {
@@ -1145,7 +1145,7 @@ function resolveActionsAndContextWorker(currentState, event, actorScope, actions
1145
1145
  retries?.push([builtinAction, params]);
1146
1146
  }
1147
1147
  if ('execute' in builtinAction) {
1148
- if (actorScope?.self.status === ActorStatus.Running) {
1148
+ if (actorScope?.self._processingStatus === ProcessingStatus.Running) {
1149
1149
  builtinAction.execute(actorScope, params);
1150
1150
  } else {
1151
1151
  actorScope?.defer(builtinAction.execute.bind(null, actorScope, params));
@@ -1426,7 +1426,7 @@ function cloneState(state, config = {}) {
1426
1426
  ...config
1427
1427
  }, state.machine);
1428
1428
  }
1429
- function getPersistedState(state) {
1429
+ function getPersistedState(state, options) {
1430
1430
  const {
1431
1431
  configuration,
1432
1432
  tags,
@@ -1438,11 +1438,11 @@ function getPersistedState(state) {
1438
1438
  const childrenJson = {};
1439
1439
  for (const id in children) {
1440
1440
  const child = children[id];
1441
- if (typeof child.src !== 'string') {
1441
+ if (typeof child.src !== 'string' && (!options || !('__unsafeAllowInlineActors' in options))) {
1442
1442
  throw new Error('An inline child actor cannot be persisted.');
1443
1443
  }
1444
1444
  childrenJson[id] = {
1445
- state: child.getPersistedState(),
1445
+ state: child.getPersistedState(options),
1446
1446
  src: child.src,
1447
1447
  systemId: child._systemId
1448
1448
  };
@@ -1,5 +1,5 @@
1
- import { j as cloneState, e as evaluateGuard } from './raise-2b2fdec3.esm.js';
2
- import { f as ActorStatus, j as createErrorActorEvent, r as resolveReferencedActor, d as createActor, t as toArray, x as XSTATE_ERROR } from './interpreter-ed0fac7e.esm.js';
1
+ import { j as cloneState, e as evaluateGuard } from './raise-9d6921da.esm.js';
2
+ import { P as ProcessingStatus, h as createErrorActorEvent, r as resolveReferencedActor, d as createActor, t as toArray, w as XSTATE_ERROR } from './interpreter-480db258.esm.js';
3
3
 
4
4
  function createSpawner(actorScope, {
5
5
  machine,
@@ -44,12 +44,11 @@ function createSpawner(actorScope, {
44
44
  }
45
45
  return actorRef;
46
46
  } else {
47
- // TODO: this should also receive `src`
48
47
  const actorRef = createActor(src, {
49
48
  id: options.id,
50
49
  parent: actorScope.self,
51
50
  input: options.input,
52
- src: undefined,
51
+ src,
53
52
  systemId
54
53
  });
55
54
  if (options.syncSnapshot) {
@@ -73,7 +72,7 @@ function createSpawner(actorScope, {
73
72
  const actorRef = spawn(src, options); // TODO: fix types
74
73
  spawnedChildren[actorRef.id] = actorRef;
75
74
  actorScope.defer(() => {
76
- if (actorRef.status === ActorStatus.Stopped) {
75
+ if (actorRef._processingStatus === ProcessingStatus.Stopped) {
77
76
  return;
78
77
  }
79
78
  try {
@@ -1,5 +1,5 @@
1
- import { j as cloneState, e as evaluateGuard } from './raise-37f9f3b8.development.esm.js';
2
- import { f as ActorStatus, j as createErrorActorEvent, r as resolveReferencedActor, d as createActor, t as toArray, x as XSTATE_ERROR } from './interpreter-410d7ca9.development.esm.js';
1
+ import { j as cloneState, e as evaluateGuard } from './raise-f757be00.development.esm.js';
2
+ import { P as ProcessingStatus, h as createErrorActorEvent, r as resolveReferencedActor, d as createActor, t as toArray, w as XSTATE_ERROR } from './interpreter-936da690.development.esm.js';
3
3
 
4
4
  function createSpawner(actorScope, {
5
5
  machine,
@@ -44,12 +44,11 @@ function createSpawner(actorScope, {
44
44
  }
45
45
  return actorRef;
46
46
  } else {
47
- // TODO: this should also receive `src`
48
47
  const actorRef = createActor(src, {
49
48
  id: options.id,
50
49
  parent: actorScope.self,
51
50
  input: options.input,
52
- src: undefined,
51
+ src,
53
52
  systemId
54
53
  });
55
54
  if (options.syncSnapshot) {
@@ -73,7 +72,7 @@ function createSpawner(actorScope, {
73
72
  const actorRef = spawn(src, options); // TODO: fix types
74
73
  spawnedChildren[actorRef.id] = actorRef;
75
74
  actorScope.defer(() => {
76
- if (actorRef.status === ActorStatus.Stopped) {
75
+ if (actorRef._processingStatus === ProcessingStatus.Stopped) {
77
76
  return;
78
77
  }
79
78
  try {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var guards_dist_xstateGuards = require('./raise-27909189.cjs.js');
4
- var interpreter = require('./interpreter-586abde4.cjs.js');
3
+ var guards_dist_xstateGuards = require('./raise-beae3fd3.cjs.js');
4
+ var interpreter = require('./interpreter-fb2829f1.cjs.js');
5
5
 
6
6
  function createSpawner(actorScope, {
7
7
  machine,
@@ -46,12 +46,11 @@ function createSpawner(actorScope, {
46
46
  }
47
47
  return actorRef;
48
48
  } else {
49
- // TODO: this should also receive `src`
50
49
  const actorRef = interpreter.createActor(src, {
51
50
  id: options.id,
52
51
  parent: actorScope.self,
53
52
  input: options.input,
54
- src: undefined,
53
+ src,
55
54
  systemId
56
55
  });
57
56
  if (options.syncSnapshot) {
@@ -75,7 +74,7 @@ function createSpawner(actorScope, {
75
74
  const actorRef = spawn(src, options); // TODO: fix types
76
75
  spawnedChildren[actorRef.id] = actorRef;
77
76
  actorScope.defer(() => {
78
- if (actorRef.status === interpreter.ActorStatus.Stopped) {
77
+ if (actorRef._processingStatus === interpreter.ProcessingStatus.Stopped) {
79
78
  return;
80
79
  }
81
80
  try {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var guards_dist_xstateGuards = require('./raise-8325e2df.development.cjs.js');
4
- var interpreter = require('./interpreter-bae5c279.development.cjs.js');
3
+ var guards_dist_xstateGuards = require('./raise-5ab465ed.development.cjs.js');
4
+ var interpreter = require('./interpreter-70ed981b.development.cjs.js');
5
5
 
6
6
  function createSpawner(actorScope, {
7
7
  machine,
@@ -46,12 +46,11 @@ function createSpawner(actorScope, {
46
46
  }
47
47
  return actorRef;
48
48
  } else {
49
- // TODO: this should also receive `src`
50
49
  const actorRef = interpreter.createActor(src, {
51
50
  id: options.id,
52
51
  parent: actorScope.self,
53
52
  input: options.input,
54
- src: undefined,
53
+ src,
55
54
  systemId
56
55
  });
57
56
  if (options.syncSnapshot) {
@@ -75,7 +74,7 @@ function createSpawner(actorScope, {
75
74
  const actorRef = spawn(src, options); // TODO: fix types
76
75
  spawnedChildren[actorRef.id] = actorRef;
77
76
  actorScope.defer(() => {
78
- if (actorRef.status === interpreter.ActorStatus.Stopped) {
77
+ if (actorRef._processingStatus === interpreter.ProcessingStatus.Stopped) {
79
78
  return;
80
79
  }
81
80
  try {
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var actors_dist_xstateActors = require('../actors/dist/xstate-actors.cjs.js');
6
- var interpreter = require('./interpreter-586abde4.cjs.js');
7
- var guards_dist_xstateGuards = require('./raise-27909189.cjs.js');
8
- var send = require('./send-4fdf275e.cjs.js');
6
+ var interpreter = require('./interpreter-fb2829f1.cjs.js');
7
+ var guards_dist_xstateGuards = require('./raise-beae3fd3.cjs.js');
8
+ var send = require('./send-ca5f706c.cjs.js');
9
9
  require('../dev/dist/xstate-dev.cjs.js');
10
10
 
11
11
  class SimulatedClock {
@@ -403,7 +403,6 @@ class StateMachine {
403
403
  this.getInitialState = this.getInitialState.bind(this);
404
404
  this.restoreState = this.restoreState.bind(this);
405
405
  this.start = this.start.bind(this);
406
- this.getPersistedState = this.getPersistedState.bind(this);
407
406
  this.root = new StateNode(config, {
408
407
  _key: this.id,
409
408
  _machine: this
@@ -579,8 +578,8 @@ class StateMachine {
579
578
  toJSON() {
580
579
  return this.definition;
581
580
  }
582
- getPersistedState(state) {
583
- return guards_dist_xstateGuards.getPersistedState(state);
581
+ getPersistedState(state, options) {
582
+ return guards_dist_xstateGuards.getPersistedState(state, options);
584
583
  }
585
584
  createState(stateConfig) {
586
585
  return stateConfig instanceof guards_dist_xstateGuards.State ? stateConfig : new guards_dist_xstateGuards.State(stateConfig, this);
@@ -592,7 +591,7 @@ class StateMachine {
592
591
  const actorData = snapshotChildren[actorId];
593
592
  const childState = actorData.state;
594
593
  const src = actorData.src;
595
- const logic = src ? interpreter.resolveReferencedActor(this, src)?.src : undefined;
594
+ const logic = typeof src === 'string' ? interpreter.resolveReferencedActor(this, src)?.src : src;
596
595
  if (!logic) {
597
596
  return;
598
597
  }
@@ -635,7 +634,7 @@ class StateMachine {
635
634
  }
636
635
 
637
636
  const defaultWaitForOptions = {
638
- timeout: 10_000 // 10 seconds
637
+ timeout: Infinity // much more than 10 seconds
639
638
  };
640
639
 
641
640
  /**
@@ -726,8 +725,6 @@ exports.fromObservable = actors_dist_xstateActors.fromObservable;
726
725
  exports.fromPromise = actors_dist_xstateActors.fromPromise;
727
726
  exports.fromTransition = actors_dist_xstateActors.fromTransition;
728
727
  exports.Actor = interpreter.Actor;
729
- exports.ActorStatus = interpreter.ActorStatus;
730
- exports.InterpreterStatus = interpreter.InterpreterStatus;
731
728
  exports.createActor = interpreter.createActor;
732
729
  exports.interpret = interpreter.interpret;
733
730
  exports.matchesState = interpreter.matchesState;
@@ -1,7 +1,5 @@
1
1
  export {
2
2
  Actor,
3
- ActorStatus,
4
- InterpreterStatus,
5
3
  SimulatedClock,
6
4
  SpecialTargets,
7
5
  State,
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var actors_dist_xstateActors = require('../actors/dist/xstate-actors.development.cjs.js');
6
- var interpreter = require('./interpreter-bae5c279.development.cjs.js');
7
- var guards_dist_xstateGuards = require('./raise-8325e2df.development.cjs.js');
8
- var send = require('./send-c45d0d2c.development.cjs.js');
6
+ var interpreter = require('./interpreter-70ed981b.development.cjs.js');
7
+ var guards_dist_xstateGuards = require('./raise-5ab465ed.development.cjs.js');
8
+ var send = require('./send-fb87a01a.development.cjs.js');
9
9
  require('../dev/dist/xstate-dev.development.cjs.js');
10
10
 
11
11
  class SimulatedClock {
@@ -403,7 +403,6 @@ class StateMachine {
403
403
  this.getInitialState = this.getInitialState.bind(this);
404
404
  this.restoreState = this.restoreState.bind(this);
405
405
  this.start = this.start.bind(this);
406
- this.getPersistedState = this.getPersistedState.bind(this);
407
406
  this.root = new StateNode(config, {
408
407
  _key: this.id,
409
408
  _machine: this
@@ -582,8 +581,8 @@ class StateMachine {
582
581
  toJSON() {
583
582
  return this.definition;
584
583
  }
585
- getPersistedState(state) {
586
- return guards_dist_xstateGuards.getPersistedState(state);
584
+ getPersistedState(state, options) {
585
+ return guards_dist_xstateGuards.getPersistedState(state, options);
587
586
  }
588
587
  createState(stateConfig) {
589
588
  return stateConfig instanceof guards_dist_xstateGuards.State ? stateConfig : new guards_dist_xstateGuards.State(stateConfig, this);
@@ -595,7 +594,7 @@ class StateMachine {
595
594
  const actorData = snapshotChildren[actorId];
596
595
  const childState = actorData.state;
597
596
  const src = actorData.src;
598
- const logic = src ? interpreter.resolveReferencedActor(this, src)?.src : undefined;
597
+ const logic = typeof src === 'string' ? interpreter.resolveReferencedActor(this, src)?.src : src;
599
598
  if (!logic) {
600
599
  return;
601
600
  }
@@ -638,7 +637,7 @@ class StateMachine {
638
637
  }
639
638
 
640
639
  const defaultWaitForOptions = {
641
- timeout: 10_000 // 10 seconds
640
+ timeout: Infinity // much more than 10 seconds
642
641
  };
643
642
 
644
643
  /**
@@ -732,8 +731,6 @@ exports.fromObservable = actors_dist_xstateActors.fromObservable;
732
731
  exports.fromPromise = actors_dist_xstateActors.fromPromise;
733
732
  exports.fromTransition = actors_dist_xstateActors.fromTransition;
734
733
  exports.Actor = interpreter.Actor;
735
- exports.ActorStatus = interpreter.ActorStatus;
736
- exports.InterpreterStatus = interpreter.InterpreterStatus;
737
734
  exports.createActor = interpreter.createActor;
738
735
  exports.interpret = interpreter.interpret;
739
736
  exports.matchesState = interpreter.matchesState;
@@ -1,7 +1,5 @@
1
1
  export {
2
2
  Actor,
3
- ActorStatus,
4
- InterpreterStatus,
5
3
  SimulatedClock,
6
4
  SpecialTargets,
7
5
  State,
@@ -1,10 +1,10 @@
1
1
  export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.development.esm.js';
2
- import { S as STATE_DELIMITER, m as mapValues, t as toArray, a as toTransitionConfigArray, N as NULL_EVENT, c as createInvokeId, i as isErrorActorEvent, b as createInitEvent, r as resolveReferencedActor, d as createActor, $ as $$ACTOR_TYPE, e as matchesState } from './interpreter-410d7ca9.development.esm.js';
3
- export { A as Actor, f as ActorStatus, I as InterpreterStatus, d as createActor, g as interpret, e as matchesState, p as pathToStateValue, h as toObserver } from './interpreter-410d7ca9.development.esm.js';
4
- import { f as formatTransitions, a as formatTransition, m as memo, e as evaluateGuard, g as getDelayedTransitions, b as formatInitialTransition, c as getCandidates, d as getConfiguration, h as getStateNodes, r as resolveStateValue, i as isInFinalState, S as State, j as cloneState, k as macrostep, t as transitionNode, l as getInitialConfiguration, n as resolveActionsAndContext, o as microstep, p as getInitialStateNodes, q as isStateId, s as getStateNodeByPath, u as getPersistedState } from './raise-37f9f3b8.development.esm.js';
5
- export { S as State, v as and, z as cancel, h as getStateNodes, w as not, x as or, A as raise, C as spawn, y as stateIn, B as stop } from './raise-37f9f3b8.development.esm.js';
6
- import { a as assign } from './send-f6b49072.development.esm.js';
7
- export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent, b as sendTo } from './send-f6b49072.development.esm.js';
2
+ import { S as STATE_DELIMITER, m as mapValues, t as toArray, a as toTransitionConfigArray, N as NULL_EVENT, c as createInvokeId, i as isErrorActorEvent, b as createInitEvent, r as resolveReferencedActor, d as createActor, $ as $$ACTOR_TYPE, e as matchesState } from './interpreter-936da690.development.esm.js';
3
+ export { A as Actor, d as createActor, f as interpret, e as matchesState, p as pathToStateValue, g as toObserver } from './interpreter-936da690.development.esm.js';
4
+ import { f as formatTransitions, a as formatTransition, m as memo, e as evaluateGuard, g as getDelayedTransitions, b as formatInitialTransition, c as getCandidates, d as getConfiguration, h as getStateNodes, r as resolveStateValue, i as isInFinalState, S as State, j as cloneState, k as macrostep, t as transitionNode, l as getInitialConfiguration, n as resolveActionsAndContext, o as microstep, p as getInitialStateNodes, q as isStateId, s as getStateNodeByPath, u as getPersistedState } from './raise-f757be00.development.esm.js';
5
+ export { S as State, v as and, z as cancel, h as getStateNodes, w as not, x as or, A as raise, C as spawn, y as stateIn, B as stop } from './raise-f757be00.development.esm.js';
6
+ import { a as assign } from './send-b26e3812.development.esm.js';
7
+ export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent, b as sendTo } from './send-b26e3812.development.esm.js';
8
8
  import '../dev/dist/xstate-dev.development.esm.js';
9
9
 
10
10
  class SimulatedClock {
@@ -402,7 +402,6 @@ class StateMachine {
402
402
  this.getInitialState = this.getInitialState.bind(this);
403
403
  this.restoreState = this.restoreState.bind(this);
404
404
  this.start = this.start.bind(this);
405
- this.getPersistedState = this.getPersistedState.bind(this);
406
405
  this.root = new StateNode(config, {
407
406
  _key: this.id,
408
407
  _machine: this
@@ -581,8 +580,8 @@ class StateMachine {
581
580
  toJSON() {
582
581
  return this.definition;
583
582
  }
584
- getPersistedState(state) {
585
- return getPersistedState(state);
583
+ getPersistedState(state, options) {
584
+ return getPersistedState(state, options);
586
585
  }
587
586
  createState(stateConfig) {
588
587
  return stateConfig instanceof State ? stateConfig : new State(stateConfig, this);
@@ -594,7 +593,7 @@ class StateMachine {
594
593
  const actorData = snapshotChildren[actorId];
595
594
  const childState = actorData.state;
596
595
  const src = actorData.src;
597
- const logic = src ? resolveReferencedActor(this, src)?.src : undefined;
596
+ const logic = typeof src === 'string' ? resolveReferencedActor(this, src)?.src : src;
598
597
  if (!logic) {
599
598
  return;
600
599
  }
@@ -637,7 +636,7 @@ class StateMachine {
637
636
  }
638
637
 
639
638
  const defaultWaitForOptions = {
640
- timeout: 10_000 // 10 seconds
639
+ timeout: Infinity // much more than 10 seconds
641
640
  };
642
641
 
643
642
  /**
@@ -1,10 +1,10 @@
1
1
  export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.esm.js';
2
- import { S as STATE_DELIMITER, m as mapValues, t as toArray, a as toTransitionConfigArray, N as NULL_EVENT, c as createInvokeId, i as isErrorActorEvent, b as createInitEvent, r as resolveReferencedActor, d as createActor, $ as $$ACTOR_TYPE, e as matchesState } from './interpreter-ed0fac7e.esm.js';
3
- export { A as Actor, f as ActorStatus, I as InterpreterStatus, d as createActor, g as interpret, e as matchesState, p as pathToStateValue, h as toObserver } from './interpreter-ed0fac7e.esm.js';
4
- import { f as formatTransitions, a as formatTransition, m as memo, e as evaluateGuard, g as getDelayedTransitions, b as formatInitialTransition, c as getCandidates, d as getConfiguration, h as getStateNodes, r as resolveStateValue, i as isInFinalState, S as State, j as cloneState, k as macrostep, t as transitionNode, l as getInitialConfiguration, n as resolveActionsAndContext, o as microstep, p as getInitialStateNodes, q as isStateId, s as getStateNodeByPath, u as getPersistedState } from './raise-2b2fdec3.esm.js';
5
- export { S as State, v as and, z as cancel, h as getStateNodes, w as not, x as or, A as raise, C as spawn, y as stateIn, B as stop } from './raise-2b2fdec3.esm.js';
6
- import { a as assign } from './send-59f66c58.esm.js';
7
- export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent, b as sendTo } from './send-59f66c58.esm.js';
2
+ import { S as STATE_DELIMITER, m as mapValues, t as toArray, a as toTransitionConfigArray, N as NULL_EVENT, c as createInvokeId, i as isErrorActorEvent, b as createInitEvent, r as resolveReferencedActor, d as createActor, $ as $$ACTOR_TYPE, e as matchesState } from './interpreter-480db258.esm.js';
3
+ export { A as Actor, d as createActor, f as interpret, e as matchesState, p as pathToStateValue, g as toObserver } from './interpreter-480db258.esm.js';
4
+ import { f as formatTransitions, a as formatTransition, m as memo, e as evaluateGuard, g as getDelayedTransitions, b as formatInitialTransition, c as getCandidates, d as getConfiguration, h as getStateNodes, r as resolveStateValue, i as isInFinalState, S as State, j as cloneState, k as macrostep, t as transitionNode, l as getInitialConfiguration, n as resolveActionsAndContext, o as microstep, p as getInitialStateNodes, q as isStateId, s as getStateNodeByPath, u as getPersistedState } from './raise-9d6921da.esm.js';
5
+ export { S as State, v as and, z as cancel, h as getStateNodes, w as not, x as or, A as raise, C as spawn, y as stateIn, B as stop } from './raise-9d6921da.esm.js';
6
+ import { a as assign } from './send-a931d1b8.esm.js';
7
+ export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent, b as sendTo } from './send-a931d1b8.esm.js';
8
8
  import '../dev/dist/xstate-dev.esm.js';
9
9
 
10
10
  class SimulatedClock {
@@ -402,7 +402,6 @@ class StateMachine {
402
402
  this.getInitialState = this.getInitialState.bind(this);
403
403
  this.restoreState = this.restoreState.bind(this);
404
404
  this.start = this.start.bind(this);
405
- this.getPersistedState = this.getPersistedState.bind(this);
406
405
  this.root = new StateNode(config, {
407
406
  _key: this.id,
408
407
  _machine: this
@@ -578,8 +577,8 @@ class StateMachine {
578
577
  toJSON() {
579
578
  return this.definition;
580
579
  }
581
- getPersistedState(state) {
582
- return getPersistedState(state);
580
+ getPersistedState(state, options) {
581
+ return getPersistedState(state, options);
583
582
  }
584
583
  createState(stateConfig) {
585
584
  return stateConfig instanceof State ? stateConfig : new State(stateConfig, this);
@@ -591,7 +590,7 @@ class StateMachine {
591
590
  const actorData = snapshotChildren[actorId];
592
591
  const childState = actorData.state;
593
592
  const src = actorData.src;
594
- const logic = src ? resolveReferencedActor(this, src)?.src : undefined;
593
+ const logic = typeof src === 'string' ? resolveReferencedActor(this, src)?.src : src;
595
594
  if (!logic) {
596
595
  return;
597
596
  }
@@ -634,7 +633,7 @@ class StateMachine {
634
633
  }
635
634
 
636
635
  const defaultWaitForOptions = {
637
- timeout: 10_000 // 10 seconds
636
+ timeout: Infinity // much more than 10 seconds
638
637
  };
639
638
 
640
639
  /**