Comparing version 0.4.4 to 0.4.5
@@ -304,5 +304,8 @@ 'use strict'; | ||
value: function selectTransition(transitions, context) { | ||
return transitions.find(function (t) { | ||
return !t.condition || t.condition(context); | ||
}); | ||
for (var i = 0; i < transitions.length; i++) { | ||
if (!transitions[i].condition || transitions[i].condition(context)) { | ||
return transitions[i]; | ||
} | ||
} | ||
return null; | ||
} | ||
@@ -309,0 +312,0 @@ }], [{ |
{ | ||
"name": "finity", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"description": "A finite state machine library for Node.js and the browser with a friendly configuration DSL", | ||
@@ -62,3 +62,3 @@ "keywords": [ | ||
"test:typings": "typings install && tsc", | ||
"test": "babel-node test/support/jasmineRunner && npm run test:typings", | ||
"test": "node test/support/jasmineRunner.js && npm run test:typings", | ||
"coverage": "babel-node node_modules/isparta/bin/isparta cover --root src --report lcovonly test/support/jasmineRunner.js", | ||
@@ -65,0 +65,0 @@ "lint": "eslint src test examples" |
@@ -1023,5 +1023,8 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
value: function selectTransition(transitions, context) { | ||
return transitions.find(function (t) { | ||
return !t.condition || t.condition(context); | ||
}); | ||
for (var i = 0; i < transitions.length; i++) { | ||
if (!transitions[i].condition || transitions[i].condition(context)) { | ||
return transitions[i]; | ||
} | ||
} | ||
return null; | ||
} | ||
@@ -1028,0 +1031,0 @@ }], [{ |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Finity=e():t.Finity=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(){return new u.StateMachineConfigurator}function i(t){return s["default"].start(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.configure=o,e.start=i;var u=n(14),a=n(10),s=r(a);e["default"]={configure:o,start:i}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){function t(e){n(this,t),this.parent=e}return r(t,[{key:"getAncestor",value:function(t){return this.parent?this.parent instanceof t?this.parent:this.parent.getAncestor(t):null}}]),t}();e["default"]=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){return t?Array.isArray(t)?t.map(o):"object"===("undefined"==typeof t?"undefined":i(t))?(0,a["default"])(t,o):t:t}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e["default"]=o;var u=n(11),a=r(u)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){Object.getOwnPropertyNames(e.prototype).filter(function(n){return!t.prototype[n]&&e.prototype[n]instanceof Function&&e.prototype[n]!==e.prototype.constructor}).forEach(function(n){t.prototype[n]=function(){for(var t=e.prototype[n],r=arguments.length,o=Array(r),i=0;r>i;i++)o[i]=arguments[i];return t.apply(this.getAncestor(e),o)}})}function i(t){return Array.isArray(t)?t.map(s):(0,a["default"])(t,s)}Object.defineProperty(e,"__esModule",{value:!0}),e.delegateToAncestor=o,e.mapToConfig=i;var u=n(11),a=r(u),s=function(t){return t.internalGetConfig()}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(9),l=r(f),h=n(3),y=function(t){function e(t){o(this,e);var n=i(this,Object.getPrototypeOf(e).call(this,t));return n.transitionConfigurators=[],n}return u(e,t),a(e,[{key:"transitionTo",value:function(t){return this.transition(t)}},{key:"selfTransition",value:function(){return this.transition(null)}},{key:"internalTransition",value:function(){return this.transition(null,!0)}},{key:"transition",value:function(t,e){var n=new l["default"](this,t,e);return this.transitionConfigurators.push(n),n}},{key:"internalGetConfig",value:function(){return{transitions:(0,h.mapToConfig)(this.transitionConfigurators)}}}]),e}(c["default"]);e["default"]=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(4),l=r(f),h=n(2),y=r(h),p=function(t){function e(t,n){o(this,e);var r=i(this,Object.getPrototypeOf(e).call(this,t));return r.config={action:n},r.successConfigurator=new l["default"](r),r.failureConfigurator=new l["default"](r),r}return u(e,t),a(e,[{key:"onSuccess",value:function(){return this.successConfigurator}},{key:"onFailure",value:function(){return this.failureConfigurator}},{key:"internalGetConfig",value:function(){var t=(0,y["default"])(this.config);return t.onSuccess=this.successConfigurator.internalGetConfig(),t.onFailure=this.failureConfigurator.internalGetConfig(),t}}]),e}(c["default"]);e["default"]=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(2),l=r(f),h=function(t){function e(t){o(this,e);var n=i(this,Object.getPrototypeOf(e).call(this,t));return n.config={stateEnterHooks:[],stateExitHooks:[],stateChangeHooks:[],transitionHooks:[],unhandledEventHooks:[]},n}return u(e,t),a(e,[{key:"onStateEnter",value:function(t){return this.config.stateEnterHooks.push(t),this}},{key:"onStateExit",value:function(t){return this.config.stateExitHooks.push(t),this}},{key:"onStateChange",value:function(t){return this.config.stateChangeHooks.push(t),this}},{key:"onTransition",value:function(t){return this.config.transitionHooks.push(t),this}},{key:"onUnhandledEvent",value:function(t){return this.config.unhandledEventHooks.push(t),this}},{key:"internalGetConfig",value:function(){return(0,l["default"])(this.config)}}]),e}(c["default"]);e["default"]=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(4),l=r(f),h=n(13),y=r(h),p=n(5),d=r(p),v=n(3),b=n(2),g=r(b),O=function(t){function e(t){o(this,e);var n=i(this,Object.getPrototypeOf(e).call(this,t));return n.config={entryActions:[],exitActions:[]},n.eventConfigurators=Object.create(null),n.timerConfigurators=[],n.asyncActionConfigurators=[],n}return u(e,t),a(e,[{key:"onEnter",value:function(t){return this.config.entryActions.push(t),this}},{key:"onExit",value:function(t){return this.config.exitActions.push(t),this}},{key:"on",value:function(t){return this.eventConfigurators[t]||(this.eventConfigurators[t]=new l["default"](this)),this.eventConfigurators[t]}},{key:"onTimeout",value:function(t){var e=new y["default"](this,t);return this.timerConfigurators.push(e),e}},{key:"do",value:function(t){var e=new d["default"](this,t);return this.asyncActionConfigurators.push(e),e}},{key:"internalGetConfig",value:function(){var t=(0,g["default"])(this.config);return t.events=(0,v.mapToConfig)(this.eventConfigurators),t.timers=(0,v.mapToConfig)(this.timerConfigurators),t.asyncActions=(0,v.mapToConfig)(this.asyncActionConfigurators),t}}]),e}(c["default"]);e["default"]=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(6),l=r(f),h=n(7),y=r(h),p=n(10),d=r(p),v=n(3),b=n(2),g=r(b),O=n(12),w=r(O),_=function(t){function e(){o(this,e);var t=i(this,Object.getPrototypeOf(e).call(this));return t.config={initialState:null},t.globalConfigurator=new l["default"](t),t.stateConfigurators=Object.create(null),t}return u(e,t),a(e,[{key:"global",value:function(){return this.globalConfigurator}},{key:"initialState",value:function(t){return this.config.initialState=t,this.state(t)}},{key:"state",value:function(t){return this.stateConfigurators[t]||(this.stateConfigurators[t]=new y["default"](this)),this.stateConfigurators[t]}},{key:"getConfig",value:function(){var t=(0,g["default"])(this.config);return t.states=(0,v.mapToConfig)(this.stateConfigurators),(0,w["default"])(t,this.globalConfigurator.internalGetConfig())}},{key:"start",value:function(){var t=this.getConfig();return d["default"].start(t)}}]),e}(c["default"]);e["default"]=_},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(2),l=r(f),h=function(t){function e(t,n,r){o(this,e);var u=i(this,Object.getPrototypeOf(e).call(this,t));return u.config={targetState:n,isInternal:null===n&&r,actions:[],condition:null},u}return u(e,t),a(e,[{key:"withAction",value:function(t){return this.config.actions.push(t),this}},{key:"withCondition",value:function(t){return this.config.condition=t,this}},{key:"internalGetConfig",value:function(){return(0,l["default"])(this.config)}}]),e}(c["default"]);e["default"]=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(16),s=r(a),c=n(17),f=r(c),l=function(){function t(e){if(o(this,t),void 0===e||null===e)throw new Error("Configuration must be specified.");if("object"!==("undefined"==typeof e?"undefined":i(e)))throw new Error("Configuration must be an object.");if(void 0===e.initialState||null===e.initialState)throw new Error("Initial state must be specified.");this.config=e,this.currentState=null,this.isBusy=!1,this.eventQueue=[],this.timerIDs=null,this.asyncActionSubscriptions=null,this.handleTimeout=this.handleTimeout.bind(this)}return u(t,[{key:"start",value:function(){var t=this;return this.isStarted()||this.execute(function(){return t.enterState(t.config.initialState,t.createContext())}),this}},{key:"isStarted",value:function(){return null!==this.currentState}},{key:"getCurrentState",value:function(){return this.currentState}},{key:"canHandle",value:function(t,e){if(!this.isStarted())return!1;var n=this.createContext(t,e);return!!this.getTransitionForEvent(n)}},{key:"handle",value:function(t,e){var n=this;return this.isBusy?this.eventQueue.push({event:t,eventPayload:e}):this.execute(function(){return n.processEvent(t,e)}),this}},{key:"execute",value:function(t){if(this.isBusy)throw new Error("Operation cannot be executed because another operation is in progress.");this.isBusy=!0;try{for(t();this.eventQueue.length>0;){var e=this.eventQueue.shift(),n=e.event,r=e.eventPayload;this.processEvent(n,r)}}finally{this.eventQueue.length>0&&(this.eventQueue=[]),this.isBusy=!1}}},{key:"processEvent",value:function(t,e){var n=this.createContext(t,e),r=this.getTransitionForEvent(n);r?this.executeTransition(r,n):this.handleUnhandledEvent(n)}},{key:"createContext",value:function(t,e){var n={stateMachine:this};return void 0!==t&&(n.event=t),void 0!==e&&(n.eventPayload=e),n}},{key:"getTransitionForEvent",value:function(t){var e=this.config.states[this.currentState];if(!e)return null;var n=e.events[t.event];return n?this.selectTransition(n.transitions,t):null}},{key:"executeTransition",value:function(t,e){t.isInternal||this.exitState(e);var n=null!==t.targetState?t.targetState:this.currentState;(0,f["default"])(this.config.transitionHooks,this.currentState,n,e),(0,f["default"])(t.actions,this.currentState,n,e),t.isInternal||this.enterState(n,e)}},{key:"handleUnhandledEvent",value:function(t){if(!(this.config.unhandledEventHooks.length>0))throw new Error("Unhandled event '"+t.event+"' in state '"+this.currentState+"'.");(0,f["default"])(this.config.unhandledEventHooks,t.event,this.currentState,t)}},{key:"enterState",value:function(t,e){(0,f["default"])(this.config.stateEnterHooks,t,e);var n=this.config.states[t];n&&(0,f["default"])(n.entryActions,t,e),null!==this.currentState&&this.currentState!==t&&(0,f["default"])(this.config.stateChangeHooks,this.currentState,t,e),this.currentState=t,this.startAsyncActions(e),this.startTimers()}},{key:"exitState",value:function(t){this.stopTimers(),this.cancelAsyncActionSubscriptions(),(0,f["default"])(this.config.stateExitHooks,this.currentState,t);var e=this.config.states[this.currentState];e&&(0,f["default"])(e.exitActions,this.currentState,t)}},{key:"startAsyncActions",value:function(t){var e=this,n=this.config.states[this.currentState];n&&n.asyncActions.forEach(function(n){return e.startAsyncAction(n,t)})}},{key:"startAsyncAction",value:function(t,e){var n=this,r=t.action,o=new s["default"](function(e){return n.handleAsyncActionSuccess(t.onSuccess,e)},function(e){return n.handleAsyncActionFailure(t.onFailure,e)});r(this.currentState,e).then(o.onSuccess,o.onFailure),this.asyncActionSubscriptions=this.asyncActionSubscriptions||[],this.asyncActionSubscriptions.push(o)}},{key:"cancelAsyncActionSubscriptions",value:function(){this.asyncActionSubscriptions&&(this.asyncActionSubscriptions.forEach(function(t){return t.cancel()}),this.asyncActionSubscriptions=null)}},{key:"handleAsyncActionSuccess",value:function(t,e){var n=this.createContext();n.result=e,this.executeTrigger(t,n)}},{key:"handleAsyncActionFailure",value:function(t,e){var n=this.createContext();n.error=e,this.executeTrigger(t,n)}},{key:"startTimers",value:function(){var t=this,e=this.config.states[this.currentState];e&&e.timers.length>0&&(this.timerIDs=e.timers.map(function(e){return setTimeout(t.handleTimeout,e.timeout,e)}))}},{key:"stopTimers",value:function(){this.timerIDs&&(this.timerIDs.forEach(clearTimeout),this.timerIDs=null)}},{key:"handleTimeout",value:function(t){this.executeTrigger(t,this.createContext())}},{key:"executeTrigger",value:function(t,e){var n=this;this.execute(function(){var r=n.selectTransition(t.transitions,e);r&&n.executeTransition(r,e)})}},{key:"selectTransition",value:function(t,e){return t.find(function(t){return!t.condition||t.condition(e)})}}],[{key:"start",value:function(e){return new t(e).start()}}]),t}();e["default"]=l},function(t,e){"use strict";function n(t,e){var n=Object.getPrototypeOf(t),r=Object.create(n);return Object.keys(t).forEach(function(n){r[n]=e(t[n])}),r}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){"use strict";function n(t,e){return Object.keys(e).forEach(function(n){t[n]=e[n]}),t}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function p(t,e,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:p(o,e,n)}if("value"in r)return r.value;var i=r.get;if(void 0!==i)return i.call(n)},c=n(4),f=r(c),l=n(12),h=r(l),y=function(t){function e(t,n){o(this,e);var r=i(this,Object.getPrototypeOf(e).call(this,t));return r.config={timeout:n},r}return u(e,t),a(e,[{key:"internalGetConfig",value:function(){return(0,h["default"])(s(Object.getPrototypeOf(e.prototype),"internalGetConfig",this).call(this),this.config)}}]),e}(f["default"]);e["default"]=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.StateMachineConfigurator=void 0;var o=n(8),i=r(o),u=n(15),a=r(u);e.StateMachineConfigurator=i["default"],(0,a["default"])()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(){(0,b.delegateToAncestor)(s["default"],u["default"]),(0,b.delegateToAncestor)(f["default"],u["default"]),(0,b.delegateToAncestor)(p["default"],f["default"]),(0,b.delegateToAncestor)(p["default"],h["default"]),(0,b.delegateToAncestor)(p["default"],v["default"])}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=o;var i=n(8),u=r(i),a=n(6),s=r(a),c=n(7),f=r(c),l=n(4),h=r(l),y=n(9),p=r(y),d=n(5),v=r(d),b=n(3)},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){function t(e,r){n(this,t),this.successListener=e,this.failureListener=r,this.onSuccess=this.onSuccess.bind(this),this.onFailure=this.onFailure.bind(this)}return r(t,[{key:"onSuccess",value:function(t){this.successListener&&this.successListener(t)}},{key:"onFailure",value:function(t){this.failureListener&&this.failureListener(t)}},{key:"cancel",value:function(){this.successListener=null,this.failureListener=null}}]),t}();e["default"]=o},function(t,e){"use strict";function n(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];t.forEach(function(t){return t.apply(void 0,n)})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Finity=e():t.Finity=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(){return new u.StateMachineConfigurator}function i(t){return s["default"].start(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.configure=o,e.start=i;var u=n(14),a=n(10),s=r(a);e["default"]={configure:o,start:i}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){function t(e){n(this,t),this.parent=e}return r(t,[{key:"getAncestor",value:function(t){return this.parent?this.parent instanceof t?this.parent:this.parent.getAncestor(t):null}}]),t}();e["default"]=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){return t?Array.isArray(t)?t.map(o):"object"===("undefined"==typeof t?"undefined":i(t))?(0,a["default"])(t,o):t:t}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e["default"]=o;var u=n(11),a=r(u)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){Object.getOwnPropertyNames(e.prototype).filter(function(n){return!t.prototype[n]&&e.prototype[n]instanceof Function&&e.prototype[n]!==e.prototype.constructor}).forEach(function(n){t.prototype[n]=function(){for(var t=e.prototype[n],r=arguments.length,o=Array(r),i=0;r>i;i++)o[i]=arguments[i];return t.apply(this.getAncestor(e),o)}})}function i(t){return Array.isArray(t)?t.map(s):(0,a["default"])(t,s)}Object.defineProperty(e,"__esModule",{value:!0}),e.delegateToAncestor=o,e.mapToConfig=i;var u=n(11),a=r(u),s=function(t){return t.internalGetConfig()}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(9),l=r(f),h=n(3),y=function(t){function e(t){o(this,e);var n=i(this,Object.getPrototypeOf(e).call(this,t));return n.transitionConfigurators=[],n}return u(e,t),a(e,[{key:"transitionTo",value:function(t){return this.transition(t)}},{key:"selfTransition",value:function(){return this.transition(null)}},{key:"internalTransition",value:function(){return this.transition(null,!0)}},{key:"transition",value:function(t,e){var n=new l["default"](this,t,e);return this.transitionConfigurators.push(n),n}},{key:"internalGetConfig",value:function(){return{transitions:(0,h.mapToConfig)(this.transitionConfigurators)}}}]),e}(c["default"]);e["default"]=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(4),l=r(f),h=n(2),y=r(h),p=function(t){function e(t,n){o(this,e);var r=i(this,Object.getPrototypeOf(e).call(this,t));return r.config={action:n},r.successConfigurator=new l["default"](r),r.failureConfigurator=new l["default"](r),r}return u(e,t),a(e,[{key:"onSuccess",value:function(){return this.successConfigurator}},{key:"onFailure",value:function(){return this.failureConfigurator}},{key:"internalGetConfig",value:function(){var t=(0,y["default"])(this.config);return t.onSuccess=this.successConfigurator.internalGetConfig(),t.onFailure=this.failureConfigurator.internalGetConfig(),t}}]),e}(c["default"]);e["default"]=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(2),l=r(f),h=function(t){function e(t){o(this,e);var n=i(this,Object.getPrototypeOf(e).call(this,t));return n.config={stateEnterHooks:[],stateExitHooks:[],stateChangeHooks:[],transitionHooks:[],unhandledEventHooks:[]},n}return u(e,t),a(e,[{key:"onStateEnter",value:function(t){return this.config.stateEnterHooks.push(t),this}},{key:"onStateExit",value:function(t){return this.config.stateExitHooks.push(t),this}},{key:"onStateChange",value:function(t){return this.config.stateChangeHooks.push(t),this}},{key:"onTransition",value:function(t){return this.config.transitionHooks.push(t),this}},{key:"onUnhandledEvent",value:function(t){return this.config.unhandledEventHooks.push(t),this}},{key:"internalGetConfig",value:function(){return(0,l["default"])(this.config)}}]),e}(c["default"]);e["default"]=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(4),l=r(f),h=n(13),y=r(h),p=n(5),d=r(p),v=n(3),b=n(2),g=r(b),O=function(t){function e(t){o(this,e);var n=i(this,Object.getPrototypeOf(e).call(this,t));return n.config={entryActions:[],exitActions:[]},n.eventConfigurators=Object.create(null),n.timerConfigurators=[],n.asyncActionConfigurators=[],n}return u(e,t),a(e,[{key:"onEnter",value:function(t){return this.config.entryActions.push(t),this}},{key:"onExit",value:function(t){return this.config.exitActions.push(t),this}},{key:"on",value:function(t){return this.eventConfigurators[t]||(this.eventConfigurators[t]=new l["default"](this)),this.eventConfigurators[t]}},{key:"onTimeout",value:function(t){var e=new y["default"](this,t);return this.timerConfigurators.push(e),e}},{key:"do",value:function(t){var e=new d["default"](this,t);return this.asyncActionConfigurators.push(e),e}},{key:"internalGetConfig",value:function(){var t=(0,g["default"])(this.config);return t.events=(0,v.mapToConfig)(this.eventConfigurators),t.timers=(0,v.mapToConfig)(this.timerConfigurators),t.asyncActions=(0,v.mapToConfig)(this.asyncActionConfigurators),t}}]),e}(c["default"]);e["default"]=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(6),l=r(f),h=n(7),y=r(h),p=n(10),d=r(p),v=n(3),b=n(2),g=r(b),O=n(12),w=r(O),_=function(t){function e(){o(this,e);var t=i(this,Object.getPrototypeOf(e).call(this));return t.config={initialState:null},t.globalConfigurator=new l["default"](t),t.stateConfigurators=Object.create(null),t}return u(e,t),a(e,[{key:"global",value:function(){return this.globalConfigurator}},{key:"initialState",value:function(t){return this.config.initialState=t,this.state(t)}},{key:"state",value:function(t){return this.stateConfigurators[t]||(this.stateConfigurators[t]=new y["default"](this)),this.stateConfigurators[t]}},{key:"getConfig",value:function(){var t=(0,g["default"])(this.config);return t.states=(0,v.mapToConfig)(this.stateConfigurators),(0,w["default"])(t,this.globalConfigurator.internalGetConfig())}},{key:"start",value:function(){var t=this.getConfig();return d["default"].start(t)}}]),e}(c["default"]);e["default"]=_},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=r(s),f=n(2),l=r(f),h=function(t){function e(t,n,r){o(this,e);var u=i(this,Object.getPrototypeOf(e).call(this,t));return u.config={targetState:n,isInternal:null===n&&r,actions:[],condition:null},u}return u(e,t),a(e,[{key:"withAction",value:function(t){return this.config.actions.push(t),this}},{key:"withCondition",value:function(t){return this.config.condition=t,this}},{key:"internalGetConfig",value:function(){return(0,l["default"])(this.config)}}]),e}(c["default"]);e["default"]=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(16),s=r(a),c=n(17),f=r(c),l=function(){function t(e){if(o(this,t),void 0===e||null===e)throw new Error("Configuration must be specified.");if("object"!==("undefined"==typeof e?"undefined":i(e)))throw new Error("Configuration must be an object.");if(void 0===e.initialState||null===e.initialState)throw new Error("Initial state must be specified.");this.config=e,this.currentState=null,this.isBusy=!1,this.eventQueue=[],this.timerIDs=null,this.asyncActionSubscriptions=null,this.handleTimeout=this.handleTimeout.bind(this)}return u(t,[{key:"start",value:function(){var t=this;return this.isStarted()||this.execute(function(){return t.enterState(t.config.initialState,t.createContext())}),this}},{key:"isStarted",value:function(){return null!==this.currentState}},{key:"getCurrentState",value:function(){return this.currentState}},{key:"canHandle",value:function(t,e){if(!this.isStarted())return!1;var n=this.createContext(t,e);return!!this.getTransitionForEvent(n)}},{key:"handle",value:function(t,e){var n=this;return this.isBusy?this.eventQueue.push({event:t,eventPayload:e}):this.execute(function(){return n.processEvent(t,e)}),this}},{key:"execute",value:function(t){if(this.isBusy)throw new Error("Operation cannot be executed because another operation is in progress.");this.isBusy=!0;try{for(t();this.eventQueue.length>0;){var e=this.eventQueue.shift(),n=e.event,r=e.eventPayload;this.processEvent(n,r)}}finally{this.eventQueue.length>0&&(this.eventQueue=[]),this.isBusy=!1}}},{key:"processEvent",value:function(t,e){var n=this.createContext(t,e),r=this.getTransitionForEvent(n);r?this.executeTransition(r,n):this.handleUnhandledEvent(n)}},{key:"createContext",value:function(t,e){var n={stateMachine:this};return void 0!==t&&(n.event=t),void 0!==e&&(n.eventPayload=e),n}},{key:"getTransitionForEvent",value:function(t){var e=this.config.states[this.currentState];if(!e)return null;var n=e.events[t.event];return n?this.selectTransition(n.transitions,t):null}},{key:"executeTransition",value:function(t,e){t.isInternal||this.exitState(e);var n=null!==t.targetState?t.targetState:this.currentState;(0,f["default"])(this.config.transitionHooks,this.currentState,n,e),(0,f["default"])(t.actions,this.currentState,n,e),t.isInternal||this.enterState(n,e)}},{key:"handleUnhandledEvent",value:function(t){if(!(this.config.unhandledEventHooks.length>0))throw new Error("Unhandled event '"+t.event+"' in state '"+this.currentState+"'.");(0,f["default"])(this.config.unhandledEventHooks,t.event,this.currentState,t)}},{key:"enterState",value:function(t,e){(0,f["default"])(this.config.stateEnterHooks,t,e);var n=this.config.states[t];n&&(0,f["default"])(n.entryActions,t,e),null!==this.currentState&&this.currentState!==t&&(0,f["default"])(this.config.stateChangeHooks,this.currentState,t,e),this.currentState=t,this.startAsyncActions(e),this.startTimers()}},{key:"exitState",value:function(t){this.stopTimers(),this.cancelAsyncActionSubscriptions(),(0,f["default"])(this.config.stateExitHooks,this.currentState,t);var e=this.config.states[this.currentState];e&&(0,f["default"])(e.exitActions,this.currentState,t)}},{key:"startAsyncActions",value:function(t){var e=this,n=this.config.states[this.currentState];n&&n.asyncActions.forEach(function(n){return e.startAsyncAction(n,t)})}},{key:"startAsyncAction",value:function(t,e){var n=this,r=t.action,o=new s["default"](function(e){return n.handleAsyncActionSuccess(t.onSuccess,e)},function(e){return n.handleAsyncActionFailure(t.onFailure,e)});r(this.currentState,e).then(o.onSuccess,o.onFailure),this.asyncActionSubscriptions=this.asyncActionSubscriptions||[],this.asyncActionSubscriptions.push(o)}},{key:"cancelAsyncActionSubscriptions",value:function(){this.asyncActionSubscriptions&&(this.asyncActionSubscriptions.forEach(function(t){return t.cancel()}),this.asyncActionSubscriptions=null)}},{key:"handleAsyncActionSuccess",value:function(t,e){var n=this.createContext();n.result=e,this.executeTrigger(t,n)}},{key:"handleAsyncActionFailure",value:function(t,e){var n=this.createContext();n.error=e,this.executeTrigger(t,n)}},{key:"startTimers",value:function(){var t=this,e=this.config.states[this.currentState];e&&e.timers.length>0&&(this.timerIDs=e.timers.map(function(e){return setTimeout(t.handleTimeout,e.timeout,e)}))}},{key:"stopTimers",value:function(){this.timerIDs&&(this.timerIDs.forEach(clearTimeout),this.timerIDs=null)}},{key:"handleTimeout",value:function(t){this.executeTrigger(t,this.createContext())}},{key:"executeTrigger",value:function(t,e){var n=this;this.execute(function(){var r=n.selectTransition(t.transitions,e);r&&n.executeTransition(r,e)})}},{key:"selectTransition",value:function(t,e){for(var n=0;n<t.length;n++)if(!t[n].condition||t[n].condition(e))return t[n];return null}}],[{key:"start",value:function(e){return new t(e).start()}}]),t}();e["default"]=l},function(t,e){"use strict";function n(t,e){var n=Object.getPrototypeOf(t),r=Object.create(n);return Object.keys(t).forEach(function(n){r[n]=e(t[n])}),r}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){"use strict";function n(t,e){return Object.keys(e).forEach(function(n){t[n]=e[n]}),t}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function p(t,e,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:p(o,e,n)}if("value"in r)return r.value;var i=r.get;if(void 0!==i)return i.call(n)},c=n(4),f=r(c),l=n(12),h=r(l),y=function(t){function e(t,n){o(this,e);var r=i(this,Object.getPrototypeOf(e).call(this,t));return r.config={timeout:n},r}return u(e,t),a(e,[{key:"internalGetConfig",value:function(){return(0,h["default"])(s(Object.getPrototypeOf(e.prototype),"internalGetConfig",this).call(this),this.config)}}]),e}(f["default"]);e["default"]=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.StateMachineConfigurator=void 0;var o=n(8),i=r(o),u=n(15),a=r(u);e.StateMachineConfigurator=i["default"],(0,a["default"])()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(){(0,b.delegateToAncestor)(s["default"],u["default"]),(0,b.delegateToAncestor)(f["default"],u["default"]),(0,b.delegateToAncestor)(p["default"],f["default"]),(0,b.delegateToAncestor)(p["default"],h["default"]),(0,b.delegateToAncestor)(p["default"],v["default"])}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=o;var i=n(8),u=r(i),a=n(6),s=r(a),c=n(7),f=r(c),l=n(4),h=r(l),y=n(9),p=r(y),d=n(5),v=r(d),b=n(3)},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){function t(e,r){n(this,t),this.successListener=e,this.failureListener=r,this.onSuccess=this.onSuccess.bind(this),this.onFailure=this.onFailure.bind(this)}return r(t,[{key:"onSuccess",value:function(t){this.successListener&&this.successListener(t)}},{key:"onFailure",value:function(t){this.failureListener&&this.failureListener(t)}},{key:"cancel",value:function(){this.successListener=null,this.failureListener=null}}]),t}();e["default"]=o},function(t,e){"use strict";function n(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];t.forEach(function(t){return t.apply(void 0,n)})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n}])}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121758
1965