New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

scion-core

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scion-core - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

2

bower.json
{
"name": "scion-core",
"version": "1.5.0",
"version": "1.5.1",
"author": {

@@ -5,0 +5,0 @@ "name": "Jacob Beard",

@@ -706,3 +706,2 @@ (function (global, factory) {

//compare states based first on depth, then based on document order
console.log('getStateWithHigherSourceChildPriority', s1.id, s1.depth, s1.documentOrder, s2.id, s2.depth, s2.documentOrder);
if (s1.depth > s2.depth) {

@@ -709,0 +708,0 @@ return -1;

/*! scion-core 2017-04-05 */
!function(a,b){if("function"==typeof define&&define.amd)define(["module"],b);else if("undefined"!=typeof exports)b(module);else{var c={exports:{}};b(c),a.scion=c.exports}}(this,function(a){"use strict";function b(a){return a.targets}function c(a,b){return a.documentOrder-b.documentOrder}function d(a){function b(a){void 0===m[a]&&(m[a]=0);var b=m[a]++;return"$generated-"+a+"-"+b}function c(a){return{$deserializeDatamodel:a.$deserializeDatamodel||function(){},$serializeDatamodel:a.$serializeDatamodel||function(){return null},$idToStateMap:k,states:[{$type:"initial",transitions:[{target:a}]},a]}}function d(a,c){if(c.transitions&&j.push.apply(j,c.transitions),c.id){if(k.has(c.id))throw new Error("Redefinition of state id "+c.id);k.set(c.id,c)}c.$type=c.$type||"state",c.ancestors=a,c.depth=a.length,c.parent=a[0],c.documentOrder=l++,c.transitions=c.transitions||[];for(var f=0,g=c.transitions.length;f<g;f++){var h=c.transitions[f];h.documentOrder=l++,h.source=c}if(c.states)for(var i=[c].concat(a),f=0,g=c.states.length;f<g;f++)d(i,c.states[f]);switch(c.$type){case"parallel":c.typeEnum=w.PARALLEL;break;case"initial":c.typeEnum=w.INITIAL;break;case"history":c.typeEnum=w.HISTORY;break;case"final":c.typeEnum=w.FINAL;break;case"state":case"scxml":c.states&&c.states.length?c.typeEnum=w.COMPOSITE:c.typeEnum=w.BASIC;break;default:throw new Error("Unknown state type: "+c.$type)}c.states?c.descendants=c.states.concat(c.states.map(function(a){return a.descendants}).reduce(function(a,b){return a.concat(b)},[])):c.descendants=[];var m;if(c.typeEnum===w.COMPOSITE&&("string"==typeof c.initial?n.push(c):(m=c.states.filter(function(a){return"initial"===a.$type}),c.initialRef=m.length?m[0]:c.states[0],e(c))),c.typeEnum===w.COMPOSITE||c.typeEnum===w.PARALLEL){var o=c.states.filter(function(a){return"history"===a.$type});c.historyRef=o[0]}c.id||(c.id=b(c.$type),k.set(c.id,c)),c.onEntry&&!Array.isArray(c.onEntry)&&(c.onEntry=[c.onEntry]),c.onExit&&!Array.isArray(c.onExit)&&(c.onExit=[c.onExit])}function e(a){if(!a.initialRef)throw new Error("Unable to locate initial state for composite state: "+a.id)}function f(){for(var a=0,b=n.length;a<b;a++){var c=n[a];c.initialRef=k.get(c.initial),e(c)}}function g(){for(var a=0,b=j.length;a<b;a++){var c=j[a];if(c.onTransition&&!Array.isArray(c.onTransition)&&(c.onTransition=[c.onTransition]),"string"==typeof c.event&&(c.events=c.event.trim().split(o)),delete c.event,!c.targets&&"undefined"!=typeof c.target)if("string"==typeof c.target){var d=k.get(c.target);if(!d)throw new Error("Unable to find target state with id "+c.target);c.target=d,c.targets=[c.target]}else if(Array.isArray(c.target))c.targets=c.target.map(function(a){if("string"==typeof a){if(a=k.get(a),!a)throw new Error("Unable to find target state with id "+c.target);return a}return a});else{if("object"!==u(c.target))throw new Error("Transition target has unknown type: "+c.target);c.targets=[c.target]}}for(var a=0,b=j.length;a<b;a++){var c=j[a];c.targets&&(c.lcca=i(c.source,c.targets[0])),c.scope=h(c)}}function h(a){var b="internal"===a.type&&a.source.parent&&a.targets&&a.targets.every(function(b){return a.source.descendants.indexOf(b)>-1});return a.targets?b?a.source:a.lcca:a.source}function i(a,b){for(var c=[],d=0,e=a.ancestors.length;d<e;d++){var f=a.ancestors[d];f.typeEnum===w.COMPOSITE&&f.descendants.indexOf(b)>-1&&c.push(f)}if(!c.length)throw new Error("Could not find LCA for states.");return c[0]}var j=[],k=new Map,l=0,m={},n=[],o=/\s+/,p=c(a);return d([],p),g(),f(),p}function e(){this._listeners={},this._listeners["*"]=[]}function f(a){a=a||[],this.o=new Set(a)}function g(a,b){return a=a.replace(y,""),a===b||!(a.length>b.length)&&("."===b.charAt(a.length)&&0===b.indexOf(a))}function h(a,b){return a.events.some(function(a){return"*"===a||g(a,b)})}function i(a,b,c,d){return a.transitions.filter(function(a){return(d?!a.events:!a.events||b&&b.name&&h(a,b.name))&&(!a.cond||c(a.cond))})}function j(a){var b=t(a,2),c=b[0],d=b[1],e=k(c.source,d.source);switch(e){case 0:return c.documentOrder<d.documentOrder?c:d;case-1:return c;case 1:return d;default:throw new Error("Unexpected return value")}}function k(a,b){return console.log("getStateWithHigherSourceChildPriority",a.id,a.depth,a.documentOrder,b.id,b.depth,b.documentOrder),a.depth>b.depth?-1:a.depth<b.depth?1:a.documentOrder<b.documentOrder?1:a.documentOrder>b.documentOrder?-1:0}function l(a,b,c){return b.x=b.x||{},a.call(c,b.x,b.sessionid,b.ioprocessors,c.isIn.bind(c))}function m(a,b){return a.map(function(a){var c=b.get(a);if(!c)throw new Error("Error loading serialized configuration. Unable to locate state with id "+a);return c})}function n(a,b){var c={};return Object.keys(a).forEach(function(d){c[d]=a[d].map(function(a){var c=b.get(a);if(!c)throw new Error("Error loading serialized history. Unable to locate state with id "+a);return c})}),c}function o(a,b){e.call(this),this._scriptingContext=b.interpreterScriptingContext||(b.InterpreterScriptingContext?new b.InterpreterScriptingContext(this):{});var c;c="function"==typeof a?l(a,b,this):"string"==typeof a?JSON.parse(a):a,this._model=d(c),this.opts=b||{},this.opts.console=b.console||("undefined"==typeof console?{log:function(){}}:console),this.opts.Set=this.opts.Set||f,this.opts.priorityComparisonFn=this.opts.priorityComparisonFn||j,this.opts.transitionSelector=this.opts.transitionSelector||i,this._scriptingContext.log=this._scriptingContext.log||function(){this.opts.console.log.apply?this.opts.console.log.apply(this.opts.console,arguments):this.opts.console.log(Array.prototype.slice.apply(arguments).join(","))}.bind(this),this._internalEventQueue=[],b.snapshot?(this._configuration=new this.opts.Set(m(b.snapshot[0],this._model.$idToStateMap)),this._historyValue=n(b.snapshot[1],this._model.$idToStateMap),this._isInFinalState=b.snapshot[2],this._model.$deserializeDatamodel(b.snapshot[3])):(this._configuration=new this.opts.Set,this._historyValue={},this._isInFinalState=!1),this._x={_sessionId:b.sessionId||null,_name:c.name||b.name||null,_ioprocessors:b.ioprocessors||null},o.EVENTS.forEach(function(a){this.on(a,this._log.bind(this,a))},this)}function p(a,b){b=b||{},b.ioprocessors={};for(var c in x)b.ioprocessors[c]=x[c];b.InterpreterScriptingContext=b.InterpreterScriptingContext||s,this._isStepping=!1,o.call(this,a,b)}function q(a){function b(){}return b.prototype=a,new b}function r(){}function s(a){this._interpreter=a,this._timeoutMap={}}var t=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h["return"]&&h["return"]()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},v=Object.assign||function(a,b){return Object.keys(b).forEach(function(c){a[c]=b[c]}),a},w={BASIC:0,COMPOSITE:1,PARALLEL:2,HISTORY:3,INITIAL:4,FINAL:5},x={scxml:{location:"http://www.w3.org/TR/scxml/#SCXMLEventProcessor"},basichttp:{location:"http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor"},dom:{location:"http://www.w3.org/TR/scxml/#DOMEventProcessor"},publish:{location:"https://github.com/jbeard4/SCION#publish"}};e.prototype.on=function(a,b){return Array.isArray(this._listeners[a])||(this._listeners[a]=[]),this._listeners[a].indexOf(b)===-1&&this._listeners[a].push(b),this},e.prototype.once=function(a,b){function c(){for(var e=[],f=0;f<arguments.length;f+=1)e[f]=arguments[f];d.off(a,c),b.apply(d,e)}var d=this;return c.listener=b,this.on(a,c)},e.prototype.off=function(a,b){if(!Array.isArray(this._listeners[a]))return this;if("undefined"==typeof b)return this._listeners[a]=[],this;var c=this._listeners[a].indexOf(b);if(c===-1)for(var d=0;d<this._listeners[a].length;d+=1)if(this._listeners[a][d].listener===b){c=d;break}return this._listeners[a].splice(c,1),this},e.prototype.emit=function(a){var b,c,d=Array.prototype.slice.call(arguments),e=d.slice(1),f=this._listeners[a];if(Array.isArray(f))for(b=0,c=f.length;b<c;b++)f[b].apply(this,e);for(f=this._listeners["*"],b=0,c=f.length;b<c;b++)f[b].apply(this,d);return this},f.prototype={add:function(a){this.o.add(a)},remove:function(a){return this.o["delete"](a)},union:function(a){var b=!0,c=!1,d=void 0;try{for(var e,f=a.o[Symbol.iterator]();!(b=(e=f.next()).done);b=!0){var g=e.value;this.o.add(g)}}catch(h){c=!0,d=h}finally{try{!b&&f["return"]&&f["return"]()}finally{if(c)throw d}}return this},difference:function(a){var b=!0,c=!1,d=void 0;try{for(var e,f=a.o[Symbol.iterator]();!(b=(e=f.next()).done);b=!0){var g=e.value;this.o["delete"](g)}}catch(h){c=!0,d=h}finally{try{!b&&f["return"]&&f["return"]()}finally{if(c)throw d}}return this},contains:function(a){return this.o.has(a)},iter:function(){return Array.from(this.o)},isEmpty:function(){return!this.o.size},size:function(){return this.o.size},equals:function(a){if(this.o.size!==a.size())return!1;var b=!0,c=!1,d=void 0;try{for(var e,f=this.o[Symbol.iterator]();!(b=(e=f.next()).done);b=!0){var g=e.value;if(!a.contains(g))return!1}}catch(h){c=!0,d=h}finally{try{!b&&f["return"]&&f["return"]()}finally{if(c)throw d}}return!0},toString:function(){return 0===this.o.size?"<empty>":Array.from(this.o).join(",\n")}};var y=/\.\*$/,z={getAncestors:function(a,b){var c;return c=a.ancestors.indexOf(b),c>-1?a.ancestors.slice(0,c):a.ancestors},getAncestorsOrSelf:function(a,b){return[a].concat(this.getAncestors(a,b))},getDescendantsOrSelf:function(a){return[a].concat(a.descendants)},isOrthogonalTo:function(a,b){return!this.isAncestrallyRelatedTo(a,b)&&this.getLCA(a,b).typeEnum===w.PARALLEL},isAncestrallyRelatedTo:function(a,b){return this.getAncestorsOrSelf(b).indexOf(a)>-1||this.getAncestorsOrSelf(a).indexOf(b)>-1},getLCA:function(a,b){var c=this.getAncestors(a).filter(function(a){return a.descendants.indexOf(b)>-1},this);return c[0]}};o.EVENTS=["onEntry","onExit","onTransition","onError","onBigStepBegin","onBigStepSuspend","onBigStepResume","onSmallStepBegin","onSmallStepEnd","onBigStepEnd"],o.prototype=v(q(e.prototype),{start:function(){return this._log("performing initial big step"),this._configuration.add(this._model.initialRef),this._performBigStep(),this.getConfiguration()},startAsync:function(a){"function"!=typeof a&&(a=r),this._log("performing initial big step"),this._configuration.add(this._model.initialRef),this._performBigStepAsync(null,a)},getConfiguration:function(){return this._configuration.iter().map(function(a){return a.id})},getFullConfiguration:function(){return this._configuration.iter().map(function(a){return[a].concat(z.getAncestors(a))},this).reduce(function(a,b){return a.concat(b)},[]).map(function(a){return a.id}).reduce(function(a,b){return a.indexOf(b)>-1?a:a.concat(b)},[])},isIn:function(a){return this.getFullConfiguration().indexOf(a)>-1},isFinal:function(a){return this._isInFinalState},_performBigStep:function(a){this.emit("onBigStepBegin"),a&&this._internalEventQueue.push(a);for(var b=!0;b;){var c=this._internalEventQueue.shift()||null,d=this._selectTransitions(c,!0);d.isEmpty()&&(d=this._selectTransitions(c,!1)),this.emit("onSmallStepBegin",c),this._performSmallStep(c,d),this.emit("onSmallStepEnd",c),b=!d.isEmpty()}this._isInFinalState=this._configuration.iter().every(function(a){return a.typeEnum===w.FINAL}),this.emit("onBigStepEnd")},_performBigStepAsync:function(a,b){function c(a){var e;try{d.emit(a);var f=d._internalEventQueue.shift()||null,e=d._selectTransitions(f,!0);e.isEmpty()&&(e=d._selectTransitions(f,!1)),d.emit("onSmallStepBegin",f),d._performSmallStep(f,e),d.emit("onSmallStepEnd",f)}catch(g){return void b(g)}e.isEmpty()?(d._isInFinalState=d._configuration.iter().every(function(a){return a.typeEnum===w.FINAL}),d.emit("onBigStepEnd"),b(void 0,d.getConfiguration())):(d.emit("onBigStepSuspend"),setImmediate(c,"onBigStepResume"))}a&&this._internalEventQueue.push(a);var d=this;c("onBigStepBegin")},_performSmallStep:function(a,d){if(this._log("selecting transitions with currentEvent",JSON.stringify(a)),this._log("selected transitions",d),!d.isEmpty()){this._log("sorted transitions",d);var e=new this.opts.Set(d.iter().filter(b)),f=this._getStatesExited(e),g=f[0],h=f[1],i=this._getStatesEntered(e),j=i[0],k=i[1];this._log("basicStatesExited ",g),this._log("basicStatesEntered ",j),this._log("statesExited ",h),this._log("statesEntered ",k);var l=new this.opts.Set;this._log("executing state exit actions");for(var m=0,n=h.length;m<n;m++){var o=h[m];if(this._log("exiting ",o.id),this.emit("onExit",o.id),void 0!==o.onExit)for(var p=0,q=o.onExit.length;p<q;p++)this._evaluateAction(a,o.onExit[p]);var r;o.historyRef&&(r=o.historyRef.isDeep?function(a){return a.typeEnum===w.BASIC&&o.descendants.indexOf(a)>-1}:function(a){return a.parent===o},this._historyValue[o.historyRef.id]=h.filter(r))}var s=d.iter().sort(c);this._log("executing transitition actions");for(var t=0,n=s.length;t<n;t++){var u=s[t],v=u.targets&&u.targets.map(function(a){return a.id});if(this.emit("onTransition",u.source.id,v,t),void 0!==u.onTransition)for(var x=0,y=u.onTransition.length;x<y;x++)this._evaluateAction(a,u.onTransition[x])}this._log("executing state enter actions");for(var z=0,A=k.length;z<A;z++){var B=k[z];if(this._log("entering",B.id),this.emit("onEntry",B.id),void 0!==B.onEntry)for(var C=0,D=B.onEntry.length;C<D;C++)this._evaluateAction(a,B.onEntry[C])}this._log("updating configuration "),this._log("old configuration ",this._configuration),this._configuration.difference(g),this._configuration.union(j),this._log("new configuration ",this._configuration),l.isEmpty()||(this._log("adding triggered events to inner queue ",l),this._internalEventQueue.push(l))}return d},_evaluateAction:function(a,b){try{return b.call(this._scriptingContext,a)}catch(c){var d={tagname:b.tagname,line:b.line,column:b.column,reason:c.message};this._internalEventQueue.push({name:"error.execution",data:d}),this.emit("onError",d)}},_getStatesExited:function(a){for(var b=new this.opts.Set,c=new this.opts.Set,d=a.iter(),e=0,f=d.length;e<f;e++)for(var g=d[e],h=g.scope,i=h.descendants,j=this._configuration.iter(),l=0,m=j.length;l<m;l++){var n=j[l];if(i.indexOf(n)>-1){c.add(n),b.add(n);for(var o=z.getAncestors(n,h),p=0,q=o.length;p<q;p++)b.add(o[p])}}var r=b.iter().sort(k);return[c,r]},_getStatesEntered:function(a){for(var b={statesToEnter:new this.opts.Set,basicStatesToEnter:new this.opts.Set,statesProcessed:new this.opts.Set,statesToProcess:[]},c=a.iter(),d=0,e=c.length;d<e;d++)for(var f=c[d],g=0,h=f.targets.length;g<h;g++)this._addStateAndAncestors(f.targets[g],f.scope,b);for(var i;i=b.statesToProcess.pop();)this._addStateAndDescendants(i,b);var j=b.statesToEnter.iter().sort(function(a,b){return k(a,b)*-1});return[b.basicStatesToEnter,j]},_addStateAndAncestors:function(a,b,c){this._addStateAndDescendants(a,c);for(var d=z.getAncestors(a,b),e=0,f=d.length;e<f;e++){var g=d[e];g.typeEnum===w.COMPOSITE?(c.statesToEnter.add(g),c.statesProcessed.add(g)):this._addStateAndDescendants(g,c)}},_addStateAndDescendants:function(a,b){b.statesProcessed.contains(a)||(a.typeEnum===w.HISTORY?a.id in this._historyValue?this._historyValue[a.id].forEach(function(c){this._addStateAndAncestors(c,a.parent,b)},this):(b.statesToEnter.add(a),b.basicStatesToEnter.add(a)):(b.statesToEnter.add(a),a.typeEnum===w.PARALLEL?b.statesToProcess.push.apply(b.statesToProcess,a.states.filter(function(a){return a.typeEnum!==w.HISTORY})):a.typeEnum===w.COMPOSITE?b.statesToProcess.push(a.initialRef):a.typeEnum!==w.INITIAL&&a.typeEnum!==w.BASIC&&a.typeEnum!==w.FINAL||b.basicStatesToEnter.add(a)),b.statesProcessed.add(a))},_selectTransitions:function(a,b){if(this.opts.onlySelectFromBasicStates)var c=this._configuration.iter();else{for(var d=new this.opts.Set,e=this._configuration.iter(),f=0,g=e.length;f<g;f++){var h=e[f];d.add(h);for(var i=z.getAncestors(h),j=0,k=i.length;j<k;j++)d.add(i[j])}c=d.iter()}for(var l=this.opts.transitionSelector,m=new this.opts.Set,n=this._evaluateAction.bind(this,a),o=0,p=c.length;o<p;o++)for(var q=l(c[o],a,n,b),r=0,g=q.length;r<g;r++)m.add(q[r]);var s=this._selectPriorityEnabledTransitions(m);return this._log("priorityEnabledTransitions",s),s},_selectPriorityEnabledTransitions:function(a){var b=new this.opts.Set,c=this._getInconsistentTransitions(a),d=c[0],e=c[1];for(b.union(d),this._log("enabledTransitions",a),this._log("consistentTransitions",d),this._log("inconsistentTransitionsPairs",e),this._log("priorityEnabledTransitions",b);!e.isEmpty();)a=new this.opts.Set(e.iter().map(function(a){return this.opts.priorityComparisonFn(a)},this)),c=this._getInconsistentTransitions(a),d=c[0],e=c[1],b.union(d),this._log("enabledTransitions",a),this._log("consistentTransitions",d),this._log("inconsistentTransitionsPairs",e),this._log("priorityEnabledTransitions",b);return b},_getInconsistentTransitions:function(a){var b=new this.opts.Set,c=new this.opts.Set,d=a.iter();this._log("transitions",a);for(var e=0;e<d.length;e++)for(var f=e+1;f<d.length;f++){var g=d[e],h=d[f];this._conflicts(g,h)&&(b.add(g),b.add(h),c.add([g,h]))}var i=a.difference(b);return[i,c]},_log:function(){},_conflicts:function(a,b){return!this._isArenaOrthogonal(a,b)},_isArenaOrthogonal:function(a,b){this._log("transition scopes",a.scope,b.scope);var c=z.isOrthogonalTo(a.scope,b.scope);return this._log("transition scopes are orthogonal?",c),c},registerListener:function(a){o.EVENTS.forEach(function(b){a[b]&&this.on(b,a[b])})},unregisterListener:function(a){o.EVENTS.forEach(function(b){a[b]&&this.off(b,a[b])})},getAllTransitionEvents:function(){function a(c){if(c.transitions)for(var d=0,e=c.transitions.length;d<e;d++)b[c.transitions[d].event]=!0;if(c.states)for(var f=0,g=c.states.length;f<g;f++)a(c.states[f])}var b={};return a(this._model),Object.keys(b)},getSnapshot:function(){if(this._isStepping)throw new Error("getSnapshot cannot be called while interpreter is executing a big-step");return[this.getConfiguration(),this._serializeHistory(),this._isInFinalState,this._model.$serializeDatamodel()]},_serializeHistory:function(){var a={};return Object.keys(this._historyValue).forEach(function(b){a[b]=this._historyValue[b].map(function(a){return a.id})},this),a}}),p.prototype=q(o.prototype),p.prototype.gen=function(a,b){var c;switch("undefined"==typeof a?"undefined":u(a)){case"string":c={name:a,data:b};break;case"object":if("string"!=typeof a.name)throw new Error('Event object must have "name" property of type string.');c=a;break;default:throw new Error("First argument to gen must be a string or object.")}if(this._isStepping)throw new Error("Cannot call gen during a big-step");return this._isStepping=!0,this._performBigStep(c),this._isStepping=!1,this.getConfiguration()},p.prototype.genAsync=function(a,b){if("object"!==("undefined"==typeof a?"undefined":u(a))||!a||"string"!=typeof a.name)throw new Error("expected currentEvent to be an Object with a name");if(this._isStepping)throw new Error("Cannot call gen during a big-step");"function"!=typeof b&&(b=r),this._isStepping=!0;var c=this;this._performBigStepAsync(a,function(a,d){c._isStepping=!1,b(a,d)})};var A=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;s.prototype={raise:function(a){this._interpreter._internalEventQueue.push(a)},send:function(a,b){function c(a,b,c){if(a.target){var d=A.test(a.target);if(!d)return this.raise({name:"error.execution",data:"Target is not valid URI",sendid:b.sendid})}var e=Object.keys(x).map(function(a){return x[a].location});return e.indexOf(a.type)===-1?this.raise({name:"error.execution",data:"Unsupported event processor type",sendid:b.sendid}):void c.call(this,a,b)}function d(a,b){if("undefined"==typeof setTimeout)throw new Error("Default implementation of Statechart.prototype.send will not work unless setTimeout is defined globally.");var c=setTimeout(this._interpreter.gen.bind(this._interpreter,a),b.delay||0);b.sendid&&(this._timeoutMap[b.sendid]=c)}function e(){this._interpreter.emit(a.name,a.data)}a.type=a.type||x.scxml.location;var f;f="https://github.com/jbeard4/SCION#publish"===a.type?e:this._interpreter.opts.customSend?this._interpreter.opts.customSend:d,b=b||{},this._interpreter._log("sending event",a.name,"with content",a.data,"after delay",b.delay),c.call(this,a,b,f)},cancel:function(a){if(this._interpreter.opts.customCancel)return this._interpreter.opts.customCancel.apply(this,[a]);if("undefined"==typeof clearTimeout)throw new Error("Default implementation of Statechart.prototype.cancel will not work unless setTimeout is defined globally.");a in this._timeoutMap&&(this._interpreter._log("cancelling ",a," with timeout id ",this._timeoutMap[a]),clearTimeout(this._timeoutMap[a]))}},a.exports={BaseInterpreter:o,Statechart:p,ArraySet:f,STATE_TYPES:w,initializeModel:d,InterpreterScriptingContext:s,ioProcessorTypes:x}});
!function(a,b){if("function"==typeof define&&define.amd)define(["module"],b);else if("undefined"!=typeof exports)b(module);else{var c={exports:{}};b(c),a.scion=c.exports}}(this,function(a){"use strict";function b(a){return a.targets}function c(a,b){return a.documentOrder-b.documentOrder}function d(a){function b(a){void 0===m[a]&&(m[a]=0);var b=m[a]++;return"$generated-"+a+"-"+b}function c(a){return{$deserializeDatamodel:a.$deserializeDatamodel||function(){},$serializeDatamodel:a.$serializeDatamodel||function(){return null},$idToStateMap:k,states:[{$type:"initial",transitions:[{target:a}]},a]}}function d(a,c){if(c.transitions&&j.push.apply(j,c.transitions),c.id){if(k.has(c.id))throw new Error("Redefinition of state id "+c.id);k.set(c.id,c)}c.$type=c.$type||"state",c.ancestors=a,c.depth=a.length,c.parent=a[0],c.documentOrder=l++,c.transitions=c.transitions||[];for(var f=0,g=c.transitions.length;f<g;f++){var h=c.transitions[f];h.documentOrder=l++,h.source=c}if(c.states)for(var i=[c].concat(a),f=0,g=c.states.length;f<g;f++)d(i,c.states[f]);switch(c.$type){case"parallel":c.typeEnum=w.PARALLEL;break;case"initial":c.typeEnum=w.INITIAL;break;case"history":c.typeEnum=w.HISTORY;break;case"final":c.typeEnum=w.FINAL;break;case"state":case"scxml":c.states&&c.states.length?c.typeEnum=w.COMPOSITE:c.typeEnum=w.BASIC;break;default:throw new Error("Unknown state type: "+c.$type)}c.states?c.descendants=c.states.concat(c.states.map(function(a){return a.descendants}).reduce(function(a,b){return a.concat(b)},[])):c.descendants=[];var m;if(c.typeEnum===w.COMPOSITE&&("string"==typeof c.initial?n.push(c):(m=c.states.filter(function(a){return"initial"===a.$type}),c.initialRef=m.length?m[0]:c.states[0],e(c))),c.typeEnum===w.COMPOSITE||c.typeEnum===w.PARALLEL){var o=c.states.filter(function(a){return"history"===a.$type});c.historyRef=o[0]}c.id||(c.id=b(c.$type),k.set(c.id,c)),c.onEntry&&!Array.isArray(c.onEntry)&&(c.onEntry=[c.onEntry]),c.onExit&&!Array.isArray(c.onExit)&&(c.onExit=[c.onExit])}function e(a){if(!a.initialRef)throw new Error("Unable to locate initial state for composite state: "+a.id)}function f(){for(var a=0,b=n.length;a<b;a++){var c=n[a];c.initialRef=k.get(c.initial),e(c)}}function g(){for(var a=0,b=j.length;a<b;a++){var c=j[a];if(c.onTransition&&!Array.isArray(c.onTransition)&&(c.onTransition=[c.onTransition]),"string"==typeof c.event&&(c.events=c.event.trim().split(o)),delete c.event,!c.targets&&"undefined"!=typeof c.target)if("string"==typeof c.target){var d=k.get(c.target);if(!d)throw new Error("Unable to find target state with id "+c.target);c.target=d,c.targets=[c.target]}else if(Array.isArray(c.target))c.targets=c.target.map(function(a){if("string"==typeof a){if(a=k.get(a),!a)throw new Error("Unable to find target state with id "+c.target);return a}return a});else{if("object"!==u(c.target))throw new Error("Transition target has unknown type: "+c.target);c.targets=[c.target]}}for(var a=0,b=j.length;a<b;a++){var c=j[a];c.targets&&(c.lcca=i(c.source,c.targets[0])),c.scope=h(c)}}function h(a){var b="internal"===a.type&&a.source.parent&&a.targets&&a.targets.every(function(b){return a.source.descendants.indexOf(b)>-1});return a.targets?b?a.source:a.lcca:a.source}function i(a,b){for(var c=[],d=0,e=a.ancestors.length;d<e;d++){var f=a.ancestors[d];f.typeEnum===w.COMPOSITE&&f.descendants.indexOf(b)>-1&&c.push(f)}if(!c.length)throw new Error("Could not find LCA for states.");return c[0]}var j=[],k=new Map,l=0,m={},n=[],o=/\s+/,p=c(a);return d([],p),g(),f(),p}function e(){this._listeners={},this._listeners["*"]=[]}function f(a){a=a||[],this.o=new Set(a)}function g(a,b){return a=a.replace(y,""),a===b||!(a.length>b.length)&&("."===b.charAt(a.length)&&0===b.indexOf(a))}function h(a,b){return a.events.some(function(a){return"*"===a||g(a,b)})}function i(a,b,c,d){return a.transitions.filter(function(a){return(d?!a.events:!a.events||b&&b.name&&h(a,b.name))&&(!a.cond||c(a.cond))})}function j(a){var b=t(a,2),c=b[0],d=b[1],e=k(c.source,d.source);switch(e){case 0:return c.documentOrder<d.documentOrder?c:d;case-1:return c;case 1:return d;default:throw new Error("Unexpected return value")}}function k(a,b){return a.depth>b.depth?-1:a.depth<b.depth?1:a.documentOrder<b.documentOrder?1:a.documentOrder>b.documentOrder?-1:0}function l(a,b,c){return b.x=b.x||{},a.call(c,b.x,b.sessionid,b.ioprocessors,c.isIn.bind(c))}function m(a,b){return a.map(function(a){var c=b.get(a);if(!c)throw new Error("Error loading serialized configuration. Unable to locate state with id "+a);return c})}function n(a,b){var c={};return Object.keys(a).forEach(function(d){c[d]=a[d].map(function(a){var c=b.get(a);if(!c)throw new Error("Error loading serialized history. Unable to locate state with id "+a);return c})}),c}function o(a,b){e.call(this),this._scriptingContext=b.interpreterScriptingContext||(b.InterpreterScriptingContext?new b.InterpreterScriptingContext(this):{});var c;c="function"==typeof a?l(a,b,this):"string"==typeof a?JSON.parse(a):a,this._model=d(c),this.opts=b||{},this.opts.console=b.console||("undefined"==typeof console?{log:function(){}}:console),this.opts.Set=this.opts.Set||f,this.opts.priorityComparisonFn=this.opts.priorityComparisonFn||j,this.opts.transitionSelector=this.opts.transitionSelector||i,this._scriptingContext.log=this._scriptingContext.log||function(){this.opts.console.log.apply?this.opts.console.log.apply(this.opts.console,arguments):this.opts.console.log(Array.prototype.slice.apply(arguments).join(","))}.bind(this),this._internalEventQueue=[],b.snapshot?(this._configuration=new this.opts.Set(m(b.snapshot[0],this._model.$idToStateMap)),this._historyValue=n(b.snapshot[1],this._model.$idToStateMap),this._isInFinalState=b.snapshot[2],this._model.$deserializeDatamodel(b.snapshot[3])):(this._configuration=new this.opts.Set,this._historyValue={},this._isInFinalState=!1),this._x={_sessionId:b.sessionId||null,_name:c.name||b.name||null,_ioprocessors:b.ioprocessors||null},o.EVENTS.forEach(function(a){this.on(a,this._log.bind(this,a))},this)}function p(a,b){b=b||{},b.ioprocessors={};for(var c in x)b.ioprocessors[c]=x[c];b.InterpreterScriptingContext=b.InterpreterScriptingContext||s,this._isStepping=!1,o.call(this,a,b)}function q(a){function b(){}return b.prototype=a,new b}function r(){}function s(a){this._interpreter=a,this._timeoutMap={}}var t=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h["return"]&&h["return"]()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},v=Object.assign||function(a,b){return Object.keys(b).forEach(function(c){a[c]=b[c]}),a},w={BASIC:0,COMPOSITE:1,PARALLEL:2,HISTORY:3,INITIAL:4,FINAL:5},x={scxml:{location:"http://www.w3.org/TR/scxml/#SCXMLEventProcessor"},basichttp:{location:"http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor"},dom:{location:"http://www.w3.org/TR/scxml/#DOMEventProcessor"},publish:{location:"https://github.com/jbeard4/SCION#publish"}};e.prototype.on=function(a,b){return Array.isArray(this._listeners[a])||(this._listeners[a]=[]),this._listeners[a].indexOf(b)===-1&&this._listeners[a].push(b),this},e.prototype.once=function(a,b){function c(){for(var e=[],f=0;f<arguments.length;f+=1)e[f]=arguments[f];d.off(a,c),b.apply(d,e)}var d=this;return c.listener=b,this.on(a,c)},e.prototype.off=function(a,b){if(!Array.isArray(this._listeners[a]))return this;if("undefined"==typeof b)return this._listeners[a]=[],this;var c=this._listeners[a].indexOf(b);if(c===-1)for(var d=0;d<this._listeners[a].length;d+=1)if(this._listeners[a][d].listener===b){c=d;break}return this._listeners[a].splice(c,1),this},e.prototype.emit=function(a){var b,c,d=Array.prototype.slice.call(arguments),e=d.slice(1),f=this._listeners[a];if(Array.isArray(f))for(b=0,c=f.length;b<c;b++)f[b].apply(this,e);for(f=this._listeners["*"],b=0,c=f.length;b<c;b++)f[b].apply(this,d);return this},f.prototype={add:function(a){this.o.add(a)},remove:function(a){return this.o["delete"](a)},union:function(a){var b=!0,c=!1,d=void 0;try{for(var e,f=a.o[Symbol.iterator]();!(b=(e=f.next()).done);b=!0){var g=e.value;this.o.add(g)}}catch(h){c=!0,d=h}finally{try{!b&&f["return"]&&f["return"]()}finally{if(c)throw d}}return this},difference:function(a){var b=!0,c=!1,d=void 0;try{for(var e,f=a.o[Symbol.iterator]();!(b=(e=f.next()).done);b=!0){var g=e.value;this.o["delete"](g)}}catch(h){c=!0,d=h}finally{try{!b&&f["return"]&&f["return"]()}finally{if(c)throw d}}return this},contains:function(a){return this.o.has(a)},iter:function(){return Array.from(this.o)},isEmpty:function(){return!this.o.size},size:function(){return this.o.size},equals:function(a){if(this.o.size!==a.size())return!1;var b=!0,c=!1,d=void 0;try{for(var e,f=this.o[Symbol.iterator]();!(b=(e=f.next()).done);b=!0){var g=e.value;if(!a.contains(g))return!1}}catch(h){c=!0,d=h}finally{try{!b&&f["return"]&&f["return"]()}finally{if(c)throw d}}return!0},toString:function(){return 0===this.o.size?"<empty>":Array.from(this.o).join(",\n")}};var y=/\.\*$/,z={getAncestors:function(a,b){var c;return c=a.ancestors.indexOf(b),c>-1?a.ancestors.slice(0,c):a.ancestors},getAncestorsOrSelf:function(a,b){return[a].concat(this.getAncestors(a,b))},getDescendantsOrSelf:function(a){return[a].concat(a.descendants)},isOrthogonalTo:function(a,b){return!this.isAncestrallyRelatedTo(a,b)&&this.getLCA(a,b).typeEnum===w.PARALLEL},isAncestrallyRelatedTo:function(a,b){return this.getAncestorsOrSelf(b).indexOf(a)>-1||this.getAncestorsOrSelf(a).indexOf(b)>-1},getLCA:function(a,b){var c=this.getAncestors(a).filter(function(a){return a.descendants.indexOf(b)>-1},this);return c[0]}};o.EVENTS=["onEntry","onExit","onTransition","onError","onBigStepBegin","onBigStepSuspend","onBigStepResume","onSmallStepBegin","onSmallStepEnd","onBigStepEnd"],o.prototype=v(q(e.prototype),{start:function(){return this._log("performing initial big step"),this._configuration.add(this._model.initialRef),this._performBigStep(),this.getConfiguration()},startAsync:function(a){"function"!=typeof a&&(a=r),this._log("performing initial big step"),this._configuration.add(this._model.initialRef),this._performBigStepAsync(null,a)},getConfiguration:function(){return this._configuration.iter().map(function(a){return a.id})},getFullConfiguration:function(){return this._configuration.iter().map(function(a){return[a].concat(z.getAncestors(a))},this).reduce(function(a,b){return a.concat(b)},[]).map(function(a){return a.id}).reduce(function(a,b){return a.indexOf(b)>-1?a:a.concat(b)},[])},isIn:function(a){return this.getFullConfiguration().indexOf(a)>-1},isFinal:function(a){return this._isInFinalState},_performBigStep:function(a){this.emit("onBigStepBegin"),a&&this._internalEventQueue.push(a);for(var b=!0;b;){var c=this._internalEventQueue.shift()||null,d=this._selectTransitions(c,!0);d.isEmpty()&&(d=this._selectTransitions(c,!1)),this.emit("onSmallStepBegin",c),this._performSmallStep(c,d),this.emit("onSmallStepEnd",c),b=!d.isEmpty()}this._isInFinalState=this._configuration.iter().every(function(a){return a.typeEnum===w.FINAL}),this.emit("onBigStepEnd")},_performBigStepAsync:function(a,b){function c(a){var e;try{d.emit(a);var f=d._internalEventQueue.shift()||null,e=d._selectTransitions(f,!0);e.isEmpty()&&(e=d._selectTransitions(f,!1)),d.emit("onSmallStepBegin",f),d._performSmallStep(f,e),d.emit("onSmallStepEnd",f)}catch(g){return void b(g)}e.isEmpty()?(d._isInFinalState=d._configuration.iter().every(function(a){return a.typeEnum===w.FINAL}),d.emit("onBigStepEnd"),b(void 0,d.getConfiguration())):(d.emit("onBigStepSuspend"),setImmediate(c,"onBigStepResume"))}a&&this._internalEventQueue.push(a);var d=this;c("onBigStepBegin")},_performSmallStep:function(a,d){if(this._log("selecting transitions with currentEvent",JSON.stringify(a)),this._log("selected transitions",d),!d.isEmpty()){this._log("sorted transitions",d);var e=new this.opts.Set(d.iter().filter(b)),f=this._getStatesExited(e),g=f[0],h=f[1],i=this._getStatesEntered(e),j=i[0],k=i[1];this._log("basicStatesExited ",g),this._log("basicStatesEntered ",j),this._log("statesExited ",h),this._log("statesEntered ",k);var l=new this.opts.Set;this._log("executing state exit actions");for(var m=0,n=h.length;m<n;m++){var o=h[m];if(this._log("exiting ",o.id),this.emit("onExit",o.id),void 0!==o.onExit)for(var p=0,q=o.onExit.length;p<q;p++)this._evaluateAction(a,o.onExit[p]);var r;o.historyRef&&(r=o.historyRef.isDeep?function(a){return a.typeEnum===w.BASIC&&o.descendants.indexOf(a)>-1}:function(a){return a.parent===o},this._historyValue[o.historyRef.id]=h.filter(r))}var s=d.iter().sort(c);this._log("executing transitition actions");for(var t=0,n=s.length;t<n;t++){var u=s[t],v=u.targets&&u.targets.map(function(a){return a.id});if(this.emit("onTransition",u.source.id,v,t),void 0!==u.onTransition)for(var x=0,y=u.onTransition.length;x<y;x++)this._evaluateAction(a,u.onTransition[x])}this._log("executing state enter actions");for(var z=0,A=k.length;z<A;z++){var B=k[z];if(this._log("entering",B.id),this.emit("onEntry",B.id),void 0!==B.onEntry)for(var C=0,D=B.onEntry.length;C<D;C++)this._evaluateAction(a,B.onEntry[C])}this._log("updating configuration "),this._log("old configuration ",this._configuration),this._configuration.difference(g),this._configuration.union(j),this._log("new configuration ",this._configuration),l.isEmpty()||(this._log("adding triggered events to inner queue ",l),this._internalEventQueue.push(l))}return d},_evaluateAction:function(a,b){try{return b.call(this._scriptingContext,a)}catch(c){var d={tagname:b.tagname,line:b.line,column:b.column,reason:c.message};this._internalEventQueue.push({name:"error.execution",data:d}),this.emit("onError",d)}},_getStatesExited:function(a){for(var b=new this.opts.Set,c=new this.opts.Set,d=a.iter(),e=0,f=d.length;e<f;e++)for(var g=d[e],h=g.scope,i=h.descendants,j=this._configuration.iter(),l=0,m=j.length;l<m;l++){var n=j[l];if(i.indexOf(n)>-1){c.add(n),b.add(n);for(var o=z.getAncestors(n,h),p=0,q=o.length;p<q;p++)b.add(o[p])}}var r=b.iter().sort(k);return[c,r]},_getStatesEntered:function(a){for(var b={statesToEnter:new this.opts.Set,basicStatesToEnter:new this.opts.Set,statesProcessed:new this.opts.Set,statesToProcess:[]},c=a.iter(),d=0,e=c.length;d<e;d++)for(var f=c[d],g=0,h=f.targets.length;g<h;g++)this._addStateAndAncestors(f.targets[g],f.scope,b);for(var i;i=b.statesToProcess.pop();)this._addStateAndDescendants(i,b);var j=b.statesToEnter.iter().sort(function(a,b){return k(a,b)*-1});return[b.basicStatesToEnter,j]},_addStateAndAncestors:function(a,b,c){this._addStateAndDescendants(a,c);for(var d=z.getAncestors(a,b),e=0,f=d.length;e<f;e++){var g=d[e];g.typeEnum===w.COMPOSITE?(c.statesToEnter.add(g),c.statesProcessed.add(g)):this._addStateAndDescendants(g,c)}},_addStateAndDescendants:function(a,b){b.statesProcessed.contains(a)||(a.typeEnum===w.HISTORY?a.id in this._historyValue?this._historyValue[a.id].forEach(function(c){this._addStateAndAncestors(c,a.parent,b)},this):(b.statesToEnter.add(a),b.basicStatesToEnter.add(a)):(b.statesToEnter.add(a),a.typeEnum===w.PARALLEL?b.statesToProcess.push.apply(b.statesToProcess,a.states.filter(function(a){return a.typeEnum!==w.HISTORY})):a.typeEnum===w.COMPOSITE?b.statesToProcess.push(a.initialRef):a.typeEnum!==w.INITIAL&&a.typeEnum!==w.BASIC&&a.typeEnum!==w.FINAL||b.basicStatesToEnter.add(a)),b.statesProcessed.add(a))},_selectTransitions:function(a,b){if(this.opts.onlySelectFromBasicStates)var c=this._configuration.iter();else{for(var d=new this.opts.Set,e=this._configuration.iter(),f=0,g=e.length;f<g;f++){var h=e[f];d.add(h);for(var i=z.getAncestors(h),j=0,k=i.length;j<k;j++)d.add(i[j])}c=d.iter()}for(var l=this.opts.transitionSelector,m=new this.opts.Set,n=this._evaluateAction.bind(this,a),o=0,p=c.length;o<p;o++)for(var q=l(c[o],a,n,b),r=0,g=q.length;r<g;r++)m.add(q[r]);var s=this._selectPriorityEnabledTransitions(m);return this._log("priorityEnabledTransitions",s),s},_selectPriorityEnabledTransitions:function(a){var b=new this.opts.Set,c=this._getInconsistentTransitions(a),d=c[0],e=c[1];for(b.union(d),this._log("enabledTransitions",a),this._log("consistentTransitions",d),this._log("inconsistentTransitionsPairs",e),this._log("priorityEnabledTransitions",b);!e.isEmpty();)a=new this.opts.Set(e.iter().map(function(a){return this.opts.priorityComparisonFn(a)},this)),c=this._getInconsistentTransitions(a),d=c[0],e=c[1],b.union(d),this._log("enabledTransitions",a),this._log("consistentTransitions",d),this._log("inconsistentTransitionsPairs",e),this._log("priorityEnabledTransitions",b);return b},_getInconsistentTransitions:function(a){var b=new this.opts.Set,c=new this.opts.Set,d=a.iter();this._log("transitions",a);for(var e=0;e<d.length;e++)for(var f=e+1;f<d.length;f++){var g=d[e],h=d[f];this._conflicts(g,h)&&(b.add(g),b.add(h),c.add([g,h]))}var i=a.difference(b);return[i,c]},_log:function(){},_conflicts:function(a,b){return!this._isArenaOrthogonal(a,b)},_isArenaOrthogonal:function(a,b){this._log("transition scopes",a.scope,b.scope);var c=z.isOrthogonalTo(a.scope,b.scope);return this._log("transition scopes are orthogonal?",c),c},registerListener:function(a){o.EVENTS.forEach(function(b){a[b]&&this.on(b,a[b])})},unregisterListener:function(a){o.EVENTS.forEach(function(b){a[b]&&this.off(b,a[b])})},getAllTransitionEvents:function(){function a(c){if(c.transitions)for(var d=0,e=c.transitions.length;d<e;d++)b[c.transitions[d].event]=!0;if(c.states)for(var f=0,g=c.states.length;f<g;f++)a(c.states[f])}var b={};return a(this._model),Object.keys(b)},getSnapshot:function(){if(this._isStepping)throw new Error("getSnapshot cannot be called while interpreter is executing a big-step");return[this.getConfiguration(),this._serializeHistory(),this._isInFinalState,this._model.$serializeDatamodel()]},_serializeHistory:function(){var a={};return Object.keys(this._historyValue).forEach(function(b){a[b]=this._historyValue[b].map(function(a){return a.id})},this),a}}),p.prototype=q(o.prototype),p.prototype.gen=function(a,b){var c;switch("undefined"==typeof a?"undefined":u(a)){case"string":c={name:a,data:b};break;case"object":if("string"!=typeof a.name)throw new Error('Event object must have "name" property of type string.');c=a;break;default:throw new Error("First argument to gen must be a string or object.")}if(this._isStepping)throw new Error("Cannot call gen during a big-step");return this._isStepping=!0,this._performBigStep(c),this._isStepping=!1,this.getConfiguration()},p.prototype.genAsync=function(a,b){if("object"!==("undefined"==typeof a?"undefined":u(a))||!a||"string"!=typeof a.name)throw new Error("expected currentEvent to be an Object with a name");if(this._isStepping)throw new Error("Cannot call gen during a big-step");"function"!=typeof b&&(b=r),this._isStepping=!0;var c=this;this._performBigStepAsync(a,function(a,d){c._isStepping=!1,b(a,d)})};var A=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;s.prototype={raise:function(a){this._interpreter._internalEventQueue.push(a)},send:function(a,b){function c(a,b,c){if(a.target){var d=A.test(a.target);if(!d)return this.raise({name:"error.execution",data:"Target is not valid URI",sendid:b.sendid})}var e=Object.keys(x).map(function(a){return x[a].location});return e.indexOf(a.type)===-1?this.raise({name:"error.execution",data:"Unsupported event processor type",sendid:b.sendid}):void c.call(this,a,b)}function d(a,b){if("undefined"==typeof setTimeout)throw new Error("Default implementation of Statechart.prototype.send will not work unless setTimeout is defined globally.");var c=setTimeout(this._interpreter.gen.bind(this._interpreter,a),b.delay||0);b.sendid&&(this._timeoutMap[b.sendid]=c)}function e(){this._interpreter.emit(a.name,a.data)}a.type=a.type||x.scxml.location;var f;f="https://github.com/jbeard4/SCION#publish"===a.type?e:this._interpreter.opts.customSend?this._interpreter.opts.customSend:d,b=b||{},this._interpreter._log("sending event",a.name,"with content",a.data,"after delay",b.delay),c.call(this,a,b,f)},cancel:function(a){if(this._interpreter.opts.customCancel)return this._interpreter.opts.customCancel.apply(this,[a]);if("undefined"==typeof clearTimeout)throw new Error("Default implementation of Statechart.prototype.cancel will not work unless setTimeout is defined globally.");a in this._timeoutMap&&(this._interpreter._log("cancelling ",a," with timeout id ",this._timeoutMap[a]),clearTimeout(this._timeoutMap[a]))}},a.exports={BaseInterpreter:o,Statechart:p,ArraySet:f,STATE_TYPES:w,initializeModel:d,InterpreterScriptingContext:s,ioProcessorTypes:x}});

@@ -581,3 +581,2 @@ // Copyright 2011-2012 Jacob Beard, INFICON, and other SCION contributors

//compare states based first on depth, then based on document order
console.log('getStateWithHigherSourceChildPriority', s1.id, s1.depth, s1.documentOrder, s2.id, s2.depth, s2.documentOrder);
if (s1.depth > s2.depth) {

@@ -584,0 +583,0 @@ return -1;

{
"name": "scion-core",
"version": "1.5.0",
"version": "1.5.1",
"description": "StateCharts Interpretation and Optimization eNgine (SCION) CORE is an implementation of Statecharts in JavaScript.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -582,4 +582,1 @@

[![Sauce Test Status](https://saucelabs.com/buildstatus/jbeard4?branch=master)](https://saucelabs.com/u/jbeard4)
[![Sauce Test Status](https://saucelabs.com/browser-matrix/jbeard4.svg?branch=master)](https://saucelabs.com/u/jbeard4)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc