!function(t,e){for(var n in e)t[n]=e[n]}(this,function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,exports){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(t,e){for(var n=0;nn:null!=e?(e[n]=!0,e=null):t=r[o][n]||(r[o][n]=Array(b));break;case n>=f:n-=f,e=t[n]||(t[n]=Array(d));break;default:a(!1,"Invalid value "+n+" in table at index "+(u+i))}})}(),Object.defineProperties(this,{table:{enumerable:!0,get:this.getTable.bind(this)},state:{enumerable:!0,get:this.getState.bind(this)}}),h.forEach(function(t){return r[t]=r.triggerEvent.bind(r,t)})}return n(t,[{key:"getTable",value:function(){return this[o].map(function(t){return t.slice()})}},{key:"getState",value:function(){return this[s][this[u]]}},{key:"triggerEvent",value:function(t){var e=this,n=void 0;this[l].find(function(e,r){return e===t&&((n=r)||!0)}),a(null!=n,"Missing event: "+t);var c=[this[u]],f=this[s][c];return c=this[o][c],n=a(c[n],"Event: "+t+" is invalid in state: "+f),n.find(function(n,a){if(n&&e[u]!==a){var o=e[s][a],l=e[f+"-"+t+"-"+o];if(l&&(!r(l)||l()))return!1;var c=e["leave"+i(f)];c&&r(c)&&c.call(e),e[u]=a;var v=e["enter"+i(o)];return v&&r(v)&&v.call(e),!0}}),this}}]),t}();exports["default"]=c,exports.FSM=c}]));