/*! wavedrom 2.6.8 2020-5-26 PDT */ !function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,(function(r){return o(e[i][1][r]||r)}),p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;ileft+menu.offsetWidth||e.ytop+menu.offsetHeight)&&(menu.parentNode.removeChild(menu),document.body.removeEventListener("mousedown",closeMenu,!1))}(div=document.getElementById(output+index)).childNodes[0].addEventListener("contextmenu",(function(e){var list,savePng,saveSvg;(menu=document.createElement("div")).className="wavedromMenu",menu.style.top=e.y+"px",menu.style.left=e.x+"px",list=document.createElement("ul"),(savePng=document.createElement("li")).innerHTML="Save as PNG",list.appendChild(savePng),(saveSvg=document.createElement("li")).innerHTML="Save as SVG",list.appendChild(saveSvg),menu.appendChild(list),document.body.appendChild(menu),savePng.addEventListener("click",(function(){var html,firstDiv,svgdata,img,canvas,pngdata,a;html="",0!==index&&(html+=(firstDiv=document.getElementById(output+0)).innerHTML.substring(166,firstDiv.innerHTML.indexOf(''))),html=[div.innerHTML.slice(0,166),html,div.innerHTML.slice(166)].join(""),svgdata="data:image/svg+xml;base64,"+btoa(html),(img=new Image).src=svgdata,(canvas=document.createElement("canvas")).width=img.width,canvas.height=img.height,canvas.getContext("2d").drawImage(img,0,0),pngdata=canvas.toDataURL("image/png"),(a=document.createElement("a")).href=pngdata,a.download="wavedrom.png",a.click(),menu.parentNode.removeChild(menu),document.body.removeEventListener("mousedown",closeMenu,!1)}),!1),saveSvg.addEventListener("click",(function(){var html,firstDiv,svgdata,a;html="",0!==index&&(html+=(firstDiv=document.getElementById(output+0)).innerHTML.substring(166,firstDiv.innerHTML.indexOf(''))),html=[div.innerHTML.slice(0,166),html,div.innerHTML.slice(166)].join(""),svgdata="data:image/svg+xml;base64,"+btoa(html),(a=document.createElement("a")).href=svgdata,a.download="wavedrom.svg",a.click(),menu.parentNode.removeChild(menu),document.body.removeEventListener("mousedown",closeMenu,!1)}),!1),menu.addEventListener("contextmenu",(function(ee){ee.preventDefault()}),!1),document.body.addEventListener("mousedown",closeMenu,!1),e.preventDefault()}),!1)}},{}],2:[function(require,module,exports){"use strict";module.exports=function(Edge,from,to){var d,style,dx=to.x-from.x,dy=to.y-from.y,lx=(from.x+to.x)/2,ly=(from.y+to.y)/2;switch(Edge.shape){case"-":break;case"~":d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+.3*dx+", "+dy+" "+dx+", "+dy;break;case"-~":d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.75*(to.x-from.x));break;case"~-":d="M "+from.x+","+from.y+" c 0, 0 "+.3*dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.25*(to.x-from.x));break;case"-|":d="m "+from.x+","+from.y+" "+dx+",0 0,"+dy,Edge.label&&(lx=to.x);break;case"|-":d="m "+from.x+","+from.y+" 0,"+dy+" "+dx+",0",Edge.label&&(lx=from.x);break;case"-|-":d="m "+from.x+","+from.y+" "+dx/2+",0 0,"+dy+" "+dx/2+",0";break;case"->":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none";break;case"~>":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+.3*dx+", "+dy+" "+dx+", "+dy;break;case"-~>":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.75*(to.x-from.x));break;case"~->":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c 0, 0 "+.3*dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.25*(to.x-from.x));break;case"-|>":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" "+dx+",0 0,"+dy,Edge.label&&(lx=to.x);break;case"|->":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" 0,"+dy+" "+dx+",0",Edge.label&&(lx=from.x);break;case"-|->":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" "+dx/2+",0 0,"+dy+" "+dx/2+",0";break;case"<->":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none";break;case"<~>":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+.3*dx+", "+dy+" "+dx+", "+dy;break;case"<-~>":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.75*(to.x-from.x));break;case"<-|>":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" "+dx+",0 0,"+dy,Edge.label&&(lx=to.x);break;case"<-|->":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" "+dx/2+",0 0,"+dy+" "+dx/2+",0";break;default:style="fill:none;stroke:#F00;stroke-width:1"}return{lx:lx,ly:ly,d:d,style:style}}},{}],3:[function(require,module,exports){module.exports={chars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,47,74,74,118,89,25,44,44,52,78,37,44,37,37,74,74,74,74,74,74,74,74,74,74,37,37,78,78,78,74,135,89,89,96,96,89,81,103,96,37,67,89,74,109,96,103,89,103,96,89,81,96,89,127,89,87,81,37,37,37,61,74,44,74,74,67,74,74,37,74,74,30,30,67,30,112,74,74,74,74,44,67,37,74,67,95,66,65,67,44,34,44,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,43,74,74,74,74,34,74,44,98,49,74,78,0,98,73,53,73,44,44,44,77,71,37,44,44,49,74,111,111,111,81,89,89,89,89,89,89,133,96,89,89,89,89,37,37,37,37,96,96,103,103,103,103,103,78,103,96,96,96,96,87,89,81,74,74,74,74,74,74,118,67,74,74,74,74,36,36,36,36,74,74,74,74,74,74,74,73,81,74,74,74,74,65,74,65,89,74,89,74,89,74,96,67,96,67,96,67,96,67,96,82,96,74,89,74,89,74,89,74,89,74,89,74,103,74,103,74,103,74,103,74,96,74,96,74,37,36,37,36,37,36,37,30,37,36,98,59,67,30,89,67,67,74,30,74,30,74,39,74,44,74,30,96,74,96,74,96,74,80,96,74,103,74,103,74,103,74,133,126,96,44,96,44,96,44,89,67,89,67,89,67,89,67,81,38,81,50,81,37,96,74,96,74,96,74,96,74,96,74,96,74,127,95,87,65,87,81,67,81,67,81,67,30,84,97,91,84,91,84,94,92,73,104,109,91,84,81,84,100,82,76,74,103,91,131,47,40,99,77,37,79,130,100,84,104,114,87,126,101,87,84,93,84,69,84,46,52,82,52,82,114,89,102,96,100,98,91,70,88,88,77,70,85,89,77,67,84,39,65,61,39,189,173,153,111,105,61,123,123,106,89,74,37,30,103,74,96,74,96,74,96,74,96,74,96,74,81,91,81,91,81,130,131,102,84,103,84,87,78,104,81,104,81,88,76,37,189,173,153,103,84,148,90,100,84,89,74,133,118,103,81],other:114}},{}],4:[function(require,module,exports){"use strict";var onmlStringify=require("onml/lib/stringify.js"),w3=require("./w3.js");module.exports=function(arr){arr[1].xmlns=w3.svg,arr[1]["xmlns:xlink"]=w3.xlink;var s1=onmlStringify(arr);return(new DOMParser).parseFromString(s1,"image/svg+xml").firstChild}},{"./w3.js":32,"onml/lib/stringify.js":41}],5:[function(require,module,exports){"use strict";var eva=require("./eva.js"),renderWaveForm=require("./render-wave-form.js");module.exports=function(){renderWaveForm(0,eva("InputJSON_0"),"WaveDrom_Display_")}},{"./eva.js":6,"./render-wave-form.js":29}],6:[function(require,module,exports){"use strict";function eva(id){var TheTextBox,source;function erra(e){return{signal:[{name:["tspan",["tspan",{class:"error h5"},"Error: "],e.message]}]}}if(TheTextBox=document.getElementById(id),TheTextBox.type&&"textarea"===TheTextBox.type)try{source=eval("("+TheTextBox.value+")")}catch(e){return erra(e)}else try{source=eval("("+TheTextBox.innerHTML+")")}catch(e){return erra(e)}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){if("[object Array]"!==Object.prototype.toString.call(source.assign))return erra({message:'[Semantic]: "assign" object hasto be an Array "assign:[]"'})}else if(!source.reg)return erra({message:'[Semantic]: "signal:[...]" or "assign:[...]" property is missing inside the root Object'});return source}module.exports=eva},{}],7:[function(require,module,exports){"use strict";module.exports=function(lanetext){var gcount=0,lcount=0,ret=[];return lanetext.forEach((function(e){"vvv-2"===e||"vvv-3"===e||"vvv-4"===e||"vvv-5"===e||"vvv-6"===e||"vvv-7"===e||"vvv-8"===e||"vvv-9"===e?lcount+=1:0!==lcount&&(ret.push(gcount-(lcount+1)/2),lcount=0),gcount+=1})),0!==lcount&&ret.push(gcount-(lcount+1)/2),ret}},{}],8:[function(require,module,exports){"use strict";module.exports=function(texts,extra,times){var i,j,R=[];if(4===texts.length){for(j=0;j0?Math.round(x):1))>0&&(hscale>100&&(hscale=100),lane.hscale=hscale),lane.yh0=0,lane.yh1=0,lane.head=source.head,lane.xmin_cfg=0,lane.xmax_cfg=1e12,source&&source.config&&source.config.hbounds&&2==source.config.hbounds.length&&(source.config.hbounds[0]=Math.floor(source.config.hbounds[0]),source.config.hbounds[1]=Math.ceil(source.config.hbounds[1]),source.config.hbounds[0]"===Next&&(subCycle=!1,Next=Stack.shift()),Repeats=1;"."===Stack[0]||"|"===Stack[0];)Stack.shift(),Repeats+=1;R=subCycle?R.concat(genWaveBrick(Top+Next,0,Repeats-lane.period)):R.concat(genWaveBrick(Top+Next,extra,Repeats))}for(i=0;i0?(num_unseen_markers=findLaneMarkers(unseen_bricks).length,1==findLaneMarkers([unseen_bricks[unseen_bricks.length-1]]).length&&1==findLaneMarkers([R[0]]).length&&(num_unseen_markers-=1)):num_unseen_markers=0,[R,num_unseen_markers]}},{"./find-lane-markers.js":7,"./gen-first-wave-brick.js":9,"./gen-wave-brick.js":10}],15:[function(require,module,exports){"use strict";var parseWaveLane=require("./parse-wave-lane.js");module.exports=function(sig,lane){var content=[],tmp0=[];return sig.map((function(sigx){var parsed_wave_lane,num_unseen_markers,content_wave=null,current=[];content.push(current),lane.period=sigx.period||1,lane.phase=(sigx.phase?2*sigx.phase:0)+lane.xmin_cfg,tmp0[0]=sigx.name||" ",tmp0[1]=(sigx.phase||0)+lane.xmin_cfg/2,sigx.wave&&(content_wave=(parsed_wave_lane=parseWaveLane(sigx.wave,lane.period*lane.hscale-1,lane))[0],num_unseen_markers=parsed_wave_lane[1]),current.push(tmp0.slice(0),content_wave,function(e,num_unseen_markers){var ret_data;return void 0===(ret_data=e.data)?null:("string"==typeof ret_data&&(ret_data=ret_data.trim().split(/\s+/)),ret_data=ret_data.slice(num_unseen_markers))}(sigx,num_unseen_markers),sigx)})),content}},{"./parse-wave-lane.js":14}],16:[function(require,module,exports){"use strict";var eva=require("./eva.js"),appendSaveAsDialog=require("./append-save-as-dialog.js"),renderWaveForm=require("./render-wave-form.js");module.exports=function(){var points,i,index,notFirstSignal,obj,node0;for(index=0,points=document.querySelectorAll("*"),i=0;idiv.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;}'}},{"./append-save-as-dialog.js":1,"./eva.js":6,"./render-wave-form.js":29}],17:[function(require,module,exports){"use strict";module.exports=function rec(tmp,state){var i,name,old={},delta={x:10};for("string"!=typeof tmp[0]&&"number"!=typeof tmp[0]||(name=tmp[0],delta.x=25),state.x+=delta.x,i=0;i0&&(res=res.concat([renderLabel({x:Events[k].x,y:Events[k].y},k+"")]))}))),res}},{"./arc-shape.js":2,"./render-label.js":22}],20:[function(require,module,exports){"use strict";function renderGapUses(text,lane){for(var next,res=[],Stack=(text||"").split(""),pos=0,subCycle=!1;Stack.length;)"<"===(next=Stack.shift())&&(subCycle=!0,next=Stack.shift()),">"===next&&(subCycle=!1,next=Stack.shift()),pos+=subCycle?1:2*lane.period,"|"===next&&res.push(["use",{"xlink:href":"#gap",transform:"translate("+lane.xs*((pos-(subCycle?0:lane.period))*lane.hscale-lane.phase)+")"}]);return res}module.exports=function(source,index,lane){var i,gaps,res=[];if(source)for(i in source)lane.period=source[i].period?source[i].period:1,lane.phase=(source[i].phase?2*source[i].phase:0)+lane.xmin_cfg,gaps=renderGapUses(source[i].wave,lane),res=res.concat([["g",{id:"wavegap_"+i+"_"+index,transform:"translate(0,"+(lane.y0+i*lane.yo)+")"}].concat(gaps)]);return["g",{id:"wavegaps_"+index}].concat(res)}},{}],21:[function(require,module,exports){"use strict";var tspan=require("tspan");module.exports=function(groups,index,lane){var x,y,ts,res=["g"];return groups.forEach((function(e,i){res.push(["path",{id:"group_"+i+"_"+index,d:"m "+(e.x+.5)+","+(e.y*lane.yo+3.5+lane.yh0+lane.yh1)+" c -3,0 -5,2 -5,5 l 0,"+(e.height*lane.yo-16)+" c 0,3 2,5 5,5",style:"stroke:#0041c4;stroke-width:1;fill:none"}]),void 0!==e.name&&(x=e.x-10,y=lane.yo*(e.y+e.height/2)+lane.yh0+lane.yh1,(ts=tspan.parse(e.name)).unshift("text",{"text-anchor":"middle",class:"info","xml:space":"preserve"}),res.push(["g",{transform:"translate("+x+","+y+")"},["g",{transform:"rotate(270)"},ts]]))})),res}},{tspan:42}],22:[function(require,module,exports){"use strict";var tspan=require("tspan"),textWidth=require("./text-width.js");module.exports=function(p,text){var w=textWidth(text,8)+2;return["g",{transform:"translate("+p.x+","+p.y+")"},["rect",{x:-(w>>1),y:-5,width:w,height:10,style:"fill:#FFF;"}],["text",{"text-anchor":"middle",y:3,style:"font-size:8px;"}].concat(tspan.parse(text))]}},{"./text-width.js":31,tspan:42}],23:[function(require,module,exports){"use strict";var renderMarks=require("./render-marks.js"),renderArcs=require("./render-arcs.js"),renderGaps=require("./render-gaps.js");module.exports=function(index,content,waveLanes,ret,source,lane){return[renderMarks(content,index,lane,source)].concat(waveLanes.res).concat([renderArcs(ret.lanes,index,source,lane)]).concat([renderGaps(ret.lanes,index,lane)])}},{"./render-arcs.js":19,"./render-gaps.js":20,"./render-marks.js":24}],24:[function(require,module,exports){"use strict";var tspan=require("tspan");function captext(cxt,anchor,y){return cxt[anchor]&&cxt[anchor].text?[["text",{x:cxt.xmax*cxt.xs/2,y:y,fill:"#000","text-anchor":"middle","xml:space":"preserve"}].concat(tspan.parse(cxt[anchor].text))]:[]}function ticktock(cxt,ref1,ref2,x,dx,y,len){var offset,val,tmp,i,step=1,dp=0,L=[];if(void 0===cxt[ref1]||void 0===cxt[ref1][ref2])return[];if("string"==typeof(val=cxt[ref1][ref2]))val=val.trim().split(/\s+/);else if("number"==typeof val||"boolean"==typeof val)for(offset=Number(val),val=[],i=0;i0?Math.ceil(2*xoffset)-2*xoffset:-2*xoffset,res.push(["g",{id:"wavelane_"+j+"_"+index,transform:"translate(0,"+(lane.y0+j*lane.yo)+")"}].concat([["text",{x:lane.tgo,y:lane.ym,class:"info","text-anchor":"end","xml:space":"preserve"}].concat(tspan.parse(name))]).concat([["g",{id:"wavelane_draw_"+j+"_"+index,transform:"translate("+xoffset*lane.xs+", 0)"}].concat(renderLaneUses(el,lane))]).concat(renderOverUnder(el[3],"over",lane),renderOverUnder(el[3],"under",lane))),xmax=Math.max(xmax,(el[1]||[]).length),glengths.push(textWidth(name,11))}})),lane.xmax=Math.min(xmax,lane.xmax_cfg-lane.xmin_cfg),lane.xg=20,{glengths:glengths,res:res}}},{"./find-lane-markers.js":7,"./render-over-under.js":25,"./text-width.js":31,tspan:42}],31:[function(require,module,exports){"use strict";var charWidth=require("./char-width.json");module.exports=function(str,size){var i,len,c,w,width;for(size=size||11,len=str.length,width=0,i=0;iObject.assign({transform:"translate("+x+(y?","+y:"")+")"},"object"==typeof obj?obj:{}),colors={2:0,3:80,4:170,5:45,6:126,7:215},norm=(obj,other)=>Object.assign(Object.keys(obj).reduce((prev,key)=>{const val=Number(obj[key]),valInt=isNaN(val)?0:Math.round(val);return 0!==valInt&&(prev[key]=valInt),prev},{}),other),text=(body,x,y,rotate)=>{const props={y:6};return void 0!==rotate&&(props.transform="rotate("+rotate+")"),["g",tt(round(x),round(y)),["text",props].concat(tspan.parse(body))]},hline=(len,x,y)=>["line",norm({x1:x,x2:x+len,y1:y,y2:y})],vline=(len,x,y)=>["line",norm({x1:x,x2:x,y1:y,y2:y+len})],getLabel=(val,x,y,step,len,rotate)=>{if("number"!=typeof val)return text(val,x,y,rotate);const res=["g",{}];for(let i=0;i>i&1,x+step*(len/2-i-.5),y));return res},labelArr=(desc,opt)=>{const{margin:margin,hspace:hspace,vspace:vspace,mod:mod,index:index,fontsize:fontsize,vflip:vflip,compact:compact}=opt,width=hspace-margin.left-margin.right-1,height=vspace-margin.top-margin.bottom,step=width/mod,blanks=["g"],bits=["g",tt(round(step/2),-round(.65*fontsize))],names=["g",tt(round(step/2),round(.5*height))],attrs=["g",tt(round(step/2),round(height+.5*fontsize))];return desc.map(e=>{let lsbm=0,msbm=mod-1,lsb=index*mod,msb=(index+1)*mod-1;if(e.lsb/mod>>0===index)lsbm=e.lsbm,lsb=e.lsb,e.msb/mod>>0===index&&(msb=e.msb,msbm=e.msbm);else if(e.msb/mod>>0===index)msb=e.msb,msbm=e.msbm;else if(!(lsb>e.lsb&&msb{const x=opt.vflip?step*((msbm+lsbm)/2):step*(opt.mod-(msbm+lsbm)/2-1);return Array.isArray(e.attr)?e.attr.reduce((prev,a,i)=>null==a?prev:prev.concat([getLabel(a,x,opt.fontsize*i,step,e.bits)]),["g",{}]):getLabel(e.attr,x,0,step,e.bits)})(e,opt,step,lsbm,msbm))}),["g",blanks,bits,names,attrs]},cage=(desc,opt)=>{const{hspace:hspace,vspace:vspace,mod:mod,margin:margin,index:index,vflip:vflip}=opt,width=hspace-margin.left-margin.right-1,height=vspace-margin.top-margin.bottom,res=["g",{stroke:"black","stroke-width":1,"stroke-linecap":"round"},hline(width,0,0),vline(height,vflip?width:0,0),hline(width,0,height)];let i=index*mod;const delta=vflip?1:-1;let j=vflip?0:mod;for(let k=0;ke.lsb===i)?res.push(vline(height,xj,0)):(res.push(vline(height>>>3,xj,0)),res.push(vline(-(height>>>3),xj,height))),i++,j+=delta}return res},lane=(desc,opt)=>{const{index:index,vspace:vspace,margin:margin,fontsize:fontsize,hflip:hflip,lanes:lanes,compact:compact}=opt,height=vspace-margin.top-margin.bottom;let tx=margin.left;const idx=hflip?index:lanes-index-1;let ty=round(idx*vspace+margin.top);compact&&(ty=round(idx*height+margin.top));const res=["g",tt(tx,ty),cage(desc,opt),labelArr(desc,opt)];return compact&&res.push(["g",{"text-anchor":"end"},text(index,-4,round(height/2+fontsize/3))]),res};module.exports=(desc,opt)=>{[["hspace",40,800],["lanes",1,1],["bits",1,32],["fontsize",6,14]].map((opt=>row=>{const[key,min,def]=row,val=Math.round(opt[key]);opt[key]="number"==typeof val&&val>=min?val:def})(opt="object"==typeof opt?opt:{}));const maxAttributes=(desc=>desc.reduce((prev,field)=>Math.max(prev,void 0===field.attr?0:Array.isArray(field.attr)?field.attr.length:1),0))(desc);opt.vspace=opt.vspace||(maxAttributes+3)*opt.fontsize,opt.fontfamily=opt.fontfamily||"sans-serif",opt.fontweight=opt.fontweight||"normal",opt.compact=opt.compact||!1,opt.hflip=opt.hflip||!1,opt.margin=opt.margin||{};const{hspace:hspace,vspace:vspace,lanes:lanes,margin:margin,compact:compact,fontsize:fontsize,bits:bits}=opt;void 0===margin.right&&(margin.right=4),void 0===margin.left&&(margin.left=compact?32:margin.right),void 0===margin.top?(margin.top=fontsize,void 0===margin.bottom&&(margin.bottom=fontsize*maxAttributes+2)):void 0===margin.bottom&&(margin.bottom=margin.top);let width=hspace,height=vspace*lanes;compact&&(height-=(lanes-1)*(margin.top+margin.bottom));const res=["g",tt(.5,.5,{"text-anchor":"middle","font-size":opt.fontsize,"font-family":opt.fontfamily,"font-weight":opt.fontweight})];let lsb=0;const mod=bits/lanes;opt.mod=0|mod,desc.map(e=>{e.lsb=lsb,e.lsbm=lsb%mod,lsb+=e.bits,e.msb=lsb-1,e.msbm=e.msb%mod});for(let i=0;i{const{hspace:hspace,margin:margin,mod:mod,fontsize:fontsize,vflip:vflip}=opt,step=(hspace-margin.left-margin.right-1)/mod,labels=["g",tt(margin.left,-3)];for(let i=0;i0&&(cr="\n",indent=function(indentation){var space=" ".repeat(indentation);return function(txt){var arr,res=[];return"string"!=typeof txt?txt:1===(arr=txt.split("\n")).length?space+txt:(arr.forEach((function(e){""!==e.trim()?res.push(space+e):res.push(e)})),res.join("\n"))}}(indentation)),function rec(a){var res,body,isFlat;return body="",isFlat=!0,a.some((function(e,i,arr){if(0===i)return res="<"+e,1===arr.length||void 0;if(1===i){if((o=e)&&"[object Object]"===Object.prototype.toString.call(o))return Object.keys(e).forEach((function(key){res+=" "+key+'="'+e[key]+'"'})),2===arr.length||void(res+=">");res+=">"}var o;switch(typeof e){case"string":case"number":case"boolean":case"undefined":return void(body+=e+cr)}isFlat=!1,body+=rec(e)}))?res+"/>"+cr:isFlat?res+function(txt){var arr=txt.split("\n"),res=[];return arr.forEach((function(e){""!==e.trim()&&res.push(e)})),res.join("\n")}(body)+""+cr:res+cr+indent(body)+""+cr}(a)}},{}],42:[function(require,module,exports){"use strict";var parse=require("./parse"),reparse=require("./reparse");exports.parse=parse,exports.reparse=reparse},{"./parse":43,"./reparse":44}],43:[function(require,module,exports){"use strict";var escapeMap={"&":"&",'"':""","<":"<",">":">"};function xscape(val){return"string"!=typeof val?val:val.replace(/([&"<>])/g,(function(_,e){return escapeMap[e]}))}var token=/||||||||<\/o>|<\/ins>|<\/s>|<\/sub>|<\/sup>|<\/b>|<\/i>|<\/tt>/;function update(s,cmd){cmd.add&&cmd.add.split(";").forEach((function(e){var arr=e.split(" ");s[arr[0]][arr[1]]=!0})),cmd.del&&cmd.del.split(";").forEach((function(e){var arr=e.split(" ");delete s[arr[0]][arr[1]]}))}var trans={"":{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"}};function dump(s){return Object.keys(s).reduce((function(pre,cur){var keys=Object.keys(s[cur]);return keys.length>0&&(pre[cur]=keys.join(" ")),pre}),{})}module.exports=function(str){var state,res,i,m,a;if(void 0===str)return[];if("number"==typeof str)return[str+""];if("string"!=typeof str)return[str];for(res=[],state={"text-decoration":{},"font-weight":{},"font-style":{},"baseline-shift":{},"font-size":{},"font-family":{}};;){if(-1===(i=str.search(token)))return res.push(["tspan",dump(state),xscape(str)]),res;if(i>0&&(a=str.slice(0,i),res.push(["tspan",dump(state),xscape(a)])),m=str.match(token)[0],update(state,trans[m]),0===(str=str.slice(i+m.length)).length)return res}}},{}],44:[function(require,module,exports){"use strict";var parse=require("./parse");module.exports=function(React){var $=React.createElement;function reTspan(e,i){var tag=e[0],attr=e[1],newAttr=Object.keys(attr).reduce((function(res,key){var str,m;return res[null===(m=(str=key).match(/(\w+)-(\w)(\w+)/))?str:m[1]+m[2].toUpperCase()+m[3]]=attr[key],res}),{}),body=e[2];return newAttr.key=i,$(tag,newAttr,body)}return function(str){return parse(str).map(reTspan)}}},{"./parse":43}],45:[function(require,module,exports){module.exports={name:"wavedrom",version:"2.6.8",description:"Digital timing diagram in your browser",homepage:"http://wavedrom.com",author:"alex.drom@gmail.com",license:"MIT",repository:{type:"git",url:"https://github.com/wavedrom/wavedrom.git"},bugs:{url:"https://github.com/wavedrom/wavedrom/issues"},main:"./lib",unpkg:"wavedrom.unpkg.min.js",files:["bin/cli.js","wavedrom.js","wavedrom.min.js","wavedrom.unpkg.js","wavedrom.unpkg.min.js","LICENSE","lib/**","skins/**"],scripts:{test:"npm-run-all eslint nyc",eslint:"eslint lib/*.js",nyc:"nyc -r=lcov -r=text mocha test",dist:"browserify ./lib/wave-drom.js > wavedrom.js","dist.min":"terser --compress --mengle -- wavedrom.js | node ./bin/header.js > wavedrom.min.js",unpkg:"browserify --standalone wavedrom lib/index.js > wavedrom.unpkg.js","unpkg.min":"terser --compress --mengle -- wavedrom.unpkg.js | node ./bin/header.js > wavedrom.unpkg.min.js",cli:"{ echo '#!/usr/bin/env node' ; browserify --node bin/cli.js ; } > bin/wavedrom.js ; chmod +x bin/wavedrom.js",prepare:"npm-run-all test dist dist.min unpkg unpkg.min",coverage:"nyc report -r=text-lcov | coveralls",clean:"rm -rf wavedrom.js wavedrom.*.js coverage .nyc_output",skins:"for S in default narrow dark lowkey ; do node bin/svg2js.js -i unpacked/skins/$S.svg > skins/$S.js ; done"},keywords:["waveform","verilog","RTL"],devDependencies:{"@drom/eslint-config":"^0.10.0",browserify:"^16.5.1",chai:"^4.2.0",coveralls:"^3.1.0",eslint:"^6.8.0","fs-extra":"^8.1.0",json5:"^2.1.3",mocha:"^7.1.2","npm-run-all":"^4.1.5",nyc:"^15.0.1",terser:"^4.6.13",yargs:"^15.3.1"},dependencies:{"bit-field":"^1.3.6",logidrom:"^0.2.1",onml:"^1.2.0",tspan:"^0.4.0"},eslintConfig:{extends:"@drom/eslint-config/eslint4/node4",rules:{camelcase:0}}}},{}]},{},[33]);