xstate 5.32.5 → 5.32.6

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 (44) hide show
  1. package/dist/{StateMachine-e8cf6f23.development.esm.js → StateMachine-28a9f50e.esm.js} +21 -14
  2. package/dist/{StateMachine-1fa46288.cjs.js → StateMachine-3778f5e0.development.cjs.js} +27 -8
  3. package/dist/{StateMachine-6005ae8c.development.cjs.js → StateMachine-3f520def.cjs.js} +21 -14
  4. package/dist/{StateMachine-5f345bba.esm.js → StateMachine-fffbf42d.development.esm.js} +27 -8
  5. package/dist/{assign-29f23f4d.esm.js → assign-54f9e2d3.esm.js} +1 -1
  6. package/dist/{assign-393c348f.development.esm.js → assign-c349a5e8.development.esm.js} +1 -1
  7. package/dist/{assign-20143fe8.cjs.js → assign-d3f33159.cjs.js} +1 -1
  8. package/dist/{assign-7cba842c.development.cjs.js → assign-f03a9bed.development.cjs.js} +1 -1
  9. package/dist/{log-63926232.development.cjs.js → log-0ed3e43f.development.cjs.js} +6 -5
  10. package/dist/{log-e4ef3ed1.development.esm.js → log-140dec60.development.esm.js} +6 -5
  11. package/dist/{log-92e88543.cjs.js → log-3beea04f.cjs.js} +6 -5
  12. package/dist/{log-79409d72.esm.js → log-66075555.esm.js} +6 -5
  13. package/dist/{raise-dd1ee3d1.development.cjs.js → raise-53e20da7.development.cjs.js} +8 -4
  14. package/dist/{raise-5fb0c8ca.esm.js → raise-8dd8aaec.esm.js} +8 -4
  15. package/dist/{raise-16ff4f94.cjs.js → raise-a26997bd.cjs.js} +7 -3
  16. package/dist/{raise-0d6481d1.development.esm.js → raise-c90786ef.development.esm.js} +9 -5
  17. package/dist/xstate-actions.cjs.js +3 -3
  18. package/dist/xstate-actions.development.cjs.js +3 -3
  19. package/dist/xstate-actions.development.esm.js +3 -3
  20. package/dist/xstate-actions.esm.js +3 -3
  21. package/dist/xstate-actions.umd.min.js.map +1 -1
  22. package/dist/xstate-actors.cjs.js +1 -1
  23. package/dist/xstate-actors.development.cjs.js +1 -1
  24. package/dist/xstate-actors.development.esm.js +1 -1
  25. package/dist/xstate-actors.esm.js +1 -1
  26. package/dist/xstate-actors.umd.min.js.map +1 -1
  27. package/dist/xstate-graph.cjs.js +4 -4
  28. package/dist/xstate-graph.development.cjs.js +4 -4
  29. package/dist/xstate-graph.development.esm.js +4 -4
  30. package/dist/xstate-graph.esm.js +4 -4
  31. package/dist/xstate-graph.umd.min.js +1 -1
  32. package/dist/xstate-graph.umd.min.js.map +1 -1
  33. package/dist/xstate-guards.cjs.js +1 -1
  34. package/dist/xstate-guards.development.cjs.js +1 -1
  35. package/dist/xstate-guards.development.esm.js +1 -1
  36. package/dist/xstate-guards.esm.js +1 -1
  37. package/dist/xstate-guards.umd.min.js.map +1 -1
  38. package/dist/xstate.cjs.js +9 -10
  39. package/dist/xstate.development.cjs.js +9 -10
  40. package/dist/xstate.development.esm.js +13 -14
  41. package/dist/xstate.esm.js +13 -14
  42. package/dist/xstate.umd.min.js +1 -1
  43. package/dist/xstate.umd.min.js.map +1 -1
  44. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { S as STATE_DELIMITER, z as mapValues, t as toArray, B as formatTransitions, C as toTransitionConfigArray, D as formatTransition, N as NULL_EVENT, E as evaluateGuard, F as createInvokeId, G as getDelayedTransitions, H as formatInitialTransition, I as getCandidates, J as formatRouteTransitions, K as resolveStateValue, L as getAllStateNodes, q as getStateNodes, M as createMachineSnapshot, O as isInFinalState, e as macrostep, P as transitionNode, Q as resolveActionsAndContext, f as createInitEvent, g as initialMicrostep, R as toStatePath, T as isStateId, U as getStateNodeByPath, V as getPersistedSnapshot, W as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-0d6481d1.development.esm.js';
2
- import { a as assign } from './assign-393c348f.development.esm.js';
1
+ import { S as STATE_DELIMITER, z as mapValues, t as toArray, B as formatTransitions, C as toTransitionConfigArray, D as formatTransition, N as NULL_EVENT, E as evaluateGuard, F as createInvokeId, G as getDelayedTransitions, H as formatInitialTransition, I as getCandidates, J as formatRouteTransitions, K as resolveStateValue, L as getAllStateNodes, q as getStateNodes, M as createMachineSnapshot, O as isInFinalState, e as macrostep, P as transitionNode, Q as resolveActionsAndContext, f as createInitEvent, g as initialMicrostep, R as cloneMachineSnapshot, T as toStatePath, U as isStateId, V as getStateNodeByPath, W as getPersistedSnapshot, Y as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-8dd8aaec.esm.js';
2
+ import { a as assign } from './assign-54f9e2d3.esm.js';
3
3
 
4
4
  const cache = new WeakMap();
5
5
  function memo(object, key, fn) {
@@ -335,9 +335,6 @@ class StateMachine {
335
335
  formatRouteTransitions(this.root);
336
336
  this.states = this.root.states; // TODO: remove!
337
337
  this.events = this.root.events;
338
- if (!('output' in this.root) && Object.values(this.states).some(state => state.type === 'final' && 'output' in state)) {
339
- console.warn('Missing `machine.output` declaration (top-level final state with output detected)');
340
- }
341
338
  }
342
339
 
343
340
  /**
@@ -450,12 +447,25 @@ class StateMachine {
450
447
  getInitialSnapshot(actorScope, input) {
451
448
  const initEvent = createInitEvent(input); // TODO: fix;
452
449
  const internalQueue = [];
453
- const preInitialState = this._getPreInitialState(actorScope, initEvent, internalQueue);
454
- const [nextState] = initialMicrostep(this.root, preInitialState, actorScope, initEvent, internalQueue);
455
- const {
456
- snapshot: macroState
457
- } = macrostep(nextState, initEvent, actorScope, internalQueue);
458
- return macroState;
450
+ let snapshot = createMachineSnapshot({
451
+ context: typeof this.config.context !== 'function' && this.config.context ? this.config.context : {},
452
+ _nodes: [this.root],
453
+ children: {},
454
+ status: 'active'
455
+ }, this);
456
+ try {
457
+ snapshot = this._getPreInitialState(actorScope, initEvent, internalQueue);
458
+ const [nextState] = initialMicrostep(this.root, snapshot, actorScope, initEvent, internalQueue);
459
+ const {
460
+ snapshot: macroState
461
+ } = macrostep(nextState, initEvent, actorScope, internalQueue);
462
+ return macroState;
463
+ } catch (error) {
464
+ return cloneMachineSnapshot(snapshot, {
465
+ status: 'error',
466
+ error
467
+ });
468
+ }
459
469
  }
460
470
  start(snapshot) {
461
471
  Object.values(snapshot.children).forEach(child => {
@@ -511,9 +521,6 @@ class StateMachine {
511
521
  try {
512
522
  return root.machine.getStateNodeById(referenced.id);
513
523
  } catch {
514
- {
515
- console.warn(`Could not resolve StateNode for id: ${referenced.id}`);
516
- }
517
524
  }
518
525
  }
519
526
  function reviveHistoryValue(root, historyValue) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var dist_xstateGuards = require('./raise-16ff4f94.cjs.js');
4
- var assign = require('./assign-20143fe8.cjs.js');
3
+ var dist_xstateGuards = require('./raise-53e20da7.development.cjs.js');
4
+ var assign = require('./assign-f03a9bed.development.cjs.js');
5
5
 
6
6
  const cache = new WeakMap();
7
7
  function memo(object, key, fn) {
@@ -337,6 +337,9 @@ class StateMachine {
337
337
  dist_xstateGuards.formatRouteTransitions(this.root);
338
338
  this.states = this.root.states; // TODO: remove!
339
339
  this.events = this.root.events;
340
+ if (!('output' in this.root) && Object.values(this.states).some(state => state.type === 'final' && 'output' in state)) {
341
+ console.warn('Missing `machine.output` declaration (top-level final state with output detected)');
342
+ }
340
343
  }
341
344
 
342
345
  /**
@@ -449,12 +452,25 @@ class StateMachine {
449
452
  getInitialSnapshot(actorScope, input) {
450
453
  const initEvent = dist_xstateGuards.createInitEvent(input); // TODO: fix;
451
454
  const internalQueue = [];
452
- const preInitialState = this._getPreInitialState(actorScope, initEvent, internalQueue);
453
- const [nextState] = dist_xstateGuards.initialMicrostep(this.root, preInitialState, actorScope, initEvent, internalQueue);
454
- const {
455
- snapshot: macroState
456
- } = dist_xstateGuards.macrostep(nextState, initEvent, actorScope, internalQueue);
457
- return macroState;
455
+ let snapshot = dist_xstateGuards.createMachineSnapshot({
456
+ context: typeof this.config.context !== 'function' && this.config.context ? this.config.context : {},
457
+ _nodes: [this.root],
458
+ children: {},
459
+ status: 'active'
460
+ }, this);
461
+ try {
462
+ snapshot = this._getPreInitialState(actorScope, initEvent, internalQueue);
463
+ const [nextState] = dist_xstateGuards.initialMicrostep(this.root, snapshot, actorScope, initEvent, internalQueue);
464
+ const {
465
+ snapshot: macroState
466
+ } = dist_xstateGuards.macrostep(nextState, initEvent, actorScope, internalQueue);
467
+ return macroState;
468
+ } catch (error) {
469
+ return dist_xstateGuards.cloneMachineSnapshot(snapshot, {
470
+ status: 'error',
471
+ error
472
+ });
473
+ }
458
474
  }
459
475
  start(snapshot) {
460
476
  Object.values(snapshot.children).forEach(child => {
@@ -510,6 +526,9 @@ class StateMachine {
510
526
  try {
511
527
  return root.machine.getStateNodeById(referenced.id);
512
528
  } catch {
529
+ {
530
+ console.warn(`Could not resolve StateNode for id: ${referenced.id}`);
531
+ }
513
532
  }
514
533
  }
515
534
  function reviveHistoryValue(root, historyValue) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var dist_xstateGuards = require('./raise-dd1ee3d1.development.cjs.js');
4
- var assign = require('./assign-7cba842c.development.cjs.js');
3
+ var dist_xstateGuards = require('./raise-a26997bd.cjs.js');
4
+ var assign = require('./assign-d3f33159.cjs.js');
5
5
 
6
6
  const cache = new WeakMap();
7
7
  function memo(object, key, fn) {
@@ -337,9 +337,6 @@ class StateMachine {
337
337
  dist_xstateGuards.formatRouteTransitions(this.root);
338
338
  this.states = this.root.states; // TODO: remove!
339
339
  this.events = this.root.events;
340
- if (!('output' in this.root) && Object.values(this.states).some(state => state.type === 'final' && 'output' in state)) {
341
- console.warn('Missing `machine.output` declaration (top-level final state with output detected)');
342
- }
343
340
  }
344
341
 
345
342
  /**
@@ -452,12 +449,25 @@ class StateMachine {
452
449
  getInitialSnapshot(actorScope, input) {
453
450
  const initEvent = dist_xstateGuards.createInitEvent(input); // TODO: fix;
454
451
  const internalQueue = [];
455
- const preInitialState = this._getPreInitialState(actorScope, initEvent, internalQueue);
456
- const [nextState] = dist_xstateGuards.initialMicrostep(this.root, preInitialState, actorScope, initEvent, internalQueue);
457
- const {
458
- snapshot: macroState
459
- } = dist_xstateGuards.macrostep(nextState, initEvent, actorScope, internalQueue);
460
- return macroState;
452
+ let snapshot = dist_xstateGuards.createMachineSnapshot({
453
+ context: typeof this.config.context !== 'function' && this.config.context ? this.config.context : {},
454
+ _nodes: [this.root],
455
+ children: {},
456
+ status: 'active'
457
+ }, this);
458
+ try {
459
+ snapshot = this._getPreInitialState(actorScope, initEvent, internalQueue);
460
+ const [nextState] = dist_xstateGuards.initialMicrostep(this.root, snapshot, actorScope, initEvent, internalQueue);
461
+ const {
462
+ snapshot: macroState
463
+ } = dist_xstateGuards.macrostep(nextState, initEvent, actorScope, internalQueue);
464
+ return macroState;
465
+ } catch (error) {
466
+ return dist_xstateGuards.cloneMachineSnapshot(snapshot, {
467
+ status: 'error',
468
+ error
469
+ });
470
+ }
461
471
  }
462
472
  start(snapshot) {
463
473
  Object.values(snapshot.children).forEach(child => {
@@ -513,9 +523,6 @@ class StateMachine {
513
523
  try {
514
524
  return root.machine.getStateNodeById(referenced.id);
515
525
  } catch {
516
- {
517
- console.warn(`Could not resolve StateNode for id: ${referenced.id}`);
518
- }
519
526
  }
520
527
  }
521
528
  function reviveHistoryValue(root, historyValue) {
@@ -1,5 +1,5 @@
1
- import { S as STATE_DELIMITER, z as mapValues, t as toArray, B as formatTransitions, C as toTransitionConfigArray, D as formatTransition, N as NULL_EVENT, E as evaluateGuard, F as createInvokeId, G as getDelayedTransitions, H as formatInitialTransition, I as getCandidates, J as formatRouteTransitions, K as resolveStateValue, L as getAllStateNodes, q as getStateNodes, M as createMachineSnapshot, O as isInFinalState, e as macrostep, P as transitionNode, Q as resolveActionsAndContext, f as createInitEvent, g as initialMicrostep, R as toStatePath, T as isStateId, U as getStateNodeByPath, V as getPersistedSnapshot, W as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-5fb0c8ca.esm.js';
2
- import { a as assign } from './assign-29f23f4d.esm.js';
1
+ import { S as STATE_DELIMITER, z as mapValues, t as toArray, B as formatTransitions, C as toTransitionConfigArray, D as formatTransition, N as NULL_EVENT, E as evaluateGuard, F as createInvokeId, G as getDelayedTransitions, H as formatInitialTransition, I as getCandidates, J as formatRouteTransitions, K as resolveStateValue, L as getAllStateNodes, q as getStateNodes, M as createMachineSnapshot, O as isInFinalState, e as macrostep, P as transitionNode, Q as resolveActionsAndContext, f as createInitEvent, g as initialMicrostep, R as cloneMachineSnapshot, T as toStatePath, U as isStateId, V as getStateNodeByPath, W as getPersistedSnapshot, Y as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-c90786ef.development.esm.js';
2
+ import { a as assign } from './assign-c349a5e8.development.esm.js';
3
3
 
4
4
  const cache = new WeakMap();
5
5
  function memo(object, key, fn) {
@@ -335,6 +335,9 @@ class StateMachine {
335
335
  formatRouteTransitions(this.root);
336
336
  this.states = this.root.states; // TODO: remove!
337
337
  this.events = this.root.events;
338
+ if (!('output' in this.root) && Object.values(this.states).some(state => state.type === 'final' && 'output' in state)) {
339
+ console.warn('Missing `machine.output` declaration (top-level final state with output detected)');
340
+ }
338
341
  }
339
342
 
340
343
  /**
@@ -447,12 +450,25 @@ class StateMachine {
447
450
  getInitialSnapshot(actorScope, input) {
448
451
  const initEvent = createInitEvent(input); // TODO: fix;
449
452
  const internalQueue = [];
450
- const preInitialState = this._getPreInitialState(actorScope, initEvent, internalQueue);
451
- const [nextState] = initialMicrostep(this.root, preInitialState, actorScope, initEvent, internalQueue);
452
- const {
453
- snapshot: macroState
454
- } = macrostep(nextState, initEvent, actorScope, internalQueue);
455
- return macroState;
453
+ let snapshot = createMachineSnapshot({
454
+ context: typeof this.config.context !== 'function' && this.config.context ? this.config.context : {},
455
+ _nodes: [this.root],
456
+ children: {},
457
+ status: 'active'
458
+ }, this);
459
+ try {
460
+ snapshot = this._getPreInitialState(actorScope, initEvent, internalQueue);
461
+ const [nextState] = initialMicrostep(this.root, snapshot, actorScope, initEvent, internalQueue);
462
+ const {
463
+ snapshot: macroState
464
+ } = macrostep(nextState, initEvent, actorScope, internalQueue);
465
+ return macroState;
466
+ } catch (error) {
467
+ return cloneMachineSnapshot(snapshot, {
468
+ status: 'error',
469
+ error
470
+ });
471
+ }
456
472
  }
457
473
  start(snapshot) {
458
474
  Object.values(snapshot.children).forEach(child => {
@@ -508,6 +524,9 @@ class StateMachine {
508
524
  try {
509
525
  return root.machine.getStateNodeById(referenced.id);
510
526
  } catch {
527
+ {
528
+ console.warn(`Could not resolve StateNode for id: ${referenced.id}`);
529
+ }
511
530
  }
512
531
  }
513
532
  function reviveHistoryValue(root, historyValue) {
@@ -1,4 +1,4 @@
1
- import { _ as ProcessingStatus, W as resolveReferencedActor, c as createActor, a0 as cloneMachineSnapshot } from './raise-5fb0c8ca.esm.js';
1
+ import { a0 as ProcessingStatus, Y as resolveReferencedActor, c as createActor, R as cloneMachineSnapshot } from './raise-8dd8aaec.esm.js';
2
2
 
3
3
  function createSpawner(actorScope, {
4
4
  machine,
@@ -1,4 +1,4 @@
1
- import { a0 as ProcessingStatus, W as resolveReferencedActor, c as createActor, a1 as cloneMachineSnapshot, Y as executingCustomAction } from './raise-0d6481d1.development.esm.js';
1
+ import { a1 as ProcessingStatus, Y as resolveReferencedActor, c as createActor, R as cloneMachineSnapshot, Z as executingCustomAction } from './raise-c90786ef.development.esm.js';
2
2
 
3
3
  function createSpawner(actorScope, {
4
4
  machine,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var dist_xstateGuards = require('./raise-16ff4f94.cjs.js');
3
+ var dist_xstateGuards = require('./raise-a26997bd.cjs.js');
4
4
 
5
5
  function createSpawner(actorScope, {
6
6
  machine,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var dist_xstateGuards = require('./raise-dd1ee3d1.development.cjs.js');
3
+ var dist_xstateGuards = require('./raise-53e20da7.development.cjs.js');
4
4
 
5
5
  function createSpawner(actorScope, {
6
6
  machine,
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var dist_xstateGuards = require('./raise-dd1ee3d1.development.cjs.js');
4
- var assign = require('./assign-7cba842c.development.cjs.js');
3
+ var dist_xstateGuards = require('./raise-53e20da7.development.cjs.js');
4
+ var assign = require('./assign-f03a9bed.development.cjs.js');
5
5
 
6
6
  function resolveEmit(_, snapshot, args, actionParams, {
7
7
  event: eventOrExpr
@@ -70,6 +70,7 @@ eventOrExpr) {
70
70
  }
71
71
 
72
72
  // this is needed to make JSDoc `@link` work properly
73
+ // oxlint-disable-next-line no-unused-vars
73
74
 
74
75
  /**
75
76
  * @remarks
@@ -170,7 +171,7 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
170
171
  const delaysMap = snapshot.machine.implementations.delays;
171
172
  if (typeof eventOrExpr === 'string') {
172
173
  throw new Error(
173
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
174
+ // oxlint-disable-next-line typescript/restrict-template-expressions
174
175
  `Only event objects may be used with sendTo; use sendTo({ type: "${eventOrExpr}" }) instead`);
175
176
  }
176
177
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;
@@ -184,11 +185,11 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
184
185
  const resolvedTarget = typeof to === 'function' ? to(args, actionParams) : to;
185
186
  let targetActorRef;
186
187
  if (typeof resolvedTarget === 'string') {
187
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
188
+ // oxlint-disable-next-line typescript/no-unsafe-enum-comparison
188
189
  if (resolvedTarget === SpecialTargets.Parent) {
189
190
  targetActorRef = actorScope.self._parent;
190
191
  }
191
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
192
+ // oxlint-disable-next-line typescript/no-unsafe-enum-comparison
192
193
  else if (resolvedTarget === SpecialTargets.Internal) {
193
194
  targetActorRef = actorScope.self;
194
195
  } else if (resolvedTarget.startsWith('#_')) {
@@ -1,5 +1,5 @@
1
- import { Y as executingCustomAction, Z as XSTATE_ERROR, _ as createErrorActorEvent, E as evaluateGuard, b as cancel, r as raise, d as spawnChild, s as stopChild } from './raise-0d6481d1.development.esm.js';
2
- import { a as assign } from './assign-393c348f.development.esm.js';
1
+ import { Z as executingCustomAction, _ as XSTATE_ERROR, a0 as createErrorActorEvent, E as evaluateGuard, b as cancel, r as raise, d as spawnChild, s as stopChild } from './raise-c90786ef.development.esm.js';
2
+ import { a as assign } from './assign-c349a5e8.development.esm.js';
3
3
 
4
4
  function resolveEmit(_, snapshot, args, actionParams, {
5
5
  event: eventOrExpr
@@ -68,6 +68,7 @@ eventOrExpr) {
68
68
  }
69
69
 
70
70
  // this is needed to make JSDoc `@link` work properly
71
+ // oxlint-disable-next-line no-unused-vars
71
72
 
72
73
  /**
73
74
  * @remarks
@@ -168,7 +169,7 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
168
169
  const delaysMap = snapshot.machine.implementations.delays;
169
170
  if (typeof eventOrExpr === 'string') {
170
171
  throw new Error(
171
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
172
+ // oxlint-disable-next-line typescript/restrict-template-expressions
172
173
  `Only event objects may be used with sendTo; use sendTo({ type: "${eventOrExpr}" }) instead`);
173
174
  }
174
175
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;
@@ -182,11 +183,11 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
182
183
  const resolvedTarget = typeof to === 'function' ? to(args, actionParams) : to;
183
184
  let targetActorRef;
184
185
  if (typeof resolvedTarget === 'string') {
185
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
186
+ // oxlint-disable-next-line typescript/no-unsafe-enum-comparison
186
187
  if (resolvedTarget === SpecialTargets.Parent) {
187
188
  targetActorRef = actorScope.self._parent;
188
189
  }
189
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
190
+ // oxlint-disable-next-line typescript/no-unsafe-enum-comparison
190
191
  else if (resolvedTarget === SpecialTargets.Internal) {
191
192
  targetActorRef = actorScope.self;
192
193
  } else if (resolvedTarget.startsWith('#_')) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var dist_xstateGuards = require('./raise-16ff4f94.cjs.js');
4
- var assign = require('./assign-20143fe8.cjs.js');
3
+ var dist_xstateGuards = require('./raise-a26997bd.cjs.js');
4
+ var assign = require('./assign-d3f33159.cjs.js');
5
5
 
6
6
  function resolveEmit(_, snapshot, args, actionParams, {
7
7
  event: eventOrExpr
@@ -64,6 +64,7 @@ eventOrExpr) {
64
64
  }
65
65
 
66
66
  // this is needed to make JSDoc `@link` work properly
67
+ // oxlint-disable-next-line no-unused-vars
67
68
 
68
69
  /**
69
70
  * @remarks
@@ -164,7 +165,7 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
164
165
  const delaysMap = snapshot.machine.implementations.delays;
165
166
  if (typeof eventOrExpr === 'string') {
166
167
  throw new Error(
167
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
168
+ // oxlint-disable-next-line typescript/restrict-template-expressions
168
169
  `Only event objects may be used with sendTo; use sendTo({ type: "${eventOrExpr}" }) instead`);
169
170
  }
170
171
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;
@@ -178,11 +179,11 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
178
179
  const resolvedTarget = typeof to === 'function' ? to(args, actionParams) : to;
179
180
  let targetActorRef;
180
181
  if (typeof resolvedTarget === 'string') {
181
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
182
+ // oxlint-disable-next-line typescript/no-unsafe-enum-comparison
182
183
  if (resolvedTarget === SpecialTargets.Parent) {
183
184
  targetActorRef = actorScope.self._parent;
184
185
  }
185
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
186
+ // oxlint-disable-next-line typescript/no-unsafe-enum-comparison
186
187
  else if (resolvedTarget === SpecialTargets.Internal) {
187
188
  targetActorRef = actorScope.self;
188
189
  } else if (resolvedTarget.startsWith('#_')) {
@@ -1,5 +1,5 @@
1
- import { Y as XSTATE_ERROR, Z as createErrorActorEvent, E as evaluateGuard, b as cancel, r as raise, d as spawnChild, s as stopChild } from './raise-5fb0c8ca.esm.js';
2
- import { a as assign } from './assign-29f23f4d.esm.js';
1
+ import { Z as XSTATE_ERROR, _ as createErrorActorEvent, E as evaluateGuard, b as cancel, r as raise, d as spawnChild, s as stopChild } from './raise-8dd8aaec.esm.js';
2
+ import { a as assign } from './assign-54f9e2d3.esm.js';
3
3
 
4
4
  function resolveEmit(_, snapshot, args, actionParams, {
5
5
  event: eventOrExpr
@@ -62,6 +62,7 @@ eventOrExpr) {
62
62
  }
63
63
 
64
64
  // this is needed to make JSDoc `@link` work properly
65
+ // oxlint-disable-next-line no-unused-vars
65
66
 
66
67
  /**
67
68
  * @remarks
@@ -162,7 +163,7 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
162
163
  const delaysMap = snapshot.machine.implementations.delays;
163
164
  if (typeof eventOrExpr === 'string') {
164
165
  throw new Error(
165
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
166
+ // oxlint-disable-next-line typescript/restrict-template-expressions
166
167
  `Only event objects may be used with sendTo; use sendTo({ type: "${eventOrExpr}" }) instead`);
167
168
  }
168
169
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;
@@ -176,11 +177,11 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
176
177
  const resolvedTarget = typeof to === 'function' ? to(args, actionParams) : to;
177
178
  let targetActorRef;
178
179
  if (typeof resolvedTarget === 'string') {
179
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
180
+ // oxlint-disable-next-line typescript/no-unsafe-enum-comparison
180
181
  if (resolvedTarget === SpecialTargets.Parent) {
181
182
  targetActorRef = actorScope.self._parent;
182
183
  }
183
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
184
+ // oxlint-disable-next-line typescript/no-unsafe-enum-comparison
184
185
  else if (resolvedTarget === SpecialTargets.Internal) {
185
186
  targetActorRef = actorScope.self;
186
187
  } else if (resolvedTarget.startsWith('#_')) {
@@ -472,6 +472,9 @@ function createSystem(rootActor, options) {
472
472
  }
473
473
 
474
474
  // those are needed to make JSDoc `@link` work properly
475
+ // oxlint-disable no-unused-vars
476
+
477
+ // oxlint-enable no-unused-vars
475
478
 
476
479
  exports.executingCustomAction = false;
477
480
  const $$ACTOR_TYPE = 1;
@@ -1275,7 +1278,7 @@ function resolveSpawn(actorScope, snapshot, actionArgs, _actionParams, {
1275
1278
  }
1276
1279
  if (!actorRef) {
1277
1280
  console.warn(
1278
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions,@typescript-eslint/no-base-to-string
1281
+ // oxlint-disable-next-line typescript/restrict-template-expressions,typescript/no-base-to-string
1279
1282
  `Actor type '${src}' not found in machine '${actorScope.id}'.`);
1280
1283
  }
1281
1284
  return [cloneMachineSnapshot(snapshot, {
@@ -1850,7 +1853,7 @@ function formatInitialTransition(stateNode, _target) {
1850
1853
  const resolvedTarget = typeof _target === 'string' ? stateNode.states[_target] : _target ? stateNode.states[_target.target] : undefined;
1851
1854
  if (!resolvedTarget && _target) {
1852
1855
  throw new Error(
1853
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-base-to-string
1856
+ // oxlint-disable-next-line typescript/restrict-template-expressions, typescript/no-base-to-string
1854
1857
  `Initial state node "${_target}" not found on parent state node #${stateNode.id}`);
1855
1858
  }
1856
1859
  const transition = {
@@ -2225,7 +2228,7 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
2225
2228
  nextState = resolveActionsAndContext(nextState, event, actorScope, nextStateNodes.sort((a, b) => b.order - a.order).flatMap(state => state.exit), internalQueue, undefined);
2226
2229
  }
2227
2230
 
2228
- // eslint-disable-next-line no-useless-catch
2231
+ // oxlint-disable no-useless-catch
2229
2232
  try {
2230
2233
  if (historyValue === currentSnapshot.historyValue && areStateNodeCollectionsEqual(currentSnapshot._nodes, mutStateNodeSet)) {
2231
2234
  return [nextState, actions];
@@ -2239,6 +2242,7 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
2239
2242
  // See https://github.com/statelyai/rfcs/pull/4
2240
2243
  throw e;
2241
2244
  }
2245
+ // oxlint-enable no-useless-catch
2242
2246
  } finally {
2243
2247
  actorScope.actionExecutor = originalExecutor;
2244
2248
  }
@@ -2775,7 +2779,7 @@ function resolveRaise(_, snapshot, args, actionParams, {
2775
2779
  const delaysMap = snapshot.machine.implementations.delays;
2776
2780
  if (typeof eventOrExpr === 'string') {
2777
2781
  throw new Error(
2778
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
2782
+ // oxlint-disable-next-line typescript/restrict-template-expressions
2779
2783
  `Only event objects may be used with raise; use raise({ type: "${eventOrExpr}" }) instead`);
2780
2784
  }
2781
2785
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;
@@ -461,6 +461,9 @@ function createSystem(rootActor, options) {
461
461
  }
462
462
 
463
463
  // those are needed to make JSDoc `@link` work properly
464
+ // oxlint-disable no-unused-vars
465
+
466
+ // oxlint-enable no-unused-vars
464
467
 
465
468
  let executingCustomAction = false;
466
469
  const $$ACTOR_TYPE = 1;
@@ -1796,7 +1799,7 @@ function formatInitialTransition(stateNode, _target) {
1796
1799
  const resolvedTarget = typeof _target === 'string' ? stateNode.states[_target] : _target ? stateNode.states[_target.target] : undefined;
1797
1800
  if (!resolvedTarget && _target) {
1798
1801
  throw new Error(
1799
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-base-to-string
1802
+ // oxlint-disable-next-line typescript/restrict-template-expressions, typescript/no-base-to-string
1800
1803
  `Initial state node "${_target}" not found on parent state node #${stateNode.id}`);
1801
1804
  }
1802
1805
  const transition = {
@@ -2171,7 +2174,7 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
2171
2174
  nextState = resolveActionsAndContext(nextState, event, actorScope, nextStateNodes.sort((a, b) => b.order - a.order).flatMap(state => state.exit), internalQueue, undefined);
2172
2175
  }
2173
2176
 
2174
- // eslint-disable-next-line no-useless-catch
2177
+ // oxlint-disable no-useless-catch
2175
2178
  try {
2176
2179
  if (historyValue === currentSnapshot.historyValue && areStateNodeCollectionsEqual(currentSnapshot._nodes, mutStateNodeSet)) {
2177
2180
  return [nextState, actions];
@@ -2185,6 +2188,7 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
2185
2188
  // See https://github.com/statelyai/rfcs/pull/4
2186
2189
  throw e;
2187
2190
  }
2191
+ // oxlint-enable no-useless-catch
2188
2192
  } finally {
2189
2193
  actorScope.actionExecutor = originalExecutor;
2190
2194
  }
@@ -2712,7 +2716,7 @@ function resolveRaise(_, snapshot, args, actionParams, {
2712
2716
  const delaysMap = snapshot.machine.implementations.delays;
2713
2717
  if (typeof eventOrExpr === 'string') {
2714
2718
  throw new Error(
2715
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
2719
+ // oxlint-disable-next-line typescript/restrict-template-expressions
2716
2720
  `Only event objects may be used with raise; use raise({ type: "${eventOrExpr}" }) instead`);
2717
2721
  }
2718
2722
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;
@@ -2764,4 +2768,4 @@ function raise(eventOrExpr, options) {
2764
2768
  return raise;
2765
2769
  }
2766
2770
 
2767
- export { $$ACTOR_TYPE as $, Actor as A, formatTransitions as B, toTransitionConfigArray as C, formatTransition as D, evaluateGuard as E, createInvokeId as F, getDelayedTransitions as G, formatInitialTransition as H, getCandidates as I, formatRouteTransitions as J, resolveStateValue as K, getAllStateNodes as L, createMachineSnapshot as M, NULL_EVENT as N, isInFinalState as O, transitionNode as P, resolveActionsAndContext as Q, toStatePath as R, STATE_DELIMITER as S, isStateId as T, getStateNodeByPath as U, getPersistedSnapshot as V, resolveReferencedActor as W, XSTATE_STOP as X, XSTATE_ERROR as Y, createErrorActorEvent as Z, ProcessingStatus as _, createSystem as a, cloneMachineSnapshot as a0, cancel as b, createActor as c, spawnChild as d, macrostep as e, createInitEvent as f, initialMicrostep as g, getProperAncestors as h, isAtomicStateNode as i, interpret as j, and as k, stateIn as l, matchesEventDescriptor as m, not as n, or as o, isMachineSnapshot as p, getStateNodes as q, raise as r, stopChild as s, toArray as t, getAllOwnEventDescriptors as u, matchesState as v, pathToStateValue as w, toObserver as x, stop as y, mapValues as z };
2771
+ export { $$ACTOR_TYPE as $, Actor as A, formatTransitions as B, toTransitionConfigArray as C, formatTransition as D, evaluateGuard as E, createInvokeId as F, getDelayedTransitions as G, formatInitialTransition as H, getCandidates as I, formatRouteTransitions as J, resolveStateValue as K, getAllStateNodes as L, createMachineSnapshot as M, NULL_EVENT as N, isInFinalState as O, transitionNode as P, resolveActionsAndContext as Q, cloneMachineSnapshot as R, STATE_DELIMITER as S, toStatePath as T, isStateId as U, getStateNodeByPath as V, getPersistedSnapshot as W, XSTATE_STOP as X, resolveReferencedActor as Y, XSTATE_ERROR as Z, createErrorActorEvent as _, createSystem as a, ProcessingStatus as a0, cancel as b, createActor as c, spawnChild as d, macrostep as e, createInitEvent as f, initialMicrostep as g, getProperAncestors as h, isAtomicStateNode as i, interpret as j, and as k, stateIn as l, matchesEventDescriptor as m, not as n, or as o, isMachineSnapshot as p, getStateNodes as q, raise as r, stopChild as s, toArray as t, getAllOwnEventDescriptors as u, matchesState as v, pathToStateValue as w, toObserver as x, stop as y, mapValues as z };
@@ -463,6 +463,9 @@ function createSystem(rootActor, options) {
463
463
  }
464
464
 
465
465
  // those are needed to make JSDoc `@link` work properly
466
+ // oxlint-disable no-unused-vars
467
+
468
+ // oxlint-enable no-unused-vars
466
469
 
467
470
  let executingCustomAction = false;
468
471
  const $$ACTOR_TYPE = 1;
@@ -1798,7 +1801,7 @@ function formatInitialTransition(stateNode, _target) {
1798
1801
  const resolvedTarget = typeof _target === 'string' ? stateNode.states[_target] : _target ? stateNode.states[_target.target] : undefined;
1799
1802
  if (!resolvedTarget && _target) {
1800
1803
  throw new Error(
1801
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-base-to-string
1804
+ // oxlint-disable-next-line typescript/restrict-template-expressions, typescript/no-base-to-string
1802
1805
  `Initial state node "${_target}" not found on parent state node #${stateNode.id}`);
1803
1806
  }
1804
1807
  const transition = {
@@ -2173,7 +2176,7 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
2173
2176
  nextState = resolveActionsAndContext(nextState, event, actorScope, nextStateNodes.sort((a, b) => b.order - a.order).flatMap(state => state.exit), internalQueue, undefined);
2174
2177
  }
2175
2178
 
2176
- // eslint-disable-next-line no-useless-catch
2179
+ // oxlint-disable no-useless-catch
2177
2180
  try {
2178
2181
  if (historyValue === currentSnapshot.historyValue && areStateNodeCollectionsEqual(currentSnapshot._nodes, mutStateNodeSet)) {
2179
2182
  return [nextState, actions];
@@ -2187,6 +2190,7 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
2187
2190
  // See https://github.com/statelyai/rfcs/pull/4
2188
2191
  throw e;
2189
2192
  }
2193
+ // oxlint-enable no-useless-catch
2190
2194
  } finally {
2191
2195
  actorScope.actionExecutor = originalExecutor;
2192
2196
  }
@@ -2714,7 +2718,7 @@ function resolveRaise(_, snapshot, args, actionParams, {
2714
2718
  const delaysMap = snapshot.machine.implementations.delays;
2715
2719
  if (typeof eventOrExpr === 'string') {
2716
2720
  throw new Error(
2717
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
2721
+ // oxlint-disable-next-line typescript/restrict-template-expressions
2718
2722
  `Only event objects may be used with raise; use raise({ type: "${eventOrExpr}" }) instead`);
2719
2723
  }
2720
2724
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;