"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[2089],{85054:(t,e,a)=>{a.d(e,{S:()=>i});var r=a(70416);function i(t,e){if(t.accDescr){e.setAccDescription?.(t.accDescr)}if(t.accTitle){e.setAccTitle?.(t.accTitle)}if(t.title){e.setDiagramTitle?.(t.title)}}(0,r.K2)(i,"populateCommonDb")},74470:(t,e,a)=>{a.d(e,{diagram:()=>m});var r=a(29479);var i=a(85054);var n=a(29131);var o=a(42418);var s=a(70416);var l=a(24010);var c=o.UI.packet;var d=class{constructor(){this.packet=[];this.setAccTitle=o.SV;this.getAccTitle=o.iN;this.setDiagramTitle=o.ke;this.getDiagramTitle=o.ab;this.getAccDescription=o.m7;this.setAccDescription=o.EI}static{(0,s.K2)(this,"PacketDB")}getConfig(){const t=(0,n.$t)({...c,...(0,o.zj)().packet});if(t.showBits){t.paddingY+=10}return t}getPacket(){return this.packet}pushWord(t){if(t.length>0){this.packet.push(t)}}clear(){(0,o.IU)();this.packet=[]}};var p=1e4;var b=(0,s.K2)(((t,e)=>{(0,i.S)(t,e);let a=-1;let r=[];let n=1;const{bitsPerRow:o}=e.getConfig();for(let{start:i,end:l,bits:c,label:d}of t.blocks){if(i!==void 0&&l!==void 0&&l<i){throw new Error(`Packet block ${i} - ${l} is invalid. End must be greater than start.`)}i??=a+1;if(i!==a+1){throw new Error(`Packet block ${i} - ${l??i} is not contiguous. It should start from ${a+1}.`)}if(c===0){throw new Error(`Packet block ${i} is invalid. Cannot have a zero bit field.`)}l??=i+(c??1)-1;c??=l-i+1;a=l;s.Rm.debug(`Packet block ${i} - ${a} with label ${d}`);while(r.length<=o+1&&e.getPacket().length<p){const[t,a]=h({start:i,end:l,bits:c,label:d},n,o);r.push(t);if(t.end+1===n*o){e.pushWord(r);r=[];n++}if(!a){break}({start:i,end:l,bits:c,label:d}=a)}}e.pushWord(r)}),"populate");var h=(0,s.K2)(((t,e,a)=>{if(t.start===void 0){throw new Error("start should have been set during first phase")}if(t.end===void 0){throw new Error("end should have been set during first phase")}if(t.start>t.end){throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`)}if(t.end+1<=e*a){return[t,void 0]}const r=e*a-1;const i=e*a;return[{start:t.start,end:r,label:t.label,bits:r-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]}),"getNextFittingBlock");var k={parser:{yy:void 0},parse:(0,s.K2)((async t=>{const e=await(0,l.qg)("packet",t);const a=k.parser?.yy;if(!(a instanceof d)){throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.")}s.Rm.debug(e);b(e,a)}),"parse")};var f=(0,s.K2)(((t,e,a,i)=>{const n=i.db;const s=n.getConfig();const{rowHeight:l,paddingY:c,bitWidth:d,bitsPerRow:p}=s;const b=n.getPacket();const h=n.getDiagramTitle();const k=l+c;const f=k*(b.length+1)-(h?0:l);const u=d*p+2;const w=(0,r.D)(e);w.attr("viewbox",`0 0 ${u} ${f}`);(0,o.a$)(w,f,u,s.useMaxWidth);for(const[r,o]of b.entries()){g(w,o,r,s)}w.append("text").text(h).attr("x",u/2).attr("y",f-k/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")}),"draw");var g=(0,s.K2)(((t,e,a,{rowHeight:r,paddingX:i,paddingY:n,bitWidth:o,bitsPerRow:s,showBits:l})=>{const c=t.append("g");const d=a*(r+n)+n;for(const p of e){const t=p.start%s*o+1;const e=(p.end-p.start+1)*o-i;c.append("rect").attr("x",t).attr("y",d).attr("width",e).attr("height",r).attr("class","packetBlock");c.append("text").attr("x",t+e/2).attr("y",d+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(p.label);if(!l){continue}const a=p.end===p.start;const n=d-2;c.append("text").attr("x",t+(a?e/2:0)).attr("y",n).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",a?"middle":"start").text(p.start);if(!a){c.append("text").attr("x",t+e).attr("y",n).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(p.end)}}}),"drawWord");var u={draw:f};var w={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"};var v=(0,s.K2)((({packet:t}={})=>{const e=(0,n.$t)(w,t);return`\n\t.packetByte {\n\t\tfont-size: ${e.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${e.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${e.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${e.labelColor};\n\t\tfont-size: ${e.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${e.titleColor};\n\t\tfont-size: ${e.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${e.blockStrokeColor};\n\t\tstroke-width: ${e.blockStrokeWidth};\n\t\tfill: ${e.blockFillColor};\n\t}\n\t`}),"styles");var m={parser:k,get db(){return new d},renderer:u,styles:v}}}]);
//# sourceMappingURL=2089.94fb90f086e037882ffb.js.map?v=94fb90f086e037882ffb