state-machine-cat 10.1.10 → 10.1.11

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.
@@ -64,7 +64,7 @@
64
64
  `+p(typeof(t=(t=d(n,"action")||(e!=null?d(e,"action"):e))!=null?t:f)==g?t.call(i,{name:"action",hash:{},data:a,loc:{start:{line:13,column:12},end:{line:13,column:22}}}):t)+`
65
65
  </transition>
66
66
  `},12:function(t,e,n,m,a){var c=t.lookupProperty||function(i,f){if(Object.prototype.hasOwnProperty.call(i,f))return i[f]};return'event="'+t.escapeExpression(typeof(n=(n=c(n,"event")||(e!=null?c(e,"event"):e))!=null?n:t.hooks.helperMissing)=="function"?n.call(e??(t.nullContext||{}),{name:"event",hash:{},data:a,loc:{start:{line:12,column:40},end:{line:12,column:49}}}):n)+'" '},14:function(t,e,n,m,a){var c=t.lookupProperty||function(i,f){if(Object.prototype.hasOwnProperty.call(i,f))return i[f]};return'cond="'+t.escapeExpression(typeof(n=(n=c(n,"cond")||(e!=null?c(e,"cond"):e))!=null?n:t.hooks.helperMissing)=="function"?n.call(e??(t.nullContext||{}),{name:"cond",hash:{},data:a,loc:{start:{line:12,column:76},end:{line:12,column:84}}}):n)+'" '},16:function(t,e,n,m,a){var c=t.lookupProperty||function(i,f){if(Object.prototype.hasOwnProperty.call(i,f))return i[f]};return'type="'+t.escapeExpression(typeof(n=(n=c(n,"type")||(e!=null?c(e,"type"):e))!=null?n:t.hooks.helperMissing)=="function"?n.call(e??(t.nullContext||{}),{name:"type",hash:{},data:a,loc:{start:{line:12,column:111},end:{line:12,column:119}}}):n)+'" '},18:function(t,e,n,m,a){var c,i=e??(t.nullContext||{}),f=t.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" <transition "+((c=f(n,"if").call(i,e!=null?f(e,"event"):e,{name:"if",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:16,column:20},end:{line:16,column:58}}}))!=null?c:"")+((c=f(n,"if").call(i,e!=null?f(e,"cond"):e,{name:"if",hash:{},fn:t.program(14,a,0),inverse:t.noop,data:a,loc:{start:{line:16,column:58},end:{line:16,column:93}}}))!=null?c:"")+((c=f(n,"if").call(i,e!=null?f(e,"type"):e,{name:"if",hash:{},fn:t.program(16,a,0),inverse:t.noop,data:a,loc:{start:{line:16,column:93},end:{line:16,column:128}}}))!=null?c:"")+'target="'+t.escapeExpression(typeof(c=(c=f(n,"target")||(e!=null?f(e,"target"):e))!=null?c:t.hooks.helperMissing)=="function"?c.call(i,{name:"target",hash:{},data:a,loc:{start:{line:16,column:136},end:{line:16,column:146}}}):c)+`"/>
67
- `},compiler:[8,">= 4.3.0"],main:function(t,e,n,m,a){var c=t.lookupProperty||function(i,f){if(Object.prototype.hasOwnProperty.call(i,f))return i[f]};return(n=c(n,"each").call(e??(t.nullContext||{}),e!=null?c(e,"states"):e,{name:"each",hash:{},fn:t.program(1,a,0),inverse:t.noop,data:a,loc:{start:{line:1,column:0},end:{line:20,column:9}}}))!=null?n:""},usePartial:!0,useData:!0})});var nr=q((cc,tr)=>{"use strict";var Ge=require("handlebars/dist/handlebars.runtime.js");Kn();er();Ge.registerPartial("scxml.states.template.hbs",Ge.templates["scxml.states.template.hbs"]);tr.exports=function(e){return Ge.templates["scxml.template.hbs"](e)}});var Yi={};Ql(Yi,{default:()=>Qi,getAllowedValues:()=>ur,render:()=>sr,version:()=>cr});module.exports=Yl(Yi);var an=Object.freeze({inputType:{default:"smcat",values:[{name:"smcat"},{name:"json"},{name:"scxml"}]},outputType:{default:"svg",values:[{name:"ast"},{name:"dot"},{name:"eps"},{name:"json"},{name:"oldeps"},{name:"oldps"},{name:"oldps2"},{name:"oldsvg"},{name:"pdf"},{name:"png"},{name:"ps"},{name:"ps2"},{name:"scjson"},{name:"scxml"},{name:"smcat"},{name:"svg"}]},engine:{default:"dot",values:[{name:"dot"},{name:"circo"},{name:"fdp"},{name:"neato"},{name:"osage"},{name:"twopi"}]},direction:{default:"top-down",values:[{name:"top-down"},{name:"bottom-top"},{name:"left-right"},{name:"right-left"}]},desugar:{default:!1,values:[{name:!0},{name:!1}]}});function Zl(t,e){return(t==null?void 0:t[e])??an[e].default}function Kl(){return an}var N={getAllowedValues:Kl,getOptionValue:Zl};var Cn=F(require("ajv"),1);function ln(t,e=!1){let n=[];return t.filter(m=>Boolean(m.statemachine)).forEach(m=>{Object.prototype.hasOwnProperty.call(m.statemachine,"states")&&(n=n.concat(ln(m.statemachine.states,!0)))}),n.concat(t.map(m=>({name:m.name,type:m.type,statemachine:Boolean(m.statemachine),hasParent:e})))}function on(t){let e=[];return Object.prototype.hasOwnProperty.call(t,"transitions")&&(e=t.transitions),Object.prototype.hasOwnProperty.call(t,"states")&&t.states.filter(n=>Boolean(n.statemachine)).forEach(n=>{e=e.concat(on(n.statemachine))}),e}var L=class{_flattenedTransitions;_flattenedStates;constructor(e){this._flattenedStates=ln(e.states||[]),this._flattenedTransitions=on(e)}get flattenedTransitions(){return this._flattenedTransitions}findStateByName(e){return this._flattenedStates.find(n=>n.name===e)}findStatesByTypes(e){return this._flattenedStates.filter(n=>e.includes(n.type))}findExternalSelfTransitions(e){return this._flattenedTransitions.filter(n=>n.from===e&&n.to===e&&n.type!=="internal")}findTransitionsByFrom(e){return this._flattenedTransitions.filter(n=>n.from===e)}findTransitionsByTo(e){return this._flattenedTransitions.filter(n=>n.to===e)}};var eo="^(entry|activity|exit)\\s*/\\s*([^\\n$]*)(\\n|$)",to=new RegExp(eo);function sn(t,e){return t.includes(e)}var no=[{re:/initial/,stateType:"initial"},{re:/final/,stateType:"final"},{re:/parallel/,stateType:"parallel"},{re:/(deep.*history)|(history.*deep)/,stateType:"deephistory"},{re:/history/,stateType:"history"},{re:/^\^.*/,stateType:"choice"},{re:/^].*/,stateType:"forkjoin"}];function ro(t){return e=>e.re.test(t)}function cn(t){return(no.find(ro(t))||{stateType:"regular"}).stateType}function _e(t){return{name:t,type:cn(t)}}function un(t){return Boolean(t.statemachine)}function fn(t){let e=(t==null?void 0:t.states)??[];return e.filter(un).reduce((n,m)=>n.concat(fn(m.statemachine)),e.map(({name:n})=>n))}function pn(t,e){e=e||fn(t),t.states=(t==null?void 0:t.states)??[];let n=(t==null?void 0:t.transitions)??[];return t.states.filter(un).forEach(m=>{m.statemachine.states=pn(m.statemachine,e)}),n.forEach(m=>{sn(e,m.from)||(e.push(m.from),t.states.push(_e(m.from))),sn(e,m.to)||(e.push(m.to),t.states.push(_e(m.to)))}),t.states}function ao(t,e){let n="junction";return t<=1&&e>1&&(n="fork"),t>1&&e<=1&&(n="join"),n}function mn(t,e=new L(t)){return t.states=t.states.map(n=>{if(n.type==="forkjoin"&&!n.typeExplicitlySet){let m=e.findTransitionsByTo(n.name).length,a=e.findTransitionsByFrom(n.name).length;n.type=ao(m,a)}return n.statemachine&&(n.statemachine=mn(n.statemachine,e)),n}),t}function lo(t,e){return t.name===e.name}function oo(t,e){return t.reduce((n,m)=>{let a=n.findIndex(c=>e(c,m));return a>-1?(n[a]=m,n):n.concat(m)},[])}function io(t){let e=/([^[/]+)?(\[[^\]]+\])?[^/]*(\/.+)?/,n={},m=t.match(e),a=1,c=2,i=3;return m[a]&&(n.event=m[a].trim()),m[c]&&(n.cond=m[c].slice(1,-1).trim()),m[i]&&(n.action=m[i].slice(1,m[i].length).trim()),n}function dn(t,e,n,m=Boolean){m(n)&&(t[e]=n)}function so(t,e,n){dn(t,e,n,m=>m&&m.length>0)}function co(t){let e=t.match(to),n=1,m=2;return e?{type:e[n],body:e[m]}:{type:"activity",body:t}}function uo(t){return t.split(/\n\s*/g).map(e=>e.trim()).map(co)}var P={initState:_e,extractUndeclaredStates:pn,classifyForkJoins:mn,getStateType:cn,stateEqual:lo,uniq:oo,parseTransitionExpression:io,extractActions:uo,setIf:dn,setIfNotEmpty:so};function fo(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function Q(t,e,n,m){var a=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Q.prototype),a.expected=e,a.found=n,a.location=m,a.name="SyntaxError",a}fo(Q,Error);function Fe(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}Q.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n=null,m;for(m=0;m<t.length;m++)if(t[m].source===this.location.source){n=t[m].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,c=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(a):a,i=this.location.source+":"+c.line+":"+c.column;if(n){var f=this.location.end,g=Fe("",c.line.toString().length," "),p=n[a.line-1],d=a.line===f.line?f.column:p.length+1,l=d-a.column||1;e+=`
67
+ `},compiler:[8,">= 4.3.0"],main:function(t,e,n,m,a){var c=t.lookupProperty||function(i,f){if(Object.prototype.hasOwnProperty.call(i,f))return i[f]};return(n=c(n,"each").call(e??(t.nullContext||{}),e!=null?c(e,"states"):e,{name:"each",hash:{},fn:t.program(1,a,0),inverse:t.noop,data:a,loc:{start:{line:1,column:0},end:{line:20,column:9}}}))!=null?n:""},usePartial:!0,useData:!0})});var nr=q((cc,tr)=>{"use strict";var Ge=require("handlebars/dist/handlebars.runtime.js");Kn();er();Ge.registerPartial("scxml.states.template.hbs",Ge.templates["scxml.states.template.hbs"]);tr.exports=function(e){return Ge.templates["scxml.template.hbs"](e)}});var Yi={};Ql(Yi,{default:()=>Qi,getAllowedValues:()=>ur,render:()=>sr,version:()=>cr});module.exports=Yl(Yi);var an=Object.freeze({inputType:{default:"smcat",values:[{name:"smcat"},{name:"json"},{name:"scxml"}]},outputType:{default:"svg",values:[{name:"ast"},{name:"dot"},{name:"eps"},{name:"json"},{name:"oldeps"},{name:"oldps"},{name:"oldps2"},{name:"oldsvg"},{name:"pdf"},{name:"png"},{name:"ps"},{name:"ps2"},{name:"scjson"},{name:"scxml"},{name:"smcat"},{name:"svg"}]},engine:{default:"dot",values:[{name:"dot"},{name:"circo"},{name:"fdp"},{name:"neato"},{name:"osage"},{name:"twopi"}]},direction:{default:"top-down",values:[{name:"top-down"},{name:"bottom-top"},{name:"left-right"},{name:"right-left"}]},desugar:{default:!1,values:[{name:!0},{name:!1}]}});function Zl(t,e){return(t==null?void 0:t[e])??an[e].default}function Kl(){return an}var N={getAllowedValues:Kl,getOptionValue:Zl};var Cn=F(require("ajv"),1);function ln(t,e=!1){let n=[];return t.filter(m=>!!m.statemachine).forEach(m=>{Object.prototype.hasOwnProperty.call(m.statemachine,"states")&&(n=n.concat(ln(m.statemachine.states,!0)))}),n.concat(t.map(m=>({name:m.name,type:m.type,statemachine:!!m.statemachine,hasParent:e})))}function on(t){let e=[];return Object.prototype.hasOwnProperty.call(t,"transitions")&&(e=t.transitions),Object.prototype.hasOwnProperty.call(t,"states")&&t.states.filter(n=>!!n.statemachine).forEach(n=>{e=e.concat(on(n.statemachine))}),e}var L=class{_flattenedTransitions;_flattenedStates;constructor(e){this._flattenedStates=ln(e.states||[]),this._flattenedTransitions=on(e)}get flattenedTransitions(){return this._flattenedTransitions}findStateByName(e){return this._flattenedStates.find(n=>n.name===e)}findStatesByTypes(e){return this._flattenedStates.filter(n=>e.includes(n.type))}findExternalSelfTransitions(e){return this._flattenedTransitions.filter(n=>n.from===e&&n.to===e&&n.type!=="internal")}findTransitionsByFrom(e){return this._flattenedTransitions.filter(n=>n.from===e)}findTransitionsByTo(e){return this._flattenedTransitions.filter(n=>n.to===e)}};var eo="^(entry|activity|exit)\\s*/\\s*([^\\n$]*)(\\n|$)",to=new RegExp(eo);function sn(t,e){return t.includes(e)}var no=[{re:/initial/,stateType:"initial"},{re:/final/,stateType:"final"},{re:/parallel/,stateType:"parallel"},{re:/(deep.*history)|(history.*deep)/,stateType:"deephistory"},{re:/history/,stateType:"history"},{re:/^\^.*/,stateType:"choice"},{re:/^].*/,stateType:"forkjoin"}];function ro(t){return e=>e.re.test(t)}function cn(t){return(no.find(ro(t))||{stateType:"regular"}).stateType}function _e(t){return{name:t,type:cn(t)}}function un(t){return!!t.statemachine}function fn(t){let e=(t==null?void 0:t.states)??[];return e.filter(un).reduce((n,m)=>n.concat(fn(m.statemachine)),e.map(({name:n})=>n))}function pn(t,e){e=e||fn(t),t.states=(t==null?void 0:t.states)??[];let n=(t==null?void 0:t.transitions)??[];return t.states.filter(un).forEach(m=>{m.statemachine.states=pn(m.statemachine,e)}),n.forEach(m=>{sn(e,m.from)||(e.push(m.from),t.states.push(_e(m.from))),sn(e,m.to)||(e.push(m.to),t.states.push(_e(m.to)))}),t.states}function ao(t,e){let n="junction";return t<=1&&e>1&&(n="fork"),t>1&&e<=1&&(n="join"),n}function mn(t,e=new L(t)){return t.states=t.states.map(n=>{if(n.type==="forkjoin"&&!n.typeExplicitlySet){let m=e.findTransitionsByTo(n.name).length,a=e.findTransitionsByFrom(n.name).length;n.type=ao(m,a)}return n.statemachine&&(n.statemachine=mn(n.statemachine,e)),n}),t}function lo(t,e){return t.name===e.name}function oo(t,e){return t.reduce((n,m)=>{let a=n.findIndex(c=>e(c,m));return a>-1?(n[a]=m,n):n.concat(m)},[])}function io(t){let e=/([^[/]+)?(\[[^\]]+\])?[^/]*(\/.+)?/,n={},m=t.match(e),a=1,c=2,i=3;return m[a]&&(n.event=m[a].trim()),m[c]&&(n.cond=m[c].slice(1,-1).trim()),m[i]&&(n.action=m[i].slice(1,m[i].length).trim()),n}function dn(t,e,n,m=Boolean){m(n)&&(t[e]=n)}function so(t,e,n){dn(t,e,n,m=>m&&m.length>0)}function co(t){let e=t.match(to),n=1,m=2;return e?{type:e[n],body:e[m]}:{type:"activity",body:t}}function uo(t){return t.split(/\n\s*/g).map(e=>e.trim()).map(co)}var P={initState:_e,extractUndeclaredStates:pn,classifyForkJoins:mn,getStateType:cn,stateEqual:lo,uniq:oo,parseTransitionExpression:io,extractActions:uo,setIf:dn,setIfNotEmpty:so};function fo(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function Q(t,e,n,m){var a=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Q.prototype),a.expected=e,a.found=n,a.location=m,a.name="SyntaxError",a}fo(Q,Error);function Fe(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}Q.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n=null,m;for(m=0;m<t.length;m++)if(t[m].source===this.location.source){n=t[m].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,c=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(a):a,i=this.location.source+":"+c.line+":"+c.column;if(n){var f=this.location.end,g=Fe("",c.line.toString().length," "),p=n[a.line-1],d=a.line===f.line?f.column:p.length+1,l=d-a.column||1;e+=`
68
68
  --> `+i+`
69
69
  `+g+` |
70
70
  `+c.line+" | "+p+`
@@ -72,8 +72,8 @@
72
72
  at `+i}return e};Q.buildMessage=function(t,e){var n={literal:function(p){return'"'+a(p.text)+'"'},class:function(p){var d=p.parts.map(function(l){return Array.isArray(l)?c(l[0])+"-"+c(l[1]):c(l)});return"["+(p.inverted?"^":"")+d.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description}};function m(p){return p.charCodeAt(0).toString(16).toUpperCase()}function a(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+m(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+m(d)})}function c(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+m(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+m(d)})}function i(p){return n[p.type](p)}function f(p){var d=p.map(i),l,b;if(d.sort(),d.length>0){for(l=1,b=1;l<d.length;l++)d[l-1]!==d[l]&&(d[b]=d[l],b++);d.length=b}switch(d.length){case 1:return d[0];case 2:return d[0]+" or "+d[1];default:return d.slice(0,-1).join(", ")+", or "+d[d.length-1]}}function g(p){return p?'"'+a(p)+'"':"end of input"}return"Expected "+f(t)+" but "+g(e)+" found."};function hn(t,e){e=e!==void 0?e:{};var n={},m=e.grammarSource,a={program:Ut},c=Ut,i=",",f=";",g="[",p="]",d=":",l="{",b="}",u="=",I="label",x="color",_="class",B="active",Qe="type",Ye="regular",Ze="initial",Ke="terminate",et="final",tt="parallel",nt="history",rt="deephistory",at="choice",lt="forkjoin",ot="fork",it="join",st="junction",fr="width",ct="external",ut="internal",ft="->",pt="=>>",mt="=>",dt=">>",ht=":>",gt="--",yt="==",vt="<-",bt="<<=",xt="<=",$t="<<",It="<:",pr="#",mr=".",z='"',fe='\\"',Et="/*",pe="*/",kt="//",St=/^[0-9]/,Tt=/^[a-zA-Z0-9_\- ]/,At=/^[^;, "\t\n\r=\-><:{[]/,dr=/^[ \t]/,hr=/^[\r\n]/,gr=/^[^\r\n]/,yr=C("statemachine"),me=A(",",!1),Z=A(";",!1),vr=C("state"),wt=A("[",!1),Ot=A("]",!1),Ct=A(":",!1),re=A("{",!1),br=A("}",!1),xr=C("extended state attributes"),$r=C("extended state attribute"),X=A("=",!1),Ir=C("state attribute name"),Er=A("label",!0),jt=A("color",!0),kr=C("class attribute"),Sr=A("class",!0),Tr=C("state flag"),Ar=A("active",!0),wr=C("state type"),Pt=A("type",!0),Or=C("state type type"),Cr=A("regular",!1),jr=A("initial",!1),Pr=A("terminate",!1),_r=A("final",!1),Fr=A("parallel",!1),Rr=A("history",!1),Nr=A("deephistory",!1),Vr=A("choice",!1),Lr=A("forkjoin",!1),Br=A("fork",!1),Dr=A("join",!1),Hr=A("junction",!1),qr=C("transition"),Mr=C("extended transition attributes"),zr=C("extended transition attribute"),Ur=C("transition attribute name"),Jr=C("transition type name"),Xr=C("numeric transition attribute name"),Gr=A("width",!0),Wr=C("transition type value"),Qr=A("external",!1),Yr=A("internal",!1),Zr=C("left to right arrow"),Kr=A("->",!1),ea=A("=>>",!1),ta=A("=>",!1),na=A(">>",!1),ra=A(":>",!1),aa=A("--",!1),la=A("==",!1),oa=C("right to left arrow"),ia=A("<-",!1),sa=A("<<=",!1),ca=A("<=",!1),ua=A("<<",!1),fa=A("<:",!1),pa=A("#",!1),ma=A(".",!1),_t=K([["0","9"]],!1,!1),da=C("double quoted string"),U=A('"',!1),Ft=A('\\"',!1),G=pl(),ha=C("valid class string"),Rt=K([["a","z"],["A","Z"],["0","9"],"_","-"," "],!1,!1),ga=C("identifier"),Nt=K([";",","," ",'"'," ",`
73
73
  `,"\r","=","-",">","<",":","{","["],!0,!1),ya=C("whitespace"),va=K([" "," "],!1,!1),ba=C("line end"),xa=K(["\r",`
74
74
  `],!1,!1),$a=A("/*",!1),Vt=A("*/",!1),Ia=A("//",!1),Ea=K(["\r",`
75
- `],!0,!1),ka=C("comment"),Sa=function(r){return r.states=P.extractUndeclaredStates(r),P.classifyForkJoins(r)},Ta=function(r,s){let v={};return P.setIf(v,"states",r),P.setIfNotEmpty(v,"transitions",s),v},Lt=function(r){return r},Aa=function(r){return r},wa=function(r){return P.uniq(r[0].concat(r[1]),P.stateEqual)},Oa=function(r,s,v){return v},Ca=function(r,s,v,h){return h},ja=function(r,s,v,h,E){return E},Pa=function(r,s,v,h,E){let S=P.initState(s);return(v||[]).forEach(w=>P.setIf(S,w.name,w.value)),P.setIf(S,"typeExplicitlySet",(v||[]).some(w=>w.typeExplicitlySet)),P.setIf(S,"statemachine",E),P.setIfNotEmpty(S,"note",r),Boolean(h)&&P.setIfNotEmpty(S,"actions",P.extractActions(h)),S},_a=function(r,s){return{name:r,value:s}},Fa=function(r,s){return{name:r,value:s}},Ra=function(r){return{name:r,value:!0}},Na=function(r,s){return{name:r,value:s,typeExplicitlySet:!0}},Va=function(r){return r.toLowerCase()},La=function(r){return r.toLowerCase()},Ba=function(r){return r.toLowerCase()},Da=function(r){return r.toLowerCase()},Ha=function(r,s,v){return v},qa=function(r,s,v,h){return h},Ma=function(r,s,v,h){return h&&(s.label=h,s=Object.assign(s,P.parseTransitionExpression(h))),(v||[]).forEach(E=>P.setIf(s,E.name,E.value)),P.setIfNotEmpty(s,"note",r),s},za=function(r,s){return{from:r,to:s}},Ua=function(r,s){return{from:s,to:r}},Ja=function(r,s){return{name:r,value:s}},Xa=function(r,s){return{name:r,value:s}},Ga=function(r,s){return{name:r,value:s}},Wa=function(r,s){return{name:r,value:s}},Qa=function(r){return r.toLowerCase()},Ya=function(r){return r.toLowerCase()},Za=function(r){return r},Ka=function(r){return r.join("").trim()},el=function(r){return parseFloat(r.join(""))},tl=function(r){return parseInt(r.join(""),10)},nl=function(r){return r.join("").replace(/\\\"/g,'"')},Bt=function(r){return r},rl=function(r){return r.join("")},Dt=function(r){return r},al=function(r){return r.join("").trim()},ll=function(r){return r.join("").trim()},Ht=function(r){return r},qt=function(r){return r},ol=function(r){return r.join("")},il=function(r){return r},sl=function(r){return r},cl=function(r){return r},ul=function(r,s,v){return r+s.join("")+v},fl=function(r,s){return r+s.join("")},o=0,k=0,de=[{line:1,column:1}],D=0,we=[],y=0,he;if("startRule"in e){if(!(e.startRule in a))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');c=a[e.startRule]}function Zi(){return t.substring(k,o)}function Ki(){return k}function es(){return{source:m,start:k,end:o}}function ts(){return ae(k,o)}function ns(r,s){throw s=s!==void 0?s:ae(k,o),zt([C(r)],t.substring(k,o),s)}function rs(r,s){throw s=s!==void 0?s:ae(k,o),dl(r,s)}function A(r,s){return{type:"literal",text:r,ignoreCase:s}}function K(r,s,v){return{type:"class",parts:r,inverted:s,ignoreCase:v}}function pl(){return{type:"any"}}function ml(){return{type:"end"}}function C(r){return{type:"other",description:r}}function Mt(r){var s=de[r],v;if(s)return s;for(v=r-1;!de[v];)v--;for(s=de[v],s={line:s.line,column:s.column};v<r;)t.charCodeAt(v)===10?(s.line++,s.column=1):s.column++,v++;return de[r]=s,s}function ae(r,s,v){var h=Mt(r),E=Mt(s),S={source:m,start:{offset:r,line:h.line,column:h.column},end:{offset:s,line:E.line,column:E.column}};return v&&m&&typeof m.offset=="function"&&(S.start=m.offset(S.start),S.end=m.offset(S.end)),S}function $(r){o<D||(o>D&&(D=o,we=[]),we.push(r))}function dl(r,s){return new Q(r,null,null,s)}function zt(r,s,v){return new Q(Q.buildMessage(r,s),r,s,v)}function Ut(){var r,s,v,h;return r=o,s=T(),v=Jt(),h=T(),k=r,r=Sa(v),r}function Jt(){var r,s,v,h;for(y++,r=o,s=hl(),s===n&&(s=null),v=[],h=Wt();h!==n;)v.push(h),h=Wt();return k=r,r=Ta(s,v),y--,s=n,y===0&&$(yr),r}function hl(){var r,s,v,h,E,S;for(r=o,s=o,v=[],h=o,E=Oe(),E!==n?(t.charCodeAt(o)===44?(S=i,o++):(S=n,y===0&&$(me)),S!==n?(k=h,h=Lt(E)):(o=h,h=n)):(o=h,h=n);h!==n;)v.push(h),h=o,E=Oe(),E!==n?(t.charCodeAt(o)===44?(S=i,o++):(S=n,y===0&&$(me)),S!==n?(k=h,h=Lt(E)):(o=h,h=n)):(o=h,h=n);return h=o,E=Oe(),E!==n?(t.charCodeAt(o)===59?(S=f,o++):(S=n,y===0&&$(Z)),S!==n?(k=h,h=Aa(E)):(o=h,h=n)):(o=h,h=n),h!==n?(v=[v,h],s=v):(o=s,s=n),s!==n&&(k=r,s=wa(s)),r=s,r}function Oe(){var r,s,v,h,E,S,w,O,H,R,W,nn,je,zl,Pe;for(y++,r=o,s=[],v=ge();v!==n;)s.push(v),v=ge();return v=T(),h=oe(),h!==n?(E=T(),S=o,t.charCodeAt(o)===91?(w=g,o++):(w=n,y===0&&$(wt)),w!==n?(O=gl(),t.charCodeAt(o)===93?(H=p,o++):(H=n,y===0&&$(Ot)),H!==n?(k=S,S=Oa(s,h,O)):(o=S,S=n)):(o=S,S=n),S===n&&(S=null),w=T(),O=o,t.charCodeAt(o)===58?(H=d,o++):(H=n,y===0&&$(Ct)),H!==n?(R=T(),W=Pl(),W!==n?(nn=T(),k=O,O=Ca(s,h,S,W)):(o=O,O=n)):(o=O,O=n),O===n&&(O=null),H=T(),R=o,t.charCodeAt(o)===123?(W=l,o++):(W=n,y===0&&$(re)),W!==n?(nn=T(),je=Jt(),je!==n?(zl=T(),t.charCodeAt(o)===125?(Pe=b,o++):(Pe=n,y===0&&$(br)),Pe!==n?(k=R,R=ja(s,h,S,O,je)):(o=R,R=n)):(o=R,R=n)):(o=R,R=n),R===n&&(R=null),W=T(),k=r,r=Pa(s,h,S,O,R)):(o=r,r=n),y--,r===n&&(s=n,y===0&&$(vr)),r}function gl(){var r,s;for(y++,r=[],s=Xt();s!==n;)r.push(s),s=Xt();return y--,s=n,y===0&&$(xr),r}function Xt(){var r,s,v,h,E,S,w,O;return y++,r=o,s=T(),v=yl(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=le(),w!==n?(O=T(),k=r,r=_a(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=Gt(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=Yt(),w!==n?(O=T(),k=r,r=Fa(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=vl(),v!==n?(h=T(),k=r,r=Ra(v)):(o=r,r=n),r===n&&(r=o,s=T(),v=bl(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=xl(),w!==n?(O=T(),k=r,r=Na(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n)))),y--,r===n&&(s=n,y===0&&$($r)),r}function yl(){var r,s;return y++,r=o,t.substr(o,5).toLowerCase()===I?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(Er)),s===n&&(t.substr(o,5).toLowerCase()===x?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(jt))),s!==n&&(k=r,s=Va(s)),r=s,y--,r===n&&(s=n,y===0&&$(Ir)),r}function Gt(){var r,s;return y++,r=o,t.substr(o,5).toLowerCase()===_?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(Sr)),s!==n&&(k=r,s=La(s)),r=s,y--,r===n&&(s=n,y===0&&$(kr)),r}function vl(){var r,s;return y++,r=o,t.substr(o,6).toLowerCase()===B?(s=t.substr(o,6),o+=6):(s=n,y===0&&$(Ar)),s!==n&&(k=r,s=Ba(s)),r=s,y--,r===n&&(s=n,y===0&&$(Tr)),r}function bl(){var r,s;return y++,r=o,t.substr(o,4).toLowerCase()===Qe?(s=t.substr(o,4),o+=4):(s=n,y===0&&$(Pt)),s!==n&&(k=r,s=Da(s)),r=s,y--,r===n&&(s=n,y===0&&$(wr)),r}function xl(){var r,s;return y++,t.substr(o,7)===Ye?(r=Ye,o+=7):(r=n,y===0&&$(Cr)),r===n&&(t.substr(o,7)===Ze?(r=Ze,o+=7):(r=n,y===0&&$(jr)),r===n&&(t.substr(o,9)===Ke?(r=Ke,o+=9):(r=n,y===0&&$(Pr)),r===n&&(t.substr(o,5)===et?(r=et,o+=5):(r=n,y===0&&$(_r)),r===n&&(t.substr(o,8)===tt?(r=tt,o+=8):(r=n,y===0&&$(Fr)),r===n&&(t.substr(o,7)===nt?(r=nt,o+=7):(r=n,y===0&&$(Rr)),r===n&&(t.substr(o,11)===rt?(r=rt,o+=11):(r=n,y===0&&$(Nr)),r===n&&(t.substr(o,6)===at?(r=at,o+=6):(r=n,y===0&&$(Vr)),r===n&&(t.substr(o,8)===lt?(r=lt,o+=8):(r=n,y===0&&$(Lr)),r===n&&(t.substr(o,4)===ot?(r=ot,o+=4):(r=n,y===0&&$(Br)),r===n&&(t.substr(o,4)===it?(r=it,o+=4):(r=n,y===0&&$(Dr)),r===n&&(t.substr(o,8)===st?(r=st,o+=8):(r=n,y===0&&$(Hr))))))))))))),y--,r===n&&(s=n,y===0&&$(Or)),r}function Wt(){var r,s,v,h,E,S,w,O,H;for(y++,r=o,s=[],v=ge();v!==n;)s.push(v),v=ge();return v=$l(),v!==n?(h=o,t.charCodeAt(o)===91?(E=g,o++):(E=n,y===0&&$(wt)),E!==n?(S=Il(),t.charCodeAt(o)===93?(w=p,o++):(w=n,y===0&&$(Ot)),w!==n?(O=T(),k=h,h=Ha(s,v,S)):(o=h,h=n)):(o=h,h=n),h===n&&(h=null),E=o,t.charCodeAt(o)===58?(S=d,o++):(S=n,y===0&&$(Ct)),S!==n?(w=T(),O=jl(),O!==n?(H=T(),k=E,E=qa(s,v,h,O)):(o=E,E=n)):(o=E,E=n),E===n&&(E=null),t.charCodeAt(o)===59?(S=f,o++):(S=n,y===0&&$(Z)),S!==n?(k=r,r=Ma(s,v,h,E)):(o=r,r=n)):(o=r,r=n),y--,r===n&&(s=n,y===0&&$(qr)),r}function $l(){var r,s,v,h,E,S,w,O;return r=o,s=T(),v=oe(),v!==n?(h=T(),E=Al(),E!==n?(S=T(),w=oe(),w!==n?(O=T(),k=r,r=za(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=oe(),v!==n?(h=T(),E=wl(),E!==n?(S=T(),w=oe(),w!==n?(O=T(),k=r,r=Ua(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n)),r}function Il(){var r,s;for(y++,r=[],s=Qt();s!==n;)r.push(s),s=Qt();return y--,s=n,y===0&&$(Mr),r}function Qt(){var r,s,v,h,E,S,w,O;return y++,r=o,s=T(),v=El(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=le(),w!==n?(O=T(),k=r,r=Ja(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=Gt(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=Yt(),w!==n?(O=T(),k=r,r=Xa(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=kl(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=Tl(),w!==n?(O=T(),k=r,r=Ga(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=Sl(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=Ol(),w!==n?(O=T(),k=r,r=Wa(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n)))),y--,r===n&&(s=n,y===0&&$(zr)),r}function El(){var r,s;return y++,r=o,t.substr(o,5).toLowerCase()===x?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(jt)),s!==n&&(k=r,s=Qa(s)),r=s,y--,r===n&&(s=n,y===0&&$(Ur)),r}function kl(){var r,s;return y++,r=o,t.substr(o,4).toLowerCase()===Qe?(s=t.substr(o,4),o+=4):(s=n,y===0&&$(Pt)),s!==n&&(k=r,s=Ya(s)),r=s,y--,r===n&&(s=n,y===0&&$(Jr)),r}function Sl(){var r,s;return y++,r=o,t.substr(o,5).toLowerCase()===fr?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(Gr)),s!==n&&(k=r,s=Za(s)),r=s,y--,r===n&&(s=n,y===0&&$(Xr)),r}function Tl(){var r,s;return y++,t.substr(o,8)===ct?(r=ct,o+=8):(r=n,y===0&&$(Qr)),r===n&&(t.substr(o,8)===ut?(r=ut,o+=8):(r=n,y===0&&$(Yr))),y--,r===n&&(s=n,y===0&&$(Wr)),r}function Al(){var r,s;return y++,t.substr(o,2)===ft?(r=ft,o+=2):(r=n,y===0&&$(Kr)),r===n&&(t.substr(o,3)===pt?(r=pt,o+=3):(r=n,y===0&&$(ea)),r===n&&(t.substr(o,2)===mt?(r=mt,o+=2):(r=n,y===0&&$(ta)),r===n&&(t.substr(o,2)===dt?(r=dt,o+=2):(r=n,y===0&&$(na)),r===n&&(t.substr(o,2)===ht?(r=ht,o+=2):(r=n,y===0&&$(ra)),r===n&&(t.substr(o,2)===gt?(r=gt,o+=2):(r=n,y===0&&$(aa)),r===n&&(t.substr(o,2)===yt?(r=yt,o+=2):(r=n,y===0&&$(la)))))))),y--,r===n&&(s=n,y===0&&$(Zr)),r}function wl(){var r,s;return y++,t.substr(o,2)===vt?(r=vt,o+=2):(r=n,y===0&&$(ia)),r===n&&(t.substr(o,3)===bt?(r=bt,o+=3):(r=n,y===0&&$(sa)),r===n&&(t.substr(o,2)===xt?(r=xt,o+=2):(r=n,y===0&&$(ca)),r===n&&(t.substr(o,2)===$t?(r=$t,o+=2):(r=n,y===0&&$(ua)),r===n&&(t.substr(o,2)===It?(r=It,o+=2):(r=n,y===0&&$(fa)))))),y--,r===n&&(s=n,y===0&&$(oa)),r}function ge(){var r,s,v,h,E;if(r=o,s=T(),t.charCodeAt(o)===35?(v=pr,o++):(v=n,y===0&&$(pa)),v!==n){for(h=[],E=ye();E!==n;)h.push(E),E=ye();k=r,r=Ka(h)}else o=r,r=n;return r}function Ol(){var r;return r=Cl(),r===n&&(r=Ce()),r}function Cl(){var r,s,v,h,E;return r=o,s=o,v=Ce(),v!==n?(t.charCodeAt(o)===46?(h=mr,o++):(h=n,y===0&&$(ma)),h!==n?(E=Ce(),E!==n?(v=[v,h,E],s=v):(o=s,s=n)):(o=s,s=n)):(o=s,s=n),s!==n&&(k=r,s=el(s)),r=s,r}function Ce(){var r,s,v;if(r=o,s=[],St.test(t.charAt(o))?(v=t.charAt(o),o++):(v=n,y===0&&$(_t)),v!==n)for(;v!==n;)s.push(v),St.test(t.charAt(o))?(v=t.charAt(o),o++):(v=n,y===0&&$(_t));else s=n;return s!==n&&(k=r,s=tl(s)),r=s,r}function jl(){var r;return r=le(),r===n&&(r=Rl()),r}function Pl(){var r;return r=le(),r===n&&(r=Nl()),r}function le(){var r,s,v,h;return y++,r=o,t.charCodeAt(o)===34?(s=z,o++):(s=n,y===0&&$(U)),s!==n?(v=_l(),t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),h!==n?(k=r,r=nl(v)):(o=r,r=n)):(o=r,r=n),y--,r===n&&(s=n,y===0&&$(da)),r}function _l(){var r,s,v,h;for(r=[],s=o,v=o,y++,t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.substr(o,2)===fe?(h=fe,o+=2):(h=n,y===0&&$(Ft)),h===n&&(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G))),h!==n?(k=s,s=Bt(h)):(o=s,s=n)):(o=s,s=n);s!==n;)r.push(s),s=o,v=o,y++,t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.substr(o,2)===fe?(h=fe,o+=2):(h=n,y===0&&$(Ft)),h===n&&(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G))),h!==n?(k=s,s=Bt(h)):(o=s,s=n)):(o=s,s=n);return r}function Yt(){var r,s,v,h;return y++,r=o,t.charCodeAt(o)===34?(s=z,o++):(s=n,y===0&&$(U)),s!==n?(v=Fl(),t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),h!==n?(k=r,r=rl(v)):(o=r,r=n)):(o=r,r=n),y--,r===n&&(s=n,y===0&&$(ha)),r}function Fl(){var r,s,v,h;for(r=[],s=o,v=o,y++,t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),y--,h===n?v=void 0:(o=v,v=n),v!==n?(Tt.test(t.charAt(o))?(h=t.charAt(o),o++):(h=n,y===0&&$(Rt)),h!==n?(k=s,s=Dt(h)):(o=s,s=n)):(o=s,s=n);s!==n;)r.push(s),s=o,v=o,y++,t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),y--,h===n?v=void 0:(o=v,v=n),v!==n?(Tt.test(t.charAt(o))?(h=t.charAt(o),o++):(h=n,y===0&&$(Rt)),h!==n?(k=s,s=Dt(h)):(o=s,s=n)):(o=s,s=n);return r}function Rl(){var r,s;return r=o,s=Ll(),k=r,s=al(s),r=s,r}function Nl(){var r,s;return r=o,s=Vl(),k=r,s=ll(s),r=s,r}function Vl(){var r,s,v,h;for(r=[],s=o,v=o,y++,t.charCodeAt(o)===44?(h=i,o++):(h=n,y===0&&$(me)),h===n&&(t.charCodeAt(o)===59?(h=f,o++):(h=n,y===0&&$(Z)),h===n&&(t.charCodeAt(o)===123?(h=l,o++):(h=n,y===0&&$(re)))),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G)),h!==n?(k=s,s=Ht(h)):(o=s,s=n)):(o=s,s=n);s!==n;)r.push(s),s=o,v=o,y++,t.charCodeAt(o)===44?(h=i,o++):(h=n,y===0&&$(me)),h===n&&(t.charCodeAt(o)===59?(h=f,o++):(h=n,y===0&&$(Z)),h===n&&(t.charCodeAt(o)===123?(h=l,o++):(h=n,y===0&&$(re)))),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G)),h!==n?(k=s,s=Ht(h)):(o=s,s=n)):(o=s,s=n);return r}function Ll(){var r,s,v,h;for(r=[],s=o,v=o,y++,t.charCodeAt(o)===59?(h=f,o++):(h=n,y===0&&$(Z)),h===n&&(t.charCodeAt(o)===123?(h=l,o++):(h=n,y===0&&$(re))),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G)),h!==n?(k=s,s=qt(h)):(o=s,s=n)):(o=s,s=n);s!==n;)r.push(s),s=o,v=o,y++,t.charCodeAt(o)===59?(h=f,o++):(h=n,y===0&&$(Z)),h===n&&(t.charCodeAt(o)===123?(h=l,o++):(h=n,y===0&&$(re))),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G)),h!==n?(k=s,s=qt(h)):(o=s,s=n)):(o=s,s=n);return r}function oe(){var r,s,v;if(y++,r=o,s=[],At.test(t.charAt(o))?(v=t.charAt(o),o++):(v=n,y===0&&$(Nt)),v!==n)for(;v!==n;)s.push(v),At.test(t.charAt(o))?(v=t.charAt(o),o++):(v=n,y===0&&$(Nt));else s=n;return s!==n&&(k=r,s=ol(s)),r=s,r===n&&(r=le()),y--,r===n&&(s=n,y===0&&$(ga)),r}function Zt(){var r,s;return y++,r=o,dr.test(t.charAt(o))?(s=t.charAt(o),o++):(s=n,y===0&&$(va)),s!==n&&(k=r,s=il(s)),r=s,y--,r===n&&(s=n,y===0&&$(ya)),r}function Kt(){var r,s;return y++,r=o,hr.test(t.charAt(o))?(s=t.charAt(o),o++):(s=n,y===0&&$(xa)),s!==n&&(k=r,s=sl(s)),r=s,y--,r===n&&(s=n,y===0&&$(ba)),r}function Bl(){var r;return t.substr(o,2)===Et?(r=Et,o+=2):(r=n,y===0&&$($a)),r}function Dl(){var r;return t.substr(o,2)===pe?(r=pe,o+=2):(r=n,y===0&&$(Vt)),r}function en(){var r,s,v;return r=o,s=o,y++,t.substr(o,2)===pe?(v=pe,o+=2):(v=n,y===0&&$(Vt)),y--,v===n?s=void 0:(o=s,s=n),s!==n?(t.length>o?(v=t.charAt(o),o++):(v=n,y===0&&$(G)),v!==n?(k=r,r=cl(v)):(o=r,r=n)):(o=r,r=n),r}function Hl(){var r,s,v,h;if(r=o,s=Bl(),s!==n){for(v=[],h=en();h!==n;)v.push(h),h=en();h=Dl(),h!==n?(k=r,r=ul(s,v,h)):(o=r,r=n)}else o=r,r=n;return r}function ql(){var r;return t.substr(o,2)===kt?(r=kt,o+=2):(r=n,y===0&&$(Ia)),r}function ye(){var r;return gr.test(t.charAt(o))?(r=t.charAt(o),o++):(r=n,y===0&&$(Ea)),r}function Ml(){var r,s,v,h;if(r=o,s=ql(),s!==n){for(v=[],h=ye();h!==n;)v.push(h),h=ye();k=r,r=fl(s,v)}else o=r,r=n;return r}function tn(){var r,s;return y++,r=Ml(),r===n&&(r=Hl()),y--,r===n&&(s=n,y===0&&$(ka)),r}function T(){var r,s;for(r=[],s=Zt(),s===n&&(s=Kt(),s===n&&(s=tn()));s!==n;)r.push(s),s=Zt(),s===n&&(s=Kt(),s===n&&(s=tn()));return r}if(he=c(),he!==n&&o===t.length)return he;throw he!==n&&o<t.length&&$(ml()),zt(we,D<t.length?t.charAt(D):null,D<t.length?ae(D,D+1):ae(D,D))}var kn=F(require("fast-xml-parser"),1),Y=F(require("he"),1),Ee=F(require("lodash/castArray.js"),1),Sn=F($n(),1);function bo(t,e,n){let m="";return t&&(m+=t),e&&(m+=` [${e}]`),n&&(m+=`/ ${n}`),m.trim()}var Ie={formatLabel:bo};var ie=F(require("lodash/castArray.js"),1);function xo(t,e){let n={id:e?`${e}.initial`:"initial"};return t.transition&&Object.assign(n,{transition:[t.transition]}),n}function $o(t){return{id:"initial",transition:[{target:t}]}}function Io(t){let e=[];return t.initial&&(typeof t.initial=="string"?e.push($o(t.initial)):e.push(xo(t.initial,t.id))),e}function In(t){return{...t,initial:Io(t),state:(0,ie.default)((t==null?void 0:t.state)??[]),parallel:(0,ie.default)((t==null?void 0:t.parallel)??[]),history:(0,ie.default)((t==null?void 0:t.history)??[]),final:(0,ie.default)((t==null?void 0:t.final)??[])}}var Eo=Ie.formatLabel;function En(t,e){return(0,Ee.default)(t[e]).map(n=>({type:e==="onexit"?"exit":"entry",body:Y.default.decode(n).trim()}))}function ko(t){return(0,Ee.default)(t).map(e=>({type:"activity",body:Y.default.decode(e.id||"").trim()||Y.default.decode(e||"").trim()}))}function So(t){let e=[];return t.onentry&&(e=e.concat(En(t,"onentry"))),t.invoke&&(e=e.concat(ko(t.invoke))),t.onexit&&(e=e.concat(En(t,"onexit"))),e}function To(t,e){return t==="history"&&e.type==="deep"?"deephistory":t}function se(t){return e=>{let n={name:e.id,type:To(t,e)};return P.getStateType(e.id)!==n.type&&(n.typeExplicitlySet=!0),(e.onentry||e.onexit||e.invoke)&&(n.actions=So(e)),Object.keys(e).some(m=>["initial","state","history","parallel","final"].includes(m))&&(n.statemachine=Tn(e)),n}}function Ao(t){let e={};return t.event&&(e.event=t.event.split(/\s+/).join(`
75
+ `],!0,!1),ka=C("comment"),Sa=function(r){return r.states=P.extractUndeclaredStates(r),P.classifyForkJoins(r)},Ta=function(r,s){let v={};return P.setIf(v,"states",r),P.setIfNotEmpty(v,"transitions",s),v},Lt=function(r){return r},Aa=function(r){return r},wa=function(r){return P.uniq(r[0].concat(r[1]),P.stateEqual)},Oa=function(r,s,v){return v},Ca=function(r,s,v,h){return h},ja=function(r,s,v,h,E){return E},Pa=function(r,s,v,h,E){let S=P.initState(s);return(v||[]).forEach(w=>P.setIf(S,w.name,w.value)),P.setIf(S,"typeExplicitlySet",(v||[]).some(w=>w.typeExplicitlySet)),P.setIf(S,"statemachine",E),P.setIfNotEmpty(S,"note",r),h&&P.setIfNotEmpty(S,"actions",P.extractActions(h)),S},_a=function(r,s){return{name:r,value:s}},Fa=function(r,s){return{name:r,value:s}},Ra=function(r){return{name:r,value:!0}},Na=function(r,s){return{name:r,value:s,typeExplicitlySet:!0}},Va=function(r){return r.toLowerCase()},La=function(r){return r.toLowerCase()},Ba=function(r){return r.toLowerCase()},Da=function(r){return r.toLowerCase()},Ha=function(r,s,v){return v},qa=function(r,s,v,h){return h},Ma=function(r,s,v,h){return h&&(s.label=h,s=Object.assign(s,P.parseTransitionExpression(h))),(v||[]).forEach(E=>P.setIf(s,E.name,E.value)),P.setIfNotEmpty(s,"note",r),s},za=function(r,s){return{from:r,to:s}},Ua=function(r,s){return{from:s,to:r}},Ja=function(r,s){return{name:r,value:s}},Xa=function(r,s){return{name:r,value:s}},Ga=function(r,s){return{name:r,value:s}},Wa=function(r,s){return{name:r,value:s}},Qa=function(r){return r.toLowerCase()},Ya=function(r){return r.toLowerCase()},Za=function(r){return r},Ka=function(r){return r.join("").trim()},el=function(r){return parseFloat(r.join(""))},tl=function(r){return parseInt(r.join(""),10)},nl=function(r){return r.join("").replace(/\\\"/g,'"')},Bt=function(r){return r},rl=function(r){return r.join("")},Dt=function(r){return r},al=function(r){return r.join("").trim()},ll=function(r){return r.join("").trim()},Ht=function(r){return r},qt=function(r){return r},ol=function(r){return r.join("")},il=function(r){return r},sl=function(r){return r},cl=function(r){return r},ul=function(r,s,v){return r+s.join("")+v},fl=function(r,s){return r+s.join("")},o=0,k=0,de=[{line:1,column:1}],D=0,we=[],y=0,he;if("startRule"in e){if(!(e.startRule in a))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');c=a[e.startRule]}function Zi(){return t.substring(k,o)}function Ki(){return k}function es(){return{source:m,start:k,end:o}}function ts(){return ae(k,o)}function ns(r,s){throw s=s!==void 0?s:ae(k,o),zt([C(r)],t.substring(k,o),s)}function rs(r,s){throw s=s!==void 0?s:ae(k,o),dl(r,s)}function A(r,s){return{type:"literal",text:r,ignoreCase:s}}function K(r,s,v){return{type:"class",parts:r,inverted:s,ignoreCase:v}}function pl(){return{type:"any"}}function ml(){return{type:"end"}}function C(r){return{type:"other",description:r}}function Mt(r){var s=de[r],v;if(s)return s;for(v=r-1;!de[v];)v--;for(s=de[v],s={line:s.line,column:s.column};v<r;)t.charCodeAt(v)===10?(s.line++,s.column=1):s.column++,v++;return de[r]=s,s}function ae(r,s,v){var h=Mt(r),E=Mt(s),S={source:m,start:{offset:r,line:h.line,column:h.column},end:{offset:s,line:E.line,column:E.column}};return v&&m&&typeof m.offset=="function"&&(S.start=m.offset(S.start),S.end=m.offset(S.end)),S}function $(r){o<D||(o>D&&(D=o,we=[]),we.push(r))}function dl(r,s){return new Q(r,null,null,s)}function zt(r,s,v){return new Q(Q.buildMessage(r,s),r,s,v)}function Ut(){var r,s,v,h;return r=o,s=T(),v=Jt(),h=T(),k=r,r=Sa(v),r}function Jt(){var r,s,v,h;for(y++,r=o,s=hl(),s===n&&(s=null),v=[],h=Wt();h!==n;)v.push(h),h=Wt();return k=r,r=Ta(s,v),y--,s=n,y===0&&$(yr),r}function hl(){var r,s,v,h,E,S;for(r=o,s=o,v=[],h=o,E=Oe(),E!==n?(t.charCodeAt(o)===44?(S=i,o++):(S=n,y===0&&$(me)),S!==n?(k=h,h=Lt(E)):(o=h,h=n)):(o=h,h=n);h!==n;)v.push(h),h=o,E=Oe(),E!==n?(t.charCodeAt(o)===44?(S=i,o++):(S=n,y===0&&$(me)),S!==n?(k=h,h=Lt(E)):(o=h,h=n)):(o=h,h=n);return h=o,E=Oe(),E!==n?(t.charCodeAt(o)===59?(S=f,o++):(S=n,y===0&&$(Z)),S!==n?(k=h,h=Aa(E)):(o=h,h=n)):(o=h,h=n),h!==n?(v=[v,h],s=v):(o=s,s=n),s!==n&&(k=r,s=wa(s)),r=s,r}function Oe(){var r,s,v,h,E,S,w,O,H,R,W,nn,je,zl,Pe;for(y++,r=o,s=[],v=ge();v!==n;)s.push(v),v=ge();return v=T(),h=oe(),h!==n?(E=T(),S=o,t.charCodeAt(o)===91?(w=g,o++):(w=n,y===0&&$(wt)),w!==n?(O=gl(),t.charCodeAt(o)===93?(H=p,o++):(H=n,y===0&&$(Ot)),H!==n?(k=S,S=Oa(s,h,O)):(o=S,S=n)):(o=S,S=n),S===n&&(S=null),w=T(),O=o,t.charCodeAt(o)===58?(H=d,o++):(H=n,y===0&&$(Ct)),H!==n?(R=T(),W=Pl(),W!==n?(nn=T(),k=O,O=Ca(s,h,S,W)):(o=O,O=n)):(o=O,O=n),O===n&&(O=null),H=T(),R=o,t.charCodeAt(o)===123?(W=l,o++):(W=n,y===0&&$(re)),W!==n?(nn=T(),je=Jt(),je!==n?(zl=T(),t.charCodeAt(o)===125?(Pe=b,o++):(Pe=n,y===0&&$(br)),Pe!==n?(k=R,R=ja(s,h,S,O,je)):(o=R,R=n)):(o=R,R=n)):(o=R,R=n),R===n&&(R=null),W=T(),k=r,r=Pa(s,h,S,O,R)):(o=r,r=n),y--,r===n&&(s=n,y===0&&$(vr)),r}function gl(){var r,s;for(y++,r=[],s=Xt();s!==n;)r.push(s),s=Xt();return y--,s=n,y===0&&$(xr),r}function Xt(){var r,s,v,h,E,S,w,O;return y++,r=o,s=T(),v=yl(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=le(),w!==n?(O=T(),k=r,r=_a(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=Gt(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=Yt(),w!==n?(O=T(),k=r,r=Fa(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=vl(),v!==n?(h=T(),k=r,r=Ra(v)):(o=r,r=n),r===n&&(r=o,s=T(),v=bl(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=xl(),w!==n?(O=T(),k=r,r=Na(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n)))),y--,r===n&&(s=n,y===0&&$($r)),r}function yl(){var r,s;return y++,r=o,t.substr(o,5).toLowerCase()===I?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(Er)),s===n&&(t.substr(o,5).toLowerCase()===x?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(jt))),s!==n&&(k=r,s=Va(s)),r=s,y--,r===n&&(s=n,y===0&&$(Ir)),r}function Gt(){var r,s;return y++,r=o,t.substr(o,5).toLowerCase()===_?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(Sr)),s!==n&&(k=r,s=La(s)),r=s,y--,r===n&&(s=n,y===0&&$(kr)),r}function vl(){var r,s;return y++,r=o,t.substr(o,6).toLowerCase()===B?(s=t.substr(o,6),o+=6):(s=n,y===0&&$(Ar)),s!==n&&(k=r,s=Ba(s)),r=s,y--,r===n&&(s=n,y===0&&$(Tr)),r}function bl(){var r,s;return y++,r=o,t.substr(o,4).toLowerCase()===Qe?(s=t.substr(o,4),o+=4):(s=n,y===0&&$(Pt)),s!==n&&(k=r,s=Da(s)),r=s,y--,r===n&&(s=n,y===0&&$(wr)),r}function xl(){var r,s;return y++,t.substr(o,7)===Ye?(r=Ye,o+=7):(r=n,y===0&&$(Cr)),r===n&&(t.substr(o,7)===Ze?(r=Ze,o+=7):(r=n,y===0&&$(jr)),r===n&&(t.substr(o,9)===Ke?(r=Ke,o+=9):(r=n,y===0&&$(Pr)),r===n&&(t.substr(o,5)===et?(r=et,o+=5):(r=n,y===0&&$(_r)),r===n&&(t.substr(o,8)===tt?(r=tt,o+=8):(r=n,y===0&&$(Fr)),r===n&&(t.substr(o,7)===nt?(r=nt,o+=7):(r=n,y===0&&$(Rr)),r===n&&(t.substr(o,11)===rt?(r=rt,o+=11):(r=n,y===0&&$(Nr)),r===n&&(t.substr(o,6)===at?(r=at,o+=6):(r=n,y===0&&$(Vr)),r===n&&(t.substr(o,8)===lt?(r=lt,o+=8):(r=n,y===0&&$(Lr)),r===n&&(t.substr(o,4)===ot?(r=ot,o+=4):(r=n,y===0&&$(Br)),r===n&&(t.substr(o,4)===it?(r=it,o+=4):(r=n,y===0&&$(Dr)),r===n&&(t.substr(o,8)===st?(r=st,o+=8):(r=n,y===0&&$(Hr))))))))))))),y--,r===n&&(s=n,y===0&&$(Or)),r}function Wt(){var r,s,v,h,E,S,w,O,H;for(y++,r=o,s=[],v=ge();v!==n;)s.push(v),v=ge();return v=$l(),v!==n?(h=o,t.charCodeAt(o)===91?(E=g,o++):(E=n,y===0&&$(wt)),E!==n?(S=Il(),t.charCodeAt(o)===93?(w=p,o++):(w=n,y===0&&$(Ot)),w!==n?(O=T(),k=h,h=Ha(s,v,S)):(o=h,h=n)):(o=h,h=n),h===n&&(h=null),E=o,t.charCodeAt(o)===58?(S=d,o++):(S=n,y===0&&$(Ct)),S!==n?(w=T(),O=jl(),O!==n?(H=T(),k=E,E=qa(s,v,h,O)):(o=E,E=n)):(o=E,E=n),E===n&&(E=null),t.charCodeAt(o)===59?(S=f,o++):(S=n,y===0&&$(Z)),S!==n?(k=r,r=Ma(s,v,h,E)):(o=r,r=n)):(o=r,r=n),y--,r===n&&(s=n,y===0&&$(qr)),r}function $l(){var r,s,v,h,E,S,w,O;return r=o,s=T(),v=oe(),v!==n?(h=T(),E=Al(),E!==n?(S=T(),w=oe(),w!==n?(O=T(),k=r,r=za(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=oe(),v!==n?(h=T(),E=wl(),E!==n?(S=T(),w=oe(),w!==n?(O=T(),k=r,r=Ua(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n)),r}function Il(){var r,s;for(y++,r=[],s=Qt();s!==n;)r.push(s),s=Qt();return y--,s=n,y===0&&$(Mr),r}function Qt(){var r,s,v,h,E,S,w,O;return y++,r=o,s=T(),v=El(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=le(),w!==n?(O=T(),k=r,r=Ja(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=Gt(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=Yt(),w!==n?(O=T(),k=r,r=Xa(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=kl(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=Tl(),w!==n?(O=T(),k=r,r=Ga(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n),r===n&&(r=o,s=T(),v=Sl(),v!==n?(h=T(),t.charCodeAt(o)===61?(E=u,o++):(E=n,y===0&&$(X)),E!==n?(S=T(),w=Ol(),w!==n?(O=T(),k=r,r=Wa(v,w)):(o=r,r=n)):(o=r,r=n)):(o=r,r=n)))),y--,r===n&&(s=n,y===0&&$(zr)),r}function El(){var r,s;return y++,r=o,t.substr(o,5).toLowerCase()===x?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(jt)),s!==n&&(k=r,s=Qa(s)),r=s,y--,r===n&&(s=n,y===0&&$(Ur)),r}function kl(){var r,s;return y++,r=o,t.substr(o,4).toLowerCase()===Qe?(s=t.substr(o,4),o+=4):(s=n,y===0&&$(Pt)),s!==n&&(k=r,s=Ya(s)),r=s,y--,r===n&&(s=n,y===0&&$(Jr)),r}function Sl(){var r,s;return y++,r=o,t.substr(o,5).toLowerCase()===fr?(s=t.substr(o,5),o+=5):(s=n,y===0&&$(Gr)),s!==n&&(k=r,s=Za(s)),r=s,y--,r===n&&(s=n,y===0&&$(Xr)),r}function Tl(){var r,s;return y++,t.substr(o,8)===ct?(r=ct,o+=8):(r=n,y===0&&$(Qr)),r===n&&(t.substr(o,8)===ut?(r=ut,o+=8):(r=n,y===0&&$(Yr))),y--,r===n&&(s=n,y===0&&$(Wr)),r}function Al(){var r,s;return y++,t.substr(o,2)===ft?(r=ft,o+=2):(r=n,y===0&&$(Kr)),r===n&&(t.substr(o,3)===pt?(r=pt,o+=3):(r=n,y===0&&$(ea)),r===n&&(t.substr(o,2)===mt?(r=mt,o+=2):(r=n,y===0&&$(ta)),r===n&&(t.substr(o,2)===dt?(r=dt,o+=2):(r=n,y===0&&$(na)),r===n&&(t.substr(o,2)===ht?(r=ht,o+=2):(r=n,y===0&&$(ra)),r===n&&(t.substr(o,2)===gt?(r=gt,o+=2):(r=n,y===0&&$(aa)),r===n&&(t.substr(o,2)===yt?(r=yt,o+=2):(r=n,y===0&&$(la)))))))),y--,r===n&&(s=n,y===0&&$(Zr)),r}function wl(){var r,s;return y++,t.substr(o,2)===vt?(r=vt,o+=2):(r=n,y===0&&$(ia)),r===n&&(t.substr(o,3)===bt?(r=bt,o+=3):(r=n,y===0&&$(sa)),r===n&&(t.substr(o,2)===xt?(r=xt,o+=2):(r=n,y===0&&$(ca)),r===n&&(t.substr(o,2)===$t?(r=$t,o+=2):(r=n,y===0&&$(ua)),r===n&&(t.substr(o,2)===It?(r=It,o+=2):(r=n,y===0&&$(fa)))))),y--,r===n&&(s=n,y===0&&$(oa)),r}function ge(){var r,s,v,h,E;if(r=o,s=T(),t.charCodeAt(o)===35?(v=pr,o++):(v=n,y===0&&$(pa)),v!==n){for(h=[],E=ye();E!==n;)h.push(E),E=ye();k=r,r=Ka(h)}else o=r,r=n;return r}function Ol(){var r;return r=Cl(),r===n&&(r=Ce()),r}function Cl(){var r,s,v,h,E;return r=o,s=o,v=Ce(),v!==n?(t.charCodeAt(o)===46?(h=mr,o++):(h=n,y===0&&$(ma)),h!==n?(E=Ce(),E!==n?(v=[v,h,E],s=v):(o=s,s=n)):(o=s,s=n)):(o=s,s=n),s!==n&&(k=r,s=el(s)),r=s,r}function Ce(){var r,s,v;if(r=o,s=[],St.test(t.charAt(o))?(v=t.charAt(o),o++):(v=n,y===0&&$(_t)),v!==n)for(;v!==n;)s.push(v),St.test(t.charAt(o))?(v=t.charAt(o),o++):(v=n,y===0&&$(_t));else s=n;return s!==n&&(k=r,s=tl(s)),r=s,r}function jl(){var r;return r=le(),r===n&&(r=Rl()),r}function Pl(){var r;return r=le(),r===n&&(r=Nl()),r}function le(){var r,s,v,h;return y++,r=o,t.charCodeAt(o)===34?(s=z,o++):(s=n,y===0&&$(U)),s!==n?(v=_l(),t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),h!==n?(k=r,r=nl(v)):(o=r,r=n)):(o=r,r=n),y--,r===n&&(s=n,y===0&&$(da)),r}function _l(){var r,s,v,h;for(r=[],s=o,v=o,y++,t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.substr(o,2)===fe?(h=fe,o+=2):(h=n,y===0&&$(Ft)),h===n&&(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G))),h!==n?(k=s,s=Bt(h)):(o=s,s=n)):(o=s,s=n);s!==n;)r.push(s),s=o,v=o,y++,t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.substr(o,2)===fe?(h=fe,o+=2):(h=n,y===0&&$(Ft)),h===n&&(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G))),h!==n?(k=s,s=Bt(h)):(o=s,s=n)):(o=s,s=n);return r}function Yt(){var r,s,v,h;return y++,r=o,t.charCodeAt(o)===34?(s=z,o++):(s=n,y===0&&$(U)),s!==n?(v=Fl(),t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),h!==n?(k=r,r=rl(v)):(o=r,r=n)):(o=r,r=n),y--,r===n&&(s=n,y===0&&$(ha)),r}function Fl(){var r,s,v,h;for(r=[],s=o,v=o,y++,t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),y--,h===n?v=void 0:(o=v,v=n),v!==n?(Tt.test(t.charAt(o))?(h=t.charAt(o),o++):(h=n,y===0&&$(Rt)),h!==n?(k=s,s=Dt(h)):(o=s,s=n)):(o=s,s=n);s!==n;)r.push(s),s=o,v=o,y++,t.charCodeAt(o)===34?(h=z,o++):(h=n,y===0&&$(U)),y--,h===n?v=void 0:(o=v,v=n),v!==n?(Tt.test(t.charAt(o))?(h=t.charAt(o),o++):(h=n,y===0&&$(Rt)),h!==n?(k=s,s=Dt(h)):(o=s,s=n)):(o=s,s=n);return r}function Rl(){var r,s;return r=o,s=Ll(),k=r,s=al(s),r=s,r}function Nl(){var r,s;return r=o,s=Vl(),k=r,s=ll(s),r=s,r}function Vl(){var r,s,v,h;for(r=[],s=o,v=o,y++,t.charCodeAt(o)===44?(h=i,o++):(h=n,y===0&&$(me)),h===n&&(t.charCodeAt(o)===59?(h=f,o++):(h=n,y===0&&$(Z)),h===n&&(t.charCodeAt(o)===123?(h=l,o++):(h=n,y===0&&$(re)))),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G)),h!==n?(k=s,s=Ht(h)):(o=s,s=n)):(o=s,s=n);s!==n;)r.push(s),s=o,v=o,y++,t.charCodeAt(o)===44?(h=i,o++):(h=n,y===0&&$(me)),h===n&&(t.charCodeAt(o)===59?(h=f,o++):(h=n,y===0&&$(Z)),h===n&&(t.charCodeAt(o)===123?(h=l,o++):(h=n,y===0&&$(re)))),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G)),h!==n?(k=s,s=Ht(h)):(o=s,s=n)):(o=s,s=n);return r}function Ll(){var r,s,v,h;for(r=[],s=o,v=o,y++,t.charCodeAt(o)===59?(h=f,o++):(h=n,y===0&&$(Z)),h===n&&(t.charCodeAt(o)===123?(h=l,o++):(h=n,y===0&&$(re))),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G)),h!==n?(k=s,s=qt(h)):(o=s,s=n)):(o=s,s=n);s!==n;)r.push(s),s=o,v=o,y++,t.charCodeAt(o)===59?(h=f,o++):(h=n,y===0&&$(Z)),h===n&&(t.charCodeAt(o)===123?(h=l,o++):(h=n,y===0&&$(re))),y--,h===n?v=void 0:(o=v,v=n),v!==n?(t.length>o?(h=t.charAt(o),o++):(h=n,y===0&&$(G)),h!==n?(k=s,s=qt(h)):(o=s,s=n)):(o=s,s=n);return r}function oe(){var r,s,v;if(y++,r=o,s=[],At.test(t.charAt(o))?(v=t.charAt(o),o++):(v=n,y===0&&$(Nt)),v!==n)for(;v!==n;)s.push(v),At.test(t.charAt(o))?(v=t.charAt(o),o++):(v=n,y===0&&$(Nt));else s=n;return s!==n&&(k=r,s=ol(s)),r=s,r===n&&(r=le()),y--,r===n&&(s=n,y===0&&$(ga)),r}function Zt(){var r,s;return y++,r=o,dr.test(t.charAt(o))?(s=t.charAt(o),o++):(s=n,y===0&&$(va)),s!==n&&(k=r,s=il(s)),r=s,y--,r===n&&(s=n,y===0&&$(ya)),r}function Kt(){var r,s;return y++,r=o,hr.test(t.charAt(o))?(s=t.charAt(o),o++):(s=n,y===0&&$(xa)),s!==n&&(k=r,s=sl(s)),r=s,y--,r===n&&(s=n,y===0&&$(ba)),r}function Bl(){var r;return t.substr(o,2)===Et?(r=Et,o+=2):(r=n,y===0&&$($a)),r}function Dl(){var r;return t.substr(o,2)===pe?(r=pe,o+=2):(r=n,y===0&&$(Vt)),r}function en(){var r,s,v;return r=o,s=o,y++,t.substr(o,2)===pe?(v=pe,o+=2):(v=n,y===0&&$(Vt)),y--,v===n?s=void 0:(o=s,s=n),s!==n?(t.length>o?(v=t.charAt(o),o++):(v=n,y===0&&$(G)),v!==n?(k=r,r=cl(v)):(o=r,r=n)):(o=r,r=n),r}function Hl(){var r,s,v,h;if(r=o,s=Bl(),s!==n){for(v=[],h=en();h!==n;)v.push(h),h=en();h=Dl(),h!==n?(k=r,r=ul(s,v,h)):(o=r,r=n)}else o=r,r=n;return r}function ql(){var r;return t.substr(o,2)===kt?(r=kt,o+=2):(r=n,y===0&&$(Ia)),r}function ye(){var r;return gr.test(t.charAt(o))?(r=t.charAt(o),o++):(r=n,y===0&&$(Ea)),r}function Ml(){var r,s,v,h;if(r=o,s=ql(),s!==n){for(v=[],h=ye();h!==n;)v.push(h),h=ye();k=r,r=fl(s,v)}else o=r,r=n;return r}function tn(){var r,s;return y++,r=Ml(),r===n&&(r=Hl()),y--,r===n&&(s=n,y===0&&$(ka)),r}function T(){var r,s;for(r=[],s=Zt(),s===n&&(s=Kt(),s===n&&(s=tn()));s!==n;)r.push(s),s=Zt(),s===n&&(s=Kt(),s===n&&(s=tn()));return r}if(he=c(),he!==n&&o===t.length)return he;throw he!==n&&o<t.length&&$(ml()),zt(we,D<t.length?t.charAt(D):null,D<t.length?ae(D,D+1):ae(D,D))}var kn=F(require("fast-xml-parser"),1),Y=F(require("he"),1),Ee=F(require("lodash/castArray.js"),1),Sn=F($n(),1);function bo(t,e,n){let m="";return t&&(m+=t),e&&(m+=` [${e}]`),n&&(m+=`/ ${n}`),m.trim()}var Ie={formatLabel:bo};var ie=F(require("lodash/castArray.js"),1);function xo(t,e){let n={id:e?`${e}.initial`:"initial"};return t.transition&&Object.assign(n,{transition:[t.transition]}),n}function $o(t){return{id:"initial",transition:[{target:t}]}}function Io(t){let e=[];return t.initial&&(typeof t.initial=="string"?e.push($o(t.initial)):e.push(xo(t.initial,t.id))),e}function In(t){return{...t,initial:Io(t),state:(0,ie.default)((t==null?void 0:t.state)??[]),parallel:(0,ie.default)((t==null?void 0:t.parallel)??[]),history:(0,ie.default)((t==null?void 0:t.history)??[]),final:(0,ie.default)((t==null?void 0:t.final)??[])}}var Eo=Ie.formatLabel;function En(t,e){return(0,Ee.default)(t[e]).map(n=>({type:e==="onexit"?"exit":"entry",body:Y.default.decode(n).trim()}))}function ko(t){return(0,Ee.default)(t).map(e=>({type:"activity",body:Y.default.decode(e.id||"").trim()||Y.default.decode(e||"").trim()}))}function So(t){let e=[];return t.onentry&&(e=e.concat(En(t,"onentry"))),t.invoke&&(e=e.concat(ko(t.invoke))),t.onexit&&(e=e.concat(En(t,"onexit"))),e}function To(t,e){return t==="history"&&e.type==="deep"?"deephistory":t}function se(t){return e=>{let n={name:e.id,type:To(t,e)};return P.getStateType(e.id)!==n.type&&(n.typeExplicitlySet=!0),(e.onentry||e.onexit||e.invoke)&&(n.actions=So(e)),Object.keys(e).some(m=>["initial","state","history","parallel","final"].includes(m))&&(n.statemachine=Tn(e)),n}}function Ao(t){let e={};return t.event&&(e.event=t.event.split(/\s+/).join(`
76
76
  `)),t.cond&&(e.cond=t.cond),t["#text"]&&(e.action=Y.default.decode(t["#text"]).trim()),t.type&&(e.type=t.type),e}function wo(t){let e={};typeof t=="string"?e.action=Y.default.decode(t).trim():Object.assign(e,Ao(t));let n=Eo(e.event,e.cond,e.action);return n&&(e.label=n),e}function Oo(t){return(e,n)=>{let m=((n==null?void 0:n.target)??t.id).split(/\s+/),a=wo(n);return e.concat(m.map(c=>({from:t.id,to:c,...a})))}}function Re(t){return t.filter(e=>Object.prototype.hasOwnProperty.call(e,"transition")).reduce((e,n)=>e.concat((0,Ee.default)(n.transition).reduce(Oo(n),[])),[])}function Tn(t){let e=In(t),n={states:e.initial.map(se("initial")).concat(e.state.map(se("regular"))).concat(e.parallel.map(se("parallel"))).concat(e.history.map(se("history"))).concat(e.final.map(se("final")))},m=Re(e.initial).concat(Re(e.state)).concat(Re(e.parallel));return m.length>0&&(n.transitions=m),n}function Co(t,e){return(0,Sn.default)(t).map(function(){var m;if((m=this.key)!=null&&m.startsWith(e)){let a=this.key.slice(e.length);this.parent.keys.includes(a)?this.remove():(this.parent.node[a]=this.node,this.remove())}})}function An(t){let e=t.trim(),n="@_",m={},a=new kn.default.XMLParser({attributeNamePrefix:n,ignoreAttributes:!1,parseTagValue:!0,processEntities:!1,tagValueProcessor:(c,i)=>Y.default.decode(i),stopNodes:["*.onentry","*.onexit","*.transition"]});try{m=Co(a.parse(e,!0),n)}catch{throw new Error(`That doesn't look like valid xml ...
77
77
  `)}return Tn((m==null?void 0:m.scxml)??{xmlns:"http://www.w3.org/2005/07/scxml",version:"1.0"})}var wn={$schema:"http://json-schema.org/draft-07/schema#",title:"state-machine-cat abstract syntax tree schema",$ref:"#/definitions/StateMachineType",$id:"org.js.state-machine-cat/v7.4.0",definitions:{StateType:{type:"string",enum:["regular","initial","terminate","final","parallel","history","deephistory","choice","forkjoin","fork","join","junction"]},TransitionType:{type:"string",enum:["internal","external"]},NoteType:{type:"array",items:{type:"string"}},ActionTypeType:{type:"string",enum:["entry","activity","exit"]},ActionType:{type:"object",required:["type","body"],additionalProperties:!1,properties:{type:{$ref:"#/definitions/ActionTypeType"},body:{type:"string"}}},ClassType:{type:"string",pattern:"^[a-zA-Z0-9_\\- ]*$"},StateMachineType:{type:"object",additionalProperties:!1,required:["states"],properties:{states:{type:"array",items:{type:"object",required:["name","type"],additionalProperties:!1,properties:{name:{description:"The name and identifier of the state. Unique within the root state machine.",type:"string"},type:{description:"What kind of state (or pseudo state) this state is. E.g. 'regular' for normal states or 'initial', 'final', 'choice' etc for pseudo states. Most UML (pseudo-) states are supported.",$ref:"#/definitions/StateType"},label:{description:"The display label of the state. If it's not present, most renderers will use the states' name in stead.",type:"string"},color:{description:'Color to use for rendering the state. Accepts all css color names ("blue") and hex notation - with ("#0000FF77") or without ("#0000FF") transparency.',type:"string"},class:{description:"Class name to give the state in dot and svg output.",$ref:"#/definitions/ClassType"},active:{description:"If true the state is considered to be active and rendered as such.",type:"boolean"},typeExplicitlySet:{description:"The default parser derives the `type` from the `name` with inband signaling. The user can override that behavior by explicitly setting the `type`. This attribute is there to express that (and make sure that on next parses & processing it doesn't get accidentily re-derived from the name again).",type:"boolean"},isComposite:{description:"convenience, derived attribute - set to true if there's a state machine inside the state; false in all other cases. For internal use - @deprecated",type:"boolean"},actions:{type:"array",description:"A series of actions and their types. The type describe when the action takes place (on entry, exit, or otherwise ('activity'))",items:{$ref:"#/definitions/ActionType"}},note:{description:"Comments related to this state. Some renderers will use the note attribute to render a note (i.e. as a post-it) attached to the state.",$ref:"#/definitions/NoteType"},statemachine:{description:"state machine nested within the state.",$ref:"#/definitions/StateMachineType"}}}},transitions:{type:"array",items:{type:"object",required:["from","to"],additionalProperties:!1,properties:{from:{description:"The name of the state this transition transitions from",type:"string"},to:{description:"The name of the state this transition transitions to",type:"string"},label:{description:"A display label to represent this transition. Parsers can parse this label into events conditions and actions.",type:"string"},event:{description:"Event triggering the transition",type:"string"},cond:{description:"Condition for the transition to occur.",type:"string"},action:{description:"Action to execute when the transition occurs.",type:"string"},note:{description:"Comments related to this transition",$ref:"#/definitions/NoteType"},color:{description:'Color to use for rendering the transition. Accepts all css color names ("blue") and hex notation - with ("#0000FF77") or without ("#0000FF") transparency.',type:"string"},width:{description:"The line width to use for rendering the transition",type:"number",minimum:0,maximum:30},class:{description:"Class name to give the state in dot and svg output.",$ref:"#/definitions/ClassType"},type:{description:"Whether the transition is external (default) or internal. See https://www.w3.org/TR/scxml/#transition for details.",$ref:"#/definitions/TransitionType"}}}}}}}};var On=new Cn.default;function jo(t,e){if(!On.validate(t,e))throw new Error(`The provided JSON is not a valid state-machine-cat AST: ${On.errorsText()}.
78
78
  `)}var jn={getAST(t,e){let n=t;return N.getOptionValue(e,"inputType")==="smcat"?n=hn(t):N.getOptionValue(e,"inputType")==="scxml"?n=An(t):typeof t=="string"&&(n=JSON.parse(t)),jo(wn,n),n}};var Ve=F(require("lodash/cloneDeep.js"),1),Ne=F(require("lodash/reject.js"),1);function Po(t,e,n){return t?`${t}${n}${e}`:e}function _o(t,e){let n={...t,...e,from:t.from,to:e.to};return e.action&&(n.action=Po(t.action,e.action,`
79
- `)),(n.event||n.cond||n.action)&&(n.label=Ie.formatLabel(n.event,n.cond,n.action)),n}function Fo(t,e,n){return t.reduce((m,a)=>(e.forEach((c,i)=>{c===a.to&&n[c]?m=m.concat(n[c].map(f=>_o(a,f))):m=i===0?m.concat(a):m}),m),[])}function Pn(t,e,n){let m=(0,Ve.default)(t);return m.transitions&&e.length>0&&(m.transitions=Fo(m.transitions,e,n)),m.states=m.states.map(a=>a.statemachine?{...a,statemachine:Pn(a.statemachine,e,n)}:a),m}function _n(t,e){let n=(0,Ve.default)(t);return n.transitions&&(n.transitions=(0,Ne.default)(n.transitions,m=>e.some(a=>a===m.from||a===m.to))),n.states=(0,Ne.default)(n.states,m=>e.includes(m.name)).map(m=>m.statemachine?{...m,statemachine:_n(m.statemachine,e)}:m),n}var Fn=(t,e=["fork","junction","choice"])=>{let n=new L(t),m=n.findStatesByTypes(e).map(({name:i})=>i),a=m.reduce((i,f)=>(i[f]=n.findTransitionsByFrom(f),i),{}),c=Pn(t,m,a);return _n(c,m)};var lr=F(require("lodash/has.js"),1),or=F(Bn(),1);var Jn=F(require("lodash/cloneDeep.js"),1);var Uo=[{name:"fontname",value:'"Helvetica"'},{name:"fontsize",value:"12"},{name:"penwidth",value:"2.0"}],Jo={dot:[{name:"splines",value:"true"},{name:"ordering",value:"out"},{name:"compound",value:"true"},{name:"overlap",value:"scale"},{name:"nodesep",value:"0.3"},{name:"ranksep",value:"0.1"}],fdp:[{name:"K",value:"0.9"}],osage:[{name:"pack",value:"42"}],neato:[{name:"epsilon",value:"0.9"}]},Xo={"bottom-top":[{name:"rankdir",value:"BT"}],"left-right":[{name:"rankdir",value:"LR"}],"right-left":[{name:"rankdir",value:"RL"}]},Go=[{name:"shape",value:"plaintext"},{name:"style",value:"filled"},{name:"fillcolor",value:'"#FFFFFF01"'},{name:"fontname",value:"Helvetica"},{name:"fontsize",value:12},{name:"penwidth",value:"2.0"}],Wo=[{name:"fontname",value:"Helvetica"},{name:"fontsize",value:10}];function De(t){return`${t.name}=${t.value}`}var ke={buildGraphAttributes:(t,e,n)=>Uo.concat(Jo[t]||[]).concat(Xo[e]||[]).concat(n||[]).map(De).join(" "),buildNodeAttributes:t=>Go.concat(t||[]).map(De).join(" "),buildEdgeAttributes:t=>Wo.concat(t||[]).map(De).join(" ")};var Dn=F(require("lodash/cloneDeep.js"),1);function Qo(t){return t.replace(/\\/g,"\\\\").replace(/\n\s*/g,"\\l").replace(/"/g,'\\"').concat("\\l")}function Yo(t){return t.replace(/\\/g,"\\\\").replace(/\n\s*/g," \\l").replace(/"/g,'\\"').concat(" \\l")}function Zo(t){let e=t||"top-down";return e==="top-down"||e==="bottom-top"}function Ko(t,e){return e.from===e.to&&t.findStateByName(e.from).statemachine&&e.type!=="internal"}var M={escapeString:Qo,escapeLabelString:Yo,isVertical:Zo,isCompositeSelf:Ko};function Hn(t){return e=>e.type===t}function He(t){return e=>t.includes(e.type)}function ei(t){let e=(0,Dn.default)(t);return e.label=t.label||t.name,e}function ti(t){return t.note?{noteName:`note_${t.name}`,...t}:t}function ni(t){let e={...t},n=["state",t.type];return t.class&&n.push(t.class.trim().replace(/[ ]{2,}/g," ")),e.class=n.join(" "),e}function ri(t){return t==="activity"?"":`${t}/ `}function ai(t){return t.actions?{...t,actionStrings:t.actions.map(e=>`${ri(e.type)}${e.body}`)}:t}function li(t){return t.note?{...t,noteFlattened:t.note.join("")}:t}function oi(t){return e=>{var m;let n=(m=(t||[]).find(a=>a.name==="color"))==null?void 0:m.value;return n&&!e.color&&He(["initial","fork","join","junction","forkjoin","final"])(e)&&(e.color=n),e}}function ii(t){return t.note?{...t,note:t.note.map(M.escapeString)}:t}function si(t){return e=>He(["fork","join","forkjoin"])(e)?{sizingExtras:M.isVertical(t)?"height=0.1":"width=0.1",...e}:e}function ci(t){return t.type==="parallel"&&t.statemachine&&t.statemachine.states&&(t.statemachine.states=t.statemachine.states.map(e=>Hn("regular")(e)?{...e,parentIsParallel:!0}:e)),t}var j={isType:Hn,isOneOfTypes:He,setLabel:ei,classifyState:ni,nameNote:ti,flattenActions:ai,flattenNote:li,recolor:oi,escapeStateStrings:ii,tipForkJoinStates:si,flagParallelChildren:ci};function ui(t){let e={...t};return e.note&&(e.note=e.note.map(M.escapeString)),e.label&&(e.label=M.escapeLabelString(e.label)),e}function fi(t){return e=>{let n={};return e.isCompositeSelf&&(M.isVertical(t)?n={tailportflags:'tailport="e" headport="e"',headportflags:'tailport="w"'}:e.hasParent?n={tailportflags:'tailport="n" headport="n"',headportflags:'tailport="s"'}:n={tailportflags:'tailport="s" headport="s"',headportflags:'tailport="n"'}),{...e,...n}}}function pi(t){let e=["transition"];return t.type&&e.push(t.type),t.class&&e.push(t.class.trim().replace(/[ ]{2,}/g," ")),t.class=e.join(" "),t}var Se={escapeTransitionStrings:ui,addPorts:fi,classifyTransition:pi};var ce=class{COUNTER=0;constructor(){this.reset()}reset(){this.COUNTER=0}next(){return++this.COUNTER}nextAsString(){return this.next().toString(10)}};var Xn=F(Un(),1);function bi(t){return e=>(Object.prototype.hasOwnProperty.call(e,"statemachine")&&(e.nestedExternalSelfTransitions=t.findExternalSelfTransitions(e.name).map(n=>n.name)),e)}function Gn(t,e,n,m){return t.filter(a=>a.statemachine).forEach(a=>{a.statemachine.states=Gn(a.statemachine.states,e,n,m)}),t.map(j.setLabel).map(j.nameNote).map(j.classifyState).map(j.escapeStateStrings).map(j.flattenNote).map(j.flattenActions).map(j.flagParallelChildren).map(j.tipForkJoinStates(e)).map(j.recolor(n)).map(bi(m))}function xi(t){return t.initialStates=t.states.filter(j.isType("initial")),t.regularStates=t.states.filter(e=>j.isType("regular")(e)&&!e.statemachine),t.historyStates=t.states.filter(j.isType("history")),t.deepHistoryStates=t.states.filter(j.isType("deephistory")),t.choiceStates=t.states.filter(j.isType("choice")),t.forkjoinStates=t.states.filter(j.isOneOfTypes(["fork","join","forkjoin"])),t.junctionStates=t.states.filter(j.isType("junction")),t.terminateStates=t.states.filter(j.isType("terminate")),t.finalStates=t.states.filter(j.isType("final")),t.compositeStates=t.states.filter(e=>e.statemachine),t}function $i(t){return e=>(t.findStateByName(e.from).statemachine&&(e.fromComposite=!0),t.findStateByName(e.to).statemachine&&(e.toComposite=!0),e)}function Ii(t){return e=>{let n={};return M.isCompositeSelf(t,e)&&(t.findStateByName(e.from).hasParent?n={hasParent:!0,isCompositeSelf:!0}:n={isCompositeSelf:!0}),{...e,...n}}}function Ei(t){return e=>(e.name=`tr_${e.from}_${e.to}_${t.nextAsString()}`,Boolean(e.note)&&(e.noteName=`note_${e.name}`),e)}function ki(t,e,n){return t.flattenedTransitions.map(Ei(n)).map(Se.escapeTransitionStrings).map(Se.classifyTransition).map(j.flattenNote).map($i(t)).map(Ii(t)).map(Se.addPorts(e))}var Te=(t,e)=>{e=e||{};let n=(0,Jn.default)(t),m=new L(n);return n.transitions=ki(m,e.direction,new ce),n.states=Gn(n.states,e.direction,e.dotNodeAttrs,m),n=xi(n),n.graphAttributes=ke.buildGraphAttributes(N.getOptionValue(e,"engine"),N.getOptionValue(e,"direction"),e.dotGraphAttrs),n.nodeAttributes=ke.buildNodeAttributes(e.dotNodeAttrs),n.edgeAttributes=ke.buildEdgeAttributes(e.dotEdgeAttrs),(0,Xn.default)(n)};var Wn=F(require("viz.js"),1);var Si={oldsvg:"svg",oldps2:"ps2",oldeps:"eps"},Ti=(t,e)=>(0,Wn.default)(Te(t,e),{engine:N.getOptionValue(e,"engine"),format:Si[N.getOptionValue(e,"outputType")]||"svg"}),ze=Ti;var Ai=/[\u0000-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g,wi=/[-|.|0-9|\u00B7|\u0300-\u036F|\u203F-\u2040]/g;function Qn(t){return t.replace(Ai,"_")}function Oi(t){let e=Qn(t);return e.match(wi)&&(e=`_${t}`),e}var Ae=t=>(t=t||"",t.length===0?"__empty":Oi(t[0]).concat(Qn(t.slice(1))));var Ci=/[\u00B7|\u0300-\u036F|\u203F-\u2040|\u0000-\u0029|\u002B-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g,ji=/[.]/g;function Yn(t){return t.replace(Ci,"_")}function Pi(t){let e=Yn(t);return e.match(ji)&&(e=`_${t}`),e}function _i(t){return t=t.replace(/\s+/g," ").trim(),Pi(t[0]).concat(Yn(t.slice(1)))}var Zn=t=>{let e=t||"";return e.length===0?"empty":e.split(/[\n\r]+/).filter(n=>n.length>0).map(_i).join(" ")};var Fi={regular:"state",initial:"initial",final:"final",terminate:"final",parallel:"parallel",history:"history",deephistory:"history"};function Ri(t){return Fi[t]||"state"}function Ni(t){let e={target:Ae(t.to)};return t.event&&(e.event=Zn(t.event)),t.cond&&(e.cond=t.cond),t.action&&(e.action=t.action),t.type&&(e.type=t.type),e}function Vi(t,e){return t.filter(n=>n.type===e).map(n=>n.body)}function Ue(t,e,n,m){let a=Vi(n,m);a.length>0&&(t[e]=(t[e]||[]).concat(a))}function Li(t,e){e.actions&&(Ue(t,"onentries",e.actions,"entry"),Ue(t,"onentries",e.actions,"activity"),Ue(t,"onexits",e.actions,"exit"))}function Bi(t,e,n){let m=n.filter(a=>a.from===e.name).map(Ni);m.length>0&&(t.transitions=m)}function Di(t,e,n){if(e.statemachine){let m=ne(e.statemachine,void 0,n);t.states=(t.states||[]).concat(m.states),m.initial&&(t.initial=m.initial)}}function Hi(t){return t=t||[],e=>{let n={kind:Ri(e.type),id:Ae(e.name)};return e.type==="deephistory"&&(n.type="deep"),Li(n,e),Bi(n,e,t),Di(n,e,t),n}}function qi(t){let e=t.states.filter(n=>n.type==="initial");if(e.length>0)return e[0].name}function Mi(t,e){let n=e;if(e&&t.transitions){let m=t.transitions.filter(a=>a.from===e);m.length>0&&!m[0].action&&(n=m[0].to)}return n}function ne(t,e,n){let m=qi(t),a=Mi(t,m),c={states:t.states.filter(i=>a&&a!==m?i.type!=="initial":!0).map(Hi(n||new L(t).flattenedTransitions))};return a&&(c.initial=Ae(a)),c}var rr=F(nr(),1),Gi=t=>(0,rr.default)(ne(t)),ar=Gi;var Wi=or.default;function We(t){let e={smcat:Wi,dot:Te,svg:ze,oldsvg:ze,scjson:ne,scxml:ar};return(0,lr.default)(e,t)?e[t]:n=>n}var ir="10.1.10";function sr(t,e){let n=jn.getAST(t,e),m=N.getOptionValue(e,"desugar");return We(N.getOptionValue(e,"outputType"))(m?Fn(n):n,e)}var cr=ir;function ur(){return N.getAllowedValues()}var Qi={render:sr,version:cr,getAllowedValues:ur};
79
+ `)),(n.event||n.cond||n.action)&&(n.label=Ie.formatLabel(n.event,n.cond,n.action)),n}function Fo(t,e,n){return t.reduce((m,a)=>(e.forEach((c,i)=>{c===a.to&&n[c]?m=m.concat(n[c].map(f=>_o(a,f))):m=i===0?m.concat(a):m}),m),[])}function Pn(t,e,n){let m=(0,Ve.default)(t);return m.transitions&&e.length>0&&(m.transitions=Fo(m.transitions,e,n)),m.states=m.states.map(a=>a.statemachine?{...a,statemachine:Pn(a.statemachine,e,n)}:a),m}function _n(t,e){let n=(0,Ve.default)(t);return n.transitions&&(n.transitions=(0,Ne.default)(n.transitions,m=>e.some(a=>a===m.from||a===m.to))),n.states=(0,Ne.default)(n.states,m=>e.includes(m.name)).map(m=>m.statemachine?{...m,statemachine:_n(m.statemachine,e)}:m),n}var Fn=(t,e=["fork","junction","choice"])=>{let n=new L(t),m=n.findStatesByTypes(e).map(({name:i})=>i),a=m.reduce((i,f)=>(i[f]=n.findTransitionsByFrom(f),i),{}),c=Pn(t,m,a);return _n(c,m)};var lr=F(require("lodash/has.js"),1),or=F(Bn(),1);var Jn=F(require("lodash/cloneDeep.js"),1);var Uo=[{name:"fontname",value:'"Helvetica"'},{name:"fontsize",value:"12"},{name:"penwidth",value:"2.0"}],Jo={dot:[{name:"splines",value:"true"},{name:"ordering",value:"out"},{name:"compound",value:"true"},{name:"overlap",value:"scale"},{name:"nodesep",value:"0.3"},{name:"ranksep",value:"0.1"}],fdp:[{name:"K",value:"0.9"}],osage:[{name:"pack",value:"42"}],neato:[{name:"epsilon",value:"0.9"}]},Xo={"bottom-top":[{name:"rankdir",value:"BT"}],"left-right":[{name:"rankdir",value:"LR"}],"right-left":[{name:"rankdir",value:"RL"}]},Go=[{name:"shape",value:"plaintext"},{name:"style",value:"filled"},{name:"fillcolor",value:'"#FFFFFF01"'},{name:"fontname",value:"Helvetica"},{name:"fontsize",value:12},{name:"penwidth",value:"2.0"}],Wo=[{name:"fontname",value:"Helvetica"},{name:"fontsize",value:10}];function De(t){return`${t.name}=${t.value}`}var ke={buildGraphAttributes:(t,e,n)=>Uo.concat(Jo[t]||[]).concat(Xo[e]||[]).concat(n||[]).map(De).join(" "),buildNodeAttributes:t=>Go.concat(t||[]).map(De).join(" "),buildEdgeAttributes:t=>Wo.concat(t||[]).map(De).join(" ")};var Dn=F(require("lodash/cloneDeep.js"),1);function Qo(t){return t.replace(/\\/g,"\\\\").replace(/\n\s*/g,"\\l").replace(/"/g,'\\"').concat("\\l")}function Yo(t){return t.replace(/\\/g,"\\\\").replace(/\n\s*/g," \\l").replace(/"/g,'\\"').concat(" \\l")}function Zo(t){let e=t||"top-down";return e==="top-down"||e==="bottom-top"}function Ko(t,e){return e.from===e.to&&t.findStateByName(e.from).statemachine&&e.type!=="internal"}var M={escapeString:Qo,escapeLabelString:Yo,isVertical:Zo,isCompositeSelf:Ko};function Hn(t){return e=>e.type===t}function He(t){return e=>t.includes(e.type)}function ei(t){let e=(0,Dn.default)(t);return e.label=t.label||t.name,e}function ti(t){return t.note?{noteName:`note_${t.name}`,...t}:t}function ni(t){let e={...t},n=["state",t.type];return t.class&&n.push(t.class.trim().replace(/[ ]{2,}/g," ")),e.class=n.join(" "),e}function ri(t){return t==="activity"?"":`${t}/ `}function ai(t){return t.actions?{...t,actionStrings:t.actions.map(e=>`${ri(e.type)}${e.body}`)}:t}function li(t){return t.note?{...t,noteFlattened:t.note.join("")}:t}function oi(t){return e=>{var m;let n=(m=(t||[]).find(a=>a.name==="color"))==null?void 0:m.value;return n&&!e.color&&He(["initial","fork","join","junction","forkjoin","final"])(e)&&(e.color=n),e}}function ii(t){return t.note?{...t,note:t.note.map(M.escapeString)}:t}function si(t){return e=>He(["fork","join","forkjoin"])(e)?{sizingExtras:M.isVertical(t)?"height=0.1":"width=0.1",...e}:e}function ci(t){return t.type==="parallel"&&t.statemachine&&t.statemachine.states&&(t.statemachine.states=t.statemachine.states.map(e=>Hn("regular")(e)?{...e,parentIsParallel:!0}:e)),t}var j={isType:Hn,isOneOfTypes:He,setLabel:ei,classifyState:ni,nameNote:ti,flattenActions:ai,flattenNote:li,recolor:oi,escapeStateStrings:ii,tipForkJoinStates:si,flagParallelChildren:ci};function ui(t){let e={...t};return e.note&&(e.note=e.note.map(M.escapeString)),e.label&&(e.label=M.escapeLabelString(e.label)),e}function fi(t){return e=>{let n={};return e.isCompositeSelf&&(M.isVertical(t)?n={tailportflags:'tailport="e" headport="e"',headportflags:'tailport="w"'}:e.hasParent?n={tailportflags:'tailport="n" headport="n"',headportflags:'tailport="s"'}:n={tailportflags:'tailport="s" headport="s"',headportflags:'tailport="n"'}),{...e,...n}}}function pi(t){let e=["transition"];return t.type&&e.push(t.type),t.class&&e.push(t.class.trim().replace(/[ ]{2,}/g," ")),t.class=e.join(" "),t}var Se={escapeTransitionStrings:ui,addPorts:fi,classifyTransition:pi};var ce=class{COUNTER=0;constructor(){this.reset()}reset(){this.COUNTER=0}next(){return++this.COUNTER}nextAsString(){return this.next().toString(10)}};var Xn=F(Un(),1);function bi(t){return e=>(Object.prototype.hasOwnProperty.call(e,"statemachine")&&(e.nestedExternalSelfTransitions=t.findExternalSelfTransitions(e.name).map(n=>n.name)),e)}function Gn(t,e,n,m){return t.filter(a=>a.statemachine).forEach(a=>{a.statemachine.states=Gn(a.statemachine.states,e,n,m)}),t.map(j.setLabel).map(j.nameNote).map(j.classifyState).map(j.escapeStateStrings).map(j.flattenNote).map(j.flattenActions).map(j.flagParallelChildren).map(j.tipForkJoinStates(e)).map(j.recolor(n)).map(bi(m))}function xi(t){return t.initialStates=t.states.filter(j.isType("initial")),t.regularStates=t.states.filter(e=>j.isType("regular")(e)&&!e.statemachine),t.historyStates=t.states.filter(j.isType("history")),t.deepHistoryStates=t.states.filter(j.isType("deephistory")),t.choiceStates=t.states.filter(j.isType("choice")),t.forkjoinStates=t.states.filter(j.isOneOfTypes(["fork","join","forkjoin"])),t.junctionStates=t.states.filter(j.isType("junction")),t.terminateStates=t.states.filter(j.isType("terminate")),t.finalStates=t.states.filter(j.isType("final")),t.compositeStates=t.states.filter(e=>e.statemachine),t}function $i(t){return e=>(t.findStateByName(e.from).statemachine&&(e.fromComposite=!0),t.findStateByName(e.to).statemachine&&(e.toComposite=!0),e)}function Ii(t){return e=>{let n={};return M.isCompositeSelf(t,e)&&(t.findStateByName(e.from).hasParent?n={hasParent:!0,isCompositeSelf:!0}:n={isCompositeSelf:!0}),{...e,...n}}}function Ei(t){return e=>(e.name=`tr_${e.from}_${e.to}_${t.nextAsString()}`,e.note&&(e.noteName=`note_${e.name}`),e)}function ki(t,e,n){return t.flattenedTransitions.map(Ei(n)).map(Se.escapeTransitionStrings).map(Se.classifyTransition).map(j.flattenNote).map($i(t)).map(Ii(t)).map(Se.addPorts(e))}var Te=(t,e)=>{e=e||{};let n=(0,Jn.default)(t),m=new L(n);return n.transitions=ki(m,e.direction,new ce),n.states=Gn(n.states,e.direction,e.dotNodeAttrs,m),n=xi(n),n.graphAttributes=ke.buildGraphAttributes(N.getOptionValue(e,"engine"),N.getOptionValue(e,"direction"),e.dotGraphAttrs),n.nodeAttributes=ke.buildNodeAttributes(e.dotNodeAttrs),n.edgeAttributes=ke.buildEdgeAttributes(e.dotEdgeAttrs),(0,Xn.default)(n)};var Wn=F(require("viz.js"),1);var Si={oldsvg:"svg",oldps2:"ps2",oldeps:"eps"},Ti=(t,e)=>(0,Wn.default)(Te(t,e),{engine:N.getOptionValue(e,"engine"),format:Si[N.getOptionValue(e,"outputType")]||"svg"}),ze=Ti;var Ai=/[\u0000-\u002C\u002F\u003B-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u0300-\u036F\u037E\u2000-\u200B\u200E-\u206F\u2190-\u2BFF\u2FF0-\u3000\uD800-\uF8FF\uFDD0-\uFDEF\uFFFE-\uFFFF]/g,wi=/[-.0-9\u00B7\u0300-\u036F\u203F-\u2040]/g;function Qn(t){return t.replace(Ai,"_")}function Oi(t){let e=Qn(t);return e.match(wi)&&(e=`_${t}`),e}var Ae=t=>(t=t||"",t.length===0?"__empty":Oi(t[0]).concat(Qn(t.slice(1))));var Ci=/[\u00B7\u0300-\u036F\u203F-\u2040\u0000-\u0029\u002B-\u002C\u002F\u003B-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u0300-\u036F\u037E\u2000-\u200B\u200E-\u206F\u2190-\u2BFF\u2FF0-\u3000\uD800-\uF8FF\uFDD0-\uFDEF\uFFFE-\uFFFF]/g,ji=/[.]/g;function Yn(t){return t.replace(Ci,"_")}function Pi(t){let e=Yn(t);return e.match(ji)&&(e=`_${t}`),e}function _i(t){return t=t.replace(/\s+/g," ").trim(),Pi(t[0]).concat(Yn(t.slice(1)))}var Zn=t=>{let e=t||"";return e.length===0?"empty":e.split(/[\n\r]+/).filter(n=>n.length>0).map(_i).join(" ")};var Fi={regular:"state",initial:"initial",final:"final",terminate:"final",parallel:"parallel",history:"history",deephistory:"history"};function Ri(t){return Fi[t]||"state"}function Ni(t){let e={target:Ae(t.to)};return t.event&&(e.event=Zn(t.event)),t.cond&&(e.cond=t.cond),t.action&&(e.action=t.action),t.type&&(e.type=t.type),e}function Vi(t,e){return t.filter(n=>n.type===e).map(n=>n.body)}function Ue(t,e,n,m){let a=Vi(n,m);a.length>0&&(t[e]=(t[e]||[]).concat(a))}function Li(t,e){e.actions&&(Ue(t,"onentries",e.actions,"entry"),Ue(t,"onentries",e.actions,"activity"),Ue(t,"onexits",e.actions,"exit"))}function Bi(t,e,n){let m=n.filter(a=>a.from===e.name).map(Ni);m.length>0&&(t.transitions=m)}function Di(t,e,n){if(e.statemachine){let m=ne(e.statemachine,void 0,n);t.states=(t.states||[]).concat(m.states),m.initial&&(t.initial=m.initial)}}function Hi(t){return t=t||[],e=>{let n={kind:Ri(e.type),id:Ae(e.name)};return e.type==="deephistory"&&(n.type="deep"),Li(n,e),Bi(n,e,t),Di(n,e,t),n}}function qi(t){let e=t.states.filter(n=>n.type==="initial");if(e.length>0)return e[0].name}function Mi(t,e){let n=e;if(e&&t.transitions){let m=t.transitions.filter(a=>a.from===e);m.length>0&&!m[0].action&&(n=m[0].to)}return n}function ne(t,e,n){let m=qi(t),a=Mi(t,m),c={states:t.states.filter(i=>a&&a!==m?i.type!=="initial":!0).map(Hi(n||new L(t).flattenedTransitions))};return a&&(c.initial=Ae(a)),c}var rr=F(nr(),1),Gi=t=>(0,rr.default)(ne(t)),ar=Gi;var Wi=or.default;function We(t){let e={smcat:Wi,dot:Te,svg:ze,oldsvg:ze,scjson:ne,scxml:ar};return(0,lr.default)(e,t)?e[t]:n=>n}var ir="10.1.11";function sr(t,e){let n=jn.getAST(t,e),m=N.getOptionValue(e,"desugar");return We(N.getOptionValue(e,"outputType"))(m?Fn(n):n,e)}var cr=ir;function ur(){return N.getAllowedValues()}var Qi={render:sr,version:cr,getAllowedValues:ur};
@@ -1,4 +1,4 @@
1
- const EVENT_CHAR_FORBIDDEN_RE = /[\u00B7|\u0300-\u036F|\u203F-\u2040|\u0000-\u0029|\u002B-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g;
1
+ const EVENT_CHAR_FORBIDDEN_RE = /[\u00B7\u0300-\u036F\u203F-\u2040\u0000-\u0029\u002B-\u002C\u002F\u003B-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u0300-\u036F\u037E\u2000-\u200B\u200E-\u206F\u2190-\u2BFF\u2FF0-\u3000\uD800-\uF8FF\uFDD0-\uFDEF\uFFFE-\uFFFF]/g;
2
2
  const START_EVENT_CHAR_FORBIDDEN_EXTRA_RE = /[.]/g;
3
3
  function makeValidEventChar(pCandidateEventStringTail) {
4
4
  return pCandidateEventStringTail.replace(EVENT_CHAR_FORBIDDEN_RE, "_");
@@ -1,5 +1,5 @@
1
- const NAME_CHAR_FORBIDDEN_RE = /[\u0000-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g;
2
- const START_NAME_CHAR_FORBIDDEN_EXTRA_RE = /[-|.|0-9|\u00B7|\u0300-\u036F|\u203F-\u2040]/g;
1
+ const NAME_CHAR_FORBIDDEN_RE = /[\u0000-\u002C\u002F\u003B-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u0300-\u036F\u037E\u2000-\u200B\u200E-\u206F\u2190-\u2BFF\u2FF0-\u3000\uD800-\uF8FF\uFDD0-\uFDEF\uFFFE-\uFFFF]/g;
2
+ const START_NAME_CHAR_FORBIDDEN_EXTRA_RE = /[-.0-9\u00B7\u0300-\u036F\u203F-\u2040]/g;
3
3
  function makeValidNameChars(pCandidateNameTail) {
4
4
  return pCandidateNameTail.replace(NAME_CHAR_FORBIDDEN_RE, "_");
5
5
  }
@@ -1 +1 @@
1
- export const version = "10.1.10";
1
+ export const version = "10.1.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "state-machine-cat",
3
- "version": "10.1.10",
3
+ "version": "10.1.11",
4
4
  "description": "write beautiful state charts",
5
5
  "main": "./dist/commonjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -21,38 +21,30 @@
21
21
  "dist/esm/render/scxml/scxml.template.js"
22
22
  ],
23
23
  "scripts": {
24
- "build": "make clean dist pages",
25
- "build:cli": "make cli-build && rm -rf dist/esm && tsc",
26
- "build:fromscratch": "make clean dist pages cli-build && rm -rf dist/esm && tsc",
27
- "check": "wireit",
28
- "cachefolder": "wireit",
29
- "depcruise": "wireit",
30
- "depcruise:json": "wireit",
31
- "depcruise:graph": "wireit",
32
- "depcruise:graph:doc:archi-html": "wireit",
33
- "depcruise:graph:doc:archi-svg": "wireit",
34
- "depcruise:graph:doc:deps-html": "wireit",
35
- "depcruise:graph:doc:deps-svg": "wireit",
36
- "depcruise:graph:doc:flat-deps-html": "wireit",
37
- "depcruise:graph:doc:flat-deps-svg": "wireit",
38
- "depcruise:html-report": "wireit",
39
- "depcruise:graph:dev": "wireit",
40
- "depcruise:graph:dev:flat": "wireit",
41
- "depcruise:view-report": "wireit",
42
- "depcruise:github-actions:markdown": "depcruise bin src test types --config config/dependency-cruiser.js --output-type markdown",
43
- "depcruise:github-actions:mermaid": "depcruise bin src --include-only '^(bin|src)' --config config/dependency-cruiser.js --output-type mermaid",
44
- "depcruise:github-actions:mermaid:affected": "depcruise bin src test types tools --config config/dependency-cruiser.js --output-type mermaid --reaches \"$(watskeburt $SHA -T regex)\"",
45
- "lint": "wireit",
46
- "lint:eslint": "wireit",
47
- "lint:prettier": "wireit",
48
- "lint:types": "wireit",
49
- "lint:types:tsc": "wireit",
50
- "lint:types:eslint": "wireit",
24
+ "build": "make clean dist pages cli-build && rm -rf dist/esm && tsc",
25
+ "check": "run-s depcruise lint test:cover",
26
+ "depcruise": "dependency-cruise bin src test types tools --config config/dependency-cruiser",
27
+ "depcruise:graph": "run-s depcruise:graph:doc:archi depcruise:graph:doc:deps depcruise:graph:doc:flat-deps",
28
+ "depcruise:graph:doc:archi": "dependency-cruise bin src --config config/dependency-cruiser/graph.js --output-type archi | dot -T svg | tee docs/dependency-cruiser-archi-graph.svg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-archi-graph.html",
29
+ "depcruise:graph:doc:deps": "dependency-cruise bin src --config config/dependency-cruiser/graph.js --output-type dot | dot -T svg | tee docs/dependency-cruiser-graph.svg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-graph.html",
30
+ "depcruise:graph:doc:flat-deps": "dependency-cruise bin src --config config/dependency-cruiser/graph.js --output-type flat | dot -T svg | tee docs/dependency-cruiser-graph-flat-dot.svg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-graph-flat-dot.html",
31
+ "depcruise:graph:dev": "dependency-cruise bin src --config config/dependency-cruiser/graph.js --output-type dot --prefix vscode://file/$(pwd)/ --highlight \"$(watskeburt develop)\"| dot -Tsvg | depcruise-wrap-stream-in-html | browser",
32
+ "depcruise:graph:dev:flat": "dependency-cruise bin src --config config/dependency-cruiser/graph.js --output-type flat --prefix vscode://file/$(pwd)/ --highlight \"$(watskeburt develop)\"| twopi -Tsvg | depcruise-wrap-stream-in-html | browser",
33
+ "depcruise:view-report": "dependency-cruise bin src test types tools --config config/dependency-cruiser --output-type err-html --prefix vscode://file/$(pwd)/ | browser",
34
+ "depcruise:github-actions:markdown": "dependency-cruise bin src test types tools --config config/dependency-cruiser --output-type markdown",
35
+ "depcruise:github-actions:mermaid": "dependency-cruise bin src --config config/dependency-cruiser/graph.js --output-type mermaid",
36
+ "depcruise:github-actions:mermaid:affected": "dependency-cruise bin src test types tools --no-cache --config config/dependency-cruiser --output-type mermaid --reaches \"$(watskeburt $SHA -T regex)\"",
37
+ "format": "prettier --cache --loglevel warn --write \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"{src,types}/**/*.{ts,mts}\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
38
+ "format:check": "prettier --cache --check \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"{src,types}/**/*.{ts,mts}\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
39
+ "lint": "run-p lint:eslint format:check lint:types",
40
+ "lint:eslint": "eslint --cache --cache-location node_modules/.cache/eslint/cache.json --color src test config",
41
+ "lint:types": "run-p lint:types:*",
42
+ "lint:types:tsc": "tsc --noEmit --strict --types --noUnusedLocals --noUnusedParameters --pretty types/*.d.ts src/cli/*.d.ts src/parse/scxml/*.d.ts",
43
+ "lint:types:eslint": "eslint types/*.d.ts src/cli/*.d.ts src/parse/scxml/*.d.ts",
51
44
  "lint:eslint:clear-caches": "rm -rf node_modules/.cache/eslint/",
52
- "lint:fix": "wireit",
53
- "lint:fix:eslint": "wireit",
54
- "lint:fix:prettier": "wireit",
55
- "lint:fix:types": "wireit",
45
+ "lint:fix": "run-s lint:fix:eslint format lint:fix:types",
46
+ "lint:fix:eslint": "eslint --cache --cache-location node_modules/.cache/eslint/cache.json --fix --color src test config",
47
+ "lint:fix:types": "eslint --fix types/*.d.ts src/cli/*.d.ts src/cli/*.d.ts src/parse/scxml/*.d.ts",
56
48
  "prepare": "husky install",
57
49
  "scm:push": "run-p --aggregate-output scm:push:*",
58
50
  "scm:push:github": "run-p --aggregate-output scm:push:github:*",
@@ -65,13 +57,13 @@
65
57
  "scm:push:bitbucket-mirror:commits": "git push bitbucket-mirror",
66
58
  "scm:push:bitbucket-mirror:tags": "git push --tags bitbucket-mirror",
67
59
  "scm:stage": "git add .",
68
- "test": "wireit",
69
- "test:cover": "wireit",
60
+ "test": "mocha --no-warnings",
61
+ "test:cover": "NODE_OPTIONS=--no-warnings c8 mocha",
70
62
  "update-dependencies": "run-s upem:update upem:install lint:eslint:clear-caches lint:fix check",
71
63
  "upem-outdated": "npm outdated --json --long | upem --dry-run",
72
64
  "upem:install": "npm install",
73
65
  "upem:update": "npm outdated --json --long | upem | pbcopy && pbpaste",
74
- "version": "run-s build:fromscratch depcruise:graph scm:stage"
66
+ "version": "run-s build depcruise:graph scm:stage"
75
67
  },
76
68
  "files": [
77
69
  "bin/",
@@ -90,262 +82,6 @@
90
82
  }
91
83
  ]
92
84
  },
93
- "wireit": {
94
- "check": {
95
- "dependencies": [
96
- "depcruise",
97
- "lint",
98
- "test:cover"
99
- ]
100
- },
101
- "cachefolder": {
102
- "command": "mkdir -p node_modules/.cache",
103
- "clean": false,
104
- "files": [],
105
- "output": [
106
- "node_modules/.cache"
107
- ],
108
- "packageLocks": []
109
- },
110
- "depcruise:json": {
111
- "command": "dependency-cruise --progress performance-log --output-type json --output-to node_modules/.cache/depcruise-cache.json --config config/dependency-cruiser.js src test bin",
112
- "files": [
113
- "src/**/*",
114
- "test/**/*",
115
- "bin/**/*",
116
- "config/dependency-cruiser.js"
117
- ],
118
- "dependencies": [
119
- "cachefolder"
120
- ],
121
- "clean": true,
122
- "output": [
123
- "node_modules/.cache/depcruise-cache.json"
124
- ]
125
- },
126
- "depcruise": {
127
- "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type err-long",
128
- "files": [
129
- "node_modules/.cache/depcruise-cache.json"
130
- ],
131
- "dependencies": [
132
- "depcruise:json"
133
- ],
134
- "output": []
135
- },
136
- "depcruise:html-report": {
137
- "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type err-html --output-to dependency-violation-report.html",
138
- "files": [
139
- "node_modules/.cache/depcruise-cache.json"
140
- ],
141
- "dependencies": [
142
- "depcruise:json"
143
- ],
144
- "clean": false,
145
- "output": [
146
- "dependency-violation-report.html"
147
- ]
148
- },
149
- "depcruise:graph:doc:deps-svg": {
150
- "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --include-only '^(bin|src|package\\.json)' --output-type dot | dot -T svg -o docs/dependency-cruiser-graph.svg",
151
- "files": [
152
- "node_modules/.cache/depcruise-cache.json"
153
- ],
154
- "dependencies": [
155
- "depcruise:json"
156
- ],
157
- "clean": false,
158
- "output": [
159
- "docs/dependency-cruiser-graph.svg"
160
- ]
161
- },
162
- "depcruise:graph:doc:deps-html": {
163
- "command": "depcruise-wrap-stream-in-html < docs/dependency-cruiser-graph.svg > docs/dependency-cruiser-graph.html",
164
- "files": [
165
- "node_modules/.cache/depcruise-cache.json"
166
- ],
167
- "dependencies": [
168
- "depcruise:graph:doc:deps-svg"
169
- ],
170
- "clean": false,
171
- "output": [
172
- "docs/dependency-cruiser-graph.html"
173
- ]
174
- },
175
- "depcruise:graph:doc:flat-deps-svg": {
176
- "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --include-only '^(bin|src|package\\.json)' --output-type flat | dot -T svg -o docs/dependency-cruiser-graph-flat-dot.svg",
177
- "files": [
178
- "node_modules/.cache/depcruise-cache.json"
179
- ],
180
- "dependencies": [
181
- "depcruise:json"
182
- ],
183
- "clean": false,
184
- "output": [
185
- "docs/dependency-cruiser-graph-flat-dot.svg"
186
- ]
187
- },
188
- "depcruise:graph:doc:flat-deps-html": {
189
- "command": "depcruise-wrap-stream-in-html < docs/dependency-cruiser-graph-flat-dot.svg > docs/dependency-cruiser-graph-flat-dot.html",
190
- "files": [
191
- "node_modules/.cache/depcruise-cache.json"
192
- ],
193
- "dependencies": [
194
- "depcruise:graph:doc:flat-deps-svg"
195
- ],
196
- "clean": false,
197
- "output": [
198
- "docs/dependency-cruiser-graph-flat-dot.html"
199
- ]
200
- },
201
- "depcruise:graph:doc:archi-svg": {
202
- "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --include-only '^(bin|src|package\\.json)' --output-type archi | dot -T svg -o docs/dependency-cruiser-archi-graph.svg",
203
- "files": [
204
- "node_modules/.cache/depcruise-cache.json"
205
- ],
206
- "dependencies": [
207
- "depcruise:json"
208
- ],
209
- "clean": false,
210
- "output": [
211
- "docs/dependency-cruiser-archi-graph.svg"
212
- ]
213
- },
214
- "depcruise:graph:doc:archi-html": {
215
- "command": "depcruise-wrap-stream-in-html < docs/dependency-cruiser-archi-graph.svg > docs/dependency-cruiser-archi-graph.html",
216
- "files": [
217
- "node_modules/.cache/depcruise-cache.json"
218
- ],
219
- "dependencies": [
220
- "depcruise:graph:doc:archi-svg"
221
- ],
222
- "clean": false,
223
- "output": [
224
- "docs/dependency-cruiser-archi-graph.html"
225
- ]
226
- },
227
- "depcruise:graph": {
228
- "dependencies": [
229
- "depcruise:graph:doc:archi-html",
230
- "depcruise:graph:doc:deps-html",
231
- "depcruise:graph:doc:flat-deps-html"
232
- ]
233
- },
234
- "depcruise:graph:dev": {
235
- "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type dot --include-only '^(bin|src|package\\.json)' --prefix vscode://file/$(pwd)/ --highlight \"$(watskeburt develop)\"| dot -Tsvg | depcruise-wrap-stream-in-html | browser",
236
- "dependencies": [
237
- "depcruise:json"
238
- ]
239
- },
240
- "depcruise:graph:dev:flat": {
241
- "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type flat --include-only '^(bin|src|package\\.json)' --prefix vscode://file/$(pwd)/ --highlight \"$(watskeburt develop)\"| twopi -Tsvg | depcruise-wrap-stream-in-html | browser",
242
- "dependencies": [
243
- "depcruise:json"
244
- ]
245
- },
246
- "depcruise:view-report": {
247
- "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type err-html --prefix vscode://file/$(pwd)/ | browser",
248
- "dependencies": [
249
- "depcruise:json"
250
- ]
251
- },
252
- "lint": {
253
- "dependencies": [
254
- "lint:eslint",
255
- "lint:prettier",
256
- "lint:types"
257
- ]
258
- },
259
- "lint:eslint": {
260
- "command": "eslint --cache --cache-location node_modules/.cache/eslint/cache.json --color src test config",
261
- "files": [
262
- "{src,test}/**/*.{js,mjs}",
263
- "config/**/*.{js,json}",
264
- ".eslintrc.json"
265
- ]
266
- },
267
- "lint:prettier": {
268
- "command": "prettier --check \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"{src,types}/**/*.{ts,mts}\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
269
- "files": [
270
- "bin/*.mjs",
271
- "{src,test}/**/*.{js,mjs}",
272
- "{config,test}/**/*.{js,json}",
273
- "tools/*.{js,mjs,json}",
274
- "types/*.ts",
275
- "*.{json,yml,md}",
276
- "docs/{smcat-online-interpreter.js,*.md}"
277
- ]
278
- },
279
- "lint:types": {
280
- "dependencies": [
281
- "lint:types:tsc",
282
- "lint:types:eslint"
283
- ]
284
- },
285
- "lint:types:tsc": {
286
- "command": "tsc --noEmit --strict --types --noUnusedLocals --noUnusedParameters --pretty types/*.d.ts src/cli/*.d.ts src/parse/scxml/*.d.ts",
287
- "files": [
288
- "types/*.d.ts"
289
- ]
290
- },
291
- "lint:types:eslint": {
292
- "command": "eslint types/*.d.ts src/cli/*.d.ts src/parse/scxml/*.d.ts",
293
- "files": [
294
- "{src,types}/**/*.d.{ts,mts}",
295
- ".eslintrc.json"
296
- ]
297
- },
298
- "lint:fix": {
299
- "dependencies": [
300
- "lint:fix:eslint",
301
- "lint:fix:prettier",
302
- "lint:fix:types"
303
- ]
304
- },
305
- "lint:fix:eslint": {
306
- "command": "eslint --cache --cache-location .cache --fix --color src test config",
307
- "files": [
308
- "{src,test}/**/*.{js,mjs}",
309
- "config/**/*.{js,json}",
310
- ".eslintrc.json"
311
- ]
312
- },
313
- "lint:fix:prettier": {
314
- "command": "prettier --loglevel warn --write \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"{src,types}/**/*.{ts,mts}\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
315
- "files": [
316
- "bin/*.mjs",
317
- "{src,test}/**/*.{js,mjs,ts,mts}",
318
- "{config,test}/**/*.{js,json}",
319
- "tools/*.{js,mjs,json}",
320
- "types/*.ts",
321
- "*.{json,yml,md}",
322
- "docs/{smcat-online-interpreter.js,*.md}"
323
- ]
324
- },
325
- "lint:fix:types": {
326
- "command": "eslint --fix types/*.d.ts src/cli/*.d.ts src/cli/*.d.ts src/parse/scxml/*.d.ts",
327
- "files": [
328
- "{src,types}/**/*.d.{ts,mts}",
329
- ".eslintrc.json"
330
- ]
331
- },
332
- "test": {
333
- "command": "mocha --no-warnings",
334
- "files": [
335
- "{src,test}/**/*.{js,mjs,json,ts,mts,cts}"
336
- ]
337
- },
338
- "test:cover": {
339
- "command": "NODE_OPTIONS=--no-warnings c8 mocha",
340
- "output": [
341
- "coverage/lcov.info",
342
- "coverage/coverage-summary.json"
343
- ],
344
- "files": [
345
- "{src,test}/**/*.{js,mjs,json,ts,mts,cts}"
346
- ]
347
- }
348
- },
349
85
  "keywords": [
350
86
  "state",
351
87
  "state chart",
@@ -385,39 +121,38 @@
385
121
  "@types/he": "1.2.0",
386
122
  "@types/lodash": "4.14.191",
387
123
  "@types/mocha": "10.0.1",
388
- "@typescript-eslint/eslint-plugin": "5.54.0",
389
- "@typescript-eslint/parser": "5.54.0",
124
+ "@typescript-eslint/eslint-plugin": "5.56.0",
125
+ "@typescript-eslint/parser": "5.56.0",
390
126
  "c8": "7.13.0",
391
127
  "chai": "4.3.7",
392
128
  "chai-as-promised": "7.1.1",
393
129
  "chai-json-schema": "1.5.1",
394
130
  "chai-xml": "0.4.0",
395
- "dependency-cruiser": "12.10.0",
396
- "esbuild": "0.17.10",
397
- "eslint": "8.35.0",
131
+ "dependency-cruiser": "12.11.0",
132
+ "esbuild": "0.17.13",
133
+ "eslint": "8.36.0",
398
134
  "eslint-config-moving-meadow": "4.0.2",
399
- "eslint-config-prettier": "8.6.0",
135
+ "eslint-config-prettier": "8.8.0",
400
136
  "eslint-plugin-budapestian": "5.0.1",
401
137
  "eslint-plugin-eslint-comments": "3.2.0",
402
138
  "eslint-plugin-import": "2.27.5",
403
139
  "eslint-plugin-mocha": "10.1.0",
404
140
  "eslint-plugin-node": "11.1.0",
405
141
  "eslint-plugin-security": "1.7.1",
406
- "eslint-plugin-unicorn": "45.0.2",
142
+ "eslint-plugin-unicorn": "46.0.0",
407
143
  "husky": "8.0.3",
408
144
  "is-pdf": "1.0.0",
409
145
  "is-png": "3.0.1",
410
- "lint-staged": "13.1.2",
146
+ "lint-staged": "13.2.0",
411
147
  "mocha": "10.2.0",
412
148
  "npm-run-all": "4.1.5",
413
- "peggy": "3.0.0",
414
- "prettier": "2.8.4",
149
+ "peggy": "3.0.2",
150
+ "prettier": "2.8.7",
415
151
  "query-string": "8.1.0",
416
152
  "ts-node": "10.9.1",
417
- "typescript": "4.9.5",
153
+ "typescript": "5.0.2",
418
154
  "upem": "7.3.2",
419
- "watskeburt": "0.10.0",
420
- "wireit": "0.9.5",
155
+ "watskeburt": "0.10.1",
421
156
  "xml-name-validator": "4.0.0"
422
157
  },
423
158
  "engines": {