/*! wavedrom 2016-07-28 */ !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb+e.offsetWidth||a.yd+e.offsetHeight)&&(e.parentNode.removeChild(e),document.body.removeEventListener("mousedown",c,!1))}var d,e;d=document.getElementById(b+a),d.childNodes[0].addEventListener("contextmenu",function(f){var g,h,i;e=document.createElement("div"),e.className="wavedromMenu",e.style.top=f.y+"px",e.style.left=f.x+"px",g=document.createElement("ul"),h=document.createElement("li"),h.innerHTML="Save as PNG",g.appendChild(h),i=document.createElement("li"),i.innerHTML="Save as SVG",g.appendChild(i),e.appendChild(g),document.body.appendChild(e),h.addEventListener("click",function(){var f,g,h,i,j,k,l,m;f="",0!==a&&(g=document.getElementById(b+0),f+=g.innerHTML.substring(166,g.innerHTML.indexOf(''))),f=[d.innerHTML.slice(0,166),f,d.innerHTML.slice(166)].join(""),h="data:image/svg+xml;base64,"+btoa(f),i=new Image,i.src=h,j=document.createElement("canvas"),j.width=i.width,j.height=i.height,k=j.getContext("2d"),k.drawImage(i,0,0),l=j.toDataURL("image/png"),m=document.createElement("a"),m.href=l,m.download="wavedrom.png",m.click(),e.parentNode.removeChild(e),document.body.removeEventListener("mousedown",c,!1)},!1),i.addEventListener("click",function(){var f,g,h,i;f="",0!==a&&(g=document.getElementById(b+0),f+=g.innerHTML.substring(166,g.innerHTML.indexOf(''))),f=[d.innerHTML.slice(0,166),f,d.innerHTML.slice(166)].join(""),h="data:image/svg+xml;base64,"+btoa(f),i=document.createElement("a"),i.href=h,i.download="wavedrom.svg",i.click(),e.parentNode.removeChild(e),document.body.removeEventListener("mousedown",c,!1)},!1),e.addEventListener("contextmenu",function(a){a.preventDefault()},!1),document.body.addEventListener("mousedown",c,!1),f.preventDefault()},!1)}b.exports=d},{}],2:[function(a,b,c){"use strict";var d=a("./jsonml-parse");b.exports=d},{"./jsonml-parse":15}],3:[function(a,b,c){"use strict";function d(){f(0,e("InputJSON_0"),"WaveDrom_Display_")}var e=a("./eva"),f=a("./render-wave-form");b.exports=d},{"./eva":4,"./render-wave-form":28}],4:[function(require,module,exports){"use strict";function eva(id){function erra(a){return{signal:[{name:["tspan",["tspan",{class:"error h5"},"Error: "],a.message]}]}}var TheTextBox,source;if(TheTextBox=document.getElementById(id),TheTextBox.type&&"textarea"===TheTextBox.type)try{source=eval("("+TheTextBox.value+")")}catch(a){return erra(a)}else try{source=eval("("+TheTextBox.innerHTML+")")}catch(a){return erra(a)}if("[object Object]"!==Object.prototype.toString.call(source))return erra({message:'[Semantic]: The root has to be an Object: "{signal:[...]}"'});if(source.signal){if("[object Array]"!==Object.prototype.toString.call(source.signal))return erra({message:'[Semantic]: "signal" object has to be an Array "signal:[]"'})}else{if(!source.assign)return erra({message:'[Semantic]: "signal:[...]" or "assign:[...]" property is missing inside the root Object'});if("[object Array]"!==Object.prototype.toString.call(source.assign))return erra({message:'[Semantic]: "assign" object hasto be an Array "assign:[]"'})}return source}module.exports=eva},{}],5:[function(a,b,c){"use strict";function d(a){var b=0,c=0,d=[];return a.forEach(function(a){"vvv-2"===a||"vvv-3"===a||"vvv-4"===a||"vvv-5"===a?c+=1:0!==c&&(d.push(b-(c+1)/2),c=0),b+=1}),0!==c&&d.push(b-(c+1)/2),d}b.exports=d},{}],6:[function(a,b,c){"use strict";function d(a,b,c){var d,e,f=[];if(4===a.length){for(e=0;e");a.tagName===c.tagName&&(a=c)}catch(a){console.log(a)}for(var e in b)if(b.hasOwnProperty(e)){var i=b[e];e&&null!==i&&"undefined"!=typeof i&&(e=f[e.toLowerCase()]||e,"style"===e?"undefined"!=typeof a.style.cssText?a.style.cssText=i:a.style=i:h[e]?(d(a,e,i),g[e]&&d(a,g[e],i)):"string"==typeof i||"number"==typeof i||"boolean"==typeof i?(a.setAttribute(e,i),g[e]&&a.setAttribute(g[e],i)):(a[e]=i,g[e]&&(a[g[e]]=i)))}return a}var f={rowspan:"rowSpan",colspan:"colSpan",cellpadding:"cellPadding",cellspacing:"cellSpacing",tabindex:"tabIndex",accesskey:"accessKey",hidefocus:"hideFocus",usemap:"useMap",maxlength:"maxLength",readonly:"readOnly",contenteditable:"contentEditable"},g={enctype:"encoding",onscroll:"DOMMouseScroll"},h=function(a){for(var b,c={};a.length;)b=a.shift(),c["on"+b.toLowerCase()]=b;return c}("blur,change,click,dblclick,error,focus,keydown,keypress,keyup,load,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,resize,scroll,select,submit,unload".split(","));b.exports=e},{}],13:[function(a,b,c){"use strict";function d(a,b){b&&(a.tagName&&"style"===a.tagName.toLowerCase()&&document.createStyleSheet?a.cssText=b:a.canHaveChildren!==!1&&a.appendChild(b))}b.exports=d},{}],14:[function(a,b,c){"use strict";function d(a){var b=document.createElement("div");if(b.innerHTML=a,e(b),1===b.childNodes.length)return b.firstChild;for(var c=document.createDocumentFragment?document.createDocumentFragment():document.createElement("");b.firstChild;)c.appendChild(b.firstChild);return c}var e=a("./jsonml-trim-whitespace");b.exports=d},{"./jsonml-trim-whitespace":16}],15:[function(a,b,c){"use strict";function d(a){return a instanceof Array&&"string"==typeof a[0]}function e(a,b,c){return document.createTextNode("["+a+"-"+c+"]")}var f,g,h=a("./jsonml-hydrate"),i=a("./w3"),j=a("./jsonml-append-child"),k=a("./jsonml-add-attributes"),l=a("./jsonml-trim-whitespace"),m=null;f=function(a,b,c){for(var d=1;d0?Math.round(a):1}var d;b.hscale=1,b.hscale0&&(b.hscale=b.hscale0),a&&a.config&&a.config.hscale&&(d=Math.round(c(a.config.hscale)),d>0&&(d>100&&(d=100),b.hscale=d)),b.yh0=0,b.yh1=0,b.head=a.head,b.xmin_cfg=0,b.xmax_cfg=1e12,a&&a.config&&a.config.hbounds&&2==a.config.hbounds.length&&(a.config.hbounds[0]=Math.floor(a.config.hbounds[0]),a.config.hbounds[1]=Math.ceil(a.config.hbounds[1]),a.config.hbounds[0]"===i&&(k=!1,i=m.shift()),d=1;"."===m[0]||"|"===m[0];)m.shift(),d+=1;n=k?n.concat(f(h+i,0,d-c.period)):n.concat(f(h+i,b,d))}for(j=0;j0?(l=g(o).length,1==g([o[o.length-1]]).length&&1==g([n[0]]).length&&(l-=1)):l=0,[n,l]}var e=a("./gen-first-wave-brick"),f=a("./gen-wave-brick"),g=a("./find-lane-markers");b.exports=d},{"./find-lane-markers":5,"./gen-first-wave-brick":7,"./gen-wave-brick":8}],20:[function(a,b,c){"use strict";function d(a,b){var c;return c=a.data,void 0===c?null:("string"==typeof c&&(c=c.split(" ")),c=c.slice(b))}function e(a,b){var c,e,g,h,i,j=[],k=[];for(c in a)e=a[c],b.period=e.period?e.period:1,b.phase=(e.phase?2*e.phase:0)+b.xmin_cfg,j.push([]),k[0]=e.name||" ",k[1]=(e.phase||0)+b.xmin_cfg/2,e.wave?(h=f(e.wave,b.period*b.hscale-1,b),g=h[0],i=h[1]):g=null,j[j.length-1][0]=k.slice(0),j[j.length-1][1]=g,j[j.length-1][2]=d(e,i);return j}var f=a("./parse-wave-lane");b.exports=e},{"./parse-wave-lane":19}],21:[function(a,b,c){"use strict";function d(){var a,b,c,d;for(c=0,a=document.querySelectorAll("*"),b=0;bdiv.wavedromMenu{position:fixed;border:solid 1pt#CCCCCC;background-color:white;box-shadow:0px 10px 20px #808080;cursor:default;margin:0px;padding:0px;}div.wavedromMenu>ul{margin:0px;padding:0px;}div.wavedromMenu>ul>li{padding:2px 10px;list-style:none;}div.wavedromMenu>ul>li:hover{background-color:#b5d5ff;}'}var e=a("./eva"),f=a("./append-save-as-dialog"),g=a("./render-wave-form");b.exports=d},{"./append-save-as-dialog":1,"./eva":4,"./render-wave-form":28}],22:[function(a,b,c){"use strict";function d(a,b){var c,e,f={},g={x:10};for("string"!=typeof a[0]&&"number"!=typeof a[0]||(e=a[0],g.x=25),b.x+=g.x,c=0;c":x.setAttribute("style","marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none");break;case"~>":x.setAttribute("style","marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","M "+r.x+","+r.y+" c "+.7*t+", 0 "+.3*t+", "+u+" "+t+", "+u);break;case"-~>":x.setAttribute("style","marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","M "+r.x+","+r.y+" c "+.7*t+", 0 "+t+", "+u+" "+t+", "+u),A.label&&(v=r.x+.75*(s.x-r.x));break;case"~->":x.setAttribute("style","marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","M "+r.x+","+r.y+" c 0, 0 "+.3*t+", "+u+" "+t+", "+u),A.label&&(v=r.x+.25*(s.x-r.x));break;case"-|>":x.setAttribute("style","marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","m "+r.x+","+r.y+" "+t+",0 0,"+u),A.label&&(v=s.x);break;case"|->":x.setAttribute("style","marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","m "+r.x+","+r.y+" 0,"+u+" "+t+",0"),A.label&&(v=r.x);break;case"-|->":x.setAttribute("style","marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","m "+r.x+","+r.y+" "+t/2+",0 0,"+u+" "+t/2+",0");break;case"<->":x.setAttribute("style","marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none");break;case"<~>":x.setAttribute("style","marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","M "+r.x+","+r.y+" c "+.7*t+", 0 "+.3*t+", "+u+" "+t+", "+u);break;case"<-~>":x.setAttribute("style","marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","M "+r.x+","+r.y+" c "+.7*t+", 0 "+t+", "+u+" "+t+", "+u),A.label&&(v=r.x+.75*(s.x-r.x));break;case"<-|>":x.setAttribute("style","marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","m "+r.x+","+r.y+" "+t+",0 0,"+u),A.label&&(v=s.x);break;case"<-|->":x.setAttribute("style","marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none"),x.setAttribute("d","m "+r.x+","+r.y+" "+t/2+",0 0,"+u+" "+t/2+",0");break;default:x.setAttribute("style","fill:none;stroke:#F00;stroke-width:1")}A.label&&(p.setAttribute("x",v),p.setAttribute("y",w+3),q.setAttribute("x",v-y/2),q.setAttribute("y",w-5))}for(l in B)l===l.toLowerCase()&&B[l].x>0&&(q=f(["rect",{y:B[l].y-4,height:8,style:"fill:#FFF;"}]),p=f(["text",{style:"font-size:8px;",x:B[l].x,y:B[l].y+2,"text-anchor":"middle"},l+""]),j.insertBefore(q,null),j.insertBefore(p,null),y=p.getBBox().width+2,q.setAttribute("x",B[l].x-y/2),q.setAttribute("width",y))}}var e=a("tspan"),f=a("./create-element"),g=a("./w3");b.exports=d},{"./create-element":2,"./w3":30,tspan:33}],24:[function(a,b,c){"use strict";function d(a,b){var c,e,f;for(b.xmax=Math.max(b.xmax,b.x),c=b.y,f=a.length,e=1;e"===m&&(l=!1,m=n.shift()),j+=l?1:2*d.period,"|"===m&&(i=document.createElementNS(e.svg,"use"),i.setAttributeNS(e.xlink,"xlink:href","#gap"),i.setAttribute("transform","translate("+d.xs*((j-(l?0:d.period))*d.hscale-d.phase)+")"),h.insertBefore(i,null))}}var e=a("./w3");b.exports=d},{"./w3":30}],26:[function(a,b,c){"use strict";function d(a,b,c){var d,f,g,h=["g"];return a.forEach(function(a,i){h.push(["path",{id:"group_"+i+"_"+b,d:"m "+(a.x+.5)+","+(a.y*c.yo+3.5+c.yh0+c.yh1)+" c -3,0 -5,2 -5,5 l 0,"+(a.height*c.yo-16)+" c 0,3 2,5 5,5",style:"stroke:#0041c4;stroke-width:1;fill:none"}]),void 0!==a.name&&(d=a.x-10,f=c.yo*(a.y+a.height/2)+c.yh0+c.yh1,g=e.parse(a.name),g.unshift("text",{"text-anchor":"middle",class:"info","xml:space":"preserve"}),h.push(["g",{transform:"translate("+d+","+f+")"},["g",{transform:"rotate(270)"},g]]))}),h}var e=a("tspan");b.exports=d},{tspan:33}],27:[function(a,b,c){"use strict";function d(a,b,c,d){function g(a,b,c){var d;a[b]&&a[b].text&&(d=e.parse(a[b].text),d.unshift("text",{x:a.xmax*a.xs/2,y:c,"text-anchor":"middle",fill:"#000","xml:space":"preserve"}),d=f(d),j.insertBefore(d,null))}function h(a,b,c,d,g,h,k){var l,m,n,o,p=1,q=0,r=[];if(void 0!==a[b]&&void 0!==a[b][c]){if(n=a[b][c],"string"==typeof n)n=n.split(" ");else if("number"==typeof n||"boolean"==typeof n)for(m=Number(n),n=[],i=0;i0?Math.ceil(2*q)-2*q:-2*q,m=f(["g",{id:"wavelane_draw_"+j+"_"+c,transform:"translate("+q*d.xs+", 0)"}]),l.insertBefore(m,null),b[j][1])){for(i=0;is&&(s=b[j][1].length)}return d.xmax=Math.min(s,d.xmax_cfg-d.xmin_cfg),d.xg=t+20,u}var e=a("tspan"),f=a("./create-element"),g=a("./w3"),h=a("./find-lane-markers");b.exports=d},{"./create-element":2,"./find-lane-markers":5,"./w3":30,tspan:33}],30:[function(a,b,c){"use strict";b.exports={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/XML/1998/namespace"}},{}],31:[function(a,b,c){"use strict";window.WaveDrom=window.WaveDrom||{};var d=a("./");window.WaveDrom.ProcessAll=d.processAll,window.WaveDrom.RenderWaveForm=d.renderWaveForm,window.WaveDrom.EditorRefresh=d.editorRefresh,window.WaveDrom.eva=d.eva},{"./":9}],32:[function(a,b,c){"use strict";b.exports=window.WaveSkin},{}],33:[function(a,b,c){"use strict";function d(a,b){b.add&&b.add.split(";").forEach(function(b){var c=b.split(" ");a[c[0]][c[1]]=!0}),b.del&&b.del.split(";").forEach(function(b){var c=b.split(" ");delete a[c[0]][c[1]]})}function e(a){return Object.keys(a).reduce(function(b,c){var d=Object.keys(a[c]);return d.length>0&&(b[c]=d.join(" ")),b},{})}function f(a){var b,c,f,i,j;if(void 0===a)return[];if("number"==typeof a)return[a+""];if("string"!=typeof a)return[a];for(c=[],b={"text-decoration":{},"font-weight":{},"font-style":{},"baseline-shift":{},"font-size":{},"font-family":{}};;){if(f=a.search(g),f===-1)return c.push(["tspan",e(b),a]),c;if(f>0&&(j=a.slice(0,f),c.push(["tspan",e(b),j])),i=a.match(g)[0],d(b,h[i]),a=a.slice(f+i.length),0===a.length)return c}}var g=/||||||||<\/o>|<\/ins>|<\/s>|<\/sub>|<\/sup>|<\/b>|<\/i>|<\/tt>/,h={"":{add:"text-decoration overline"},"":{del:"text-decoration overline"},"":{add:"text-decoration underline"},"":{del:"text-decoration underline"},"":{add:"text-decoration line-through"},"":{del:"text-decoration line-through"},"":{add:"font-weight bold"},"":{del:"font-weight bold"},"":{add:"font-style italic"},"":{del:"font-style italic"},"":{add:"baseline-shift sub;font-size .7em"},"":{del:"baseline-shift sub;font-size .7em"},"":{add:"baseline-shift super;font-size .7em"},"":{del:"baseline-shift super;font-size .7em"},"":{add:"font-family monospace"},"":{del:"font-family monospace"}};c.parse=f},{}]},{},[31]);