Buckets:
hf-doc-build/doc / optimum-neuron /v0.4.4 /en /_app /immutable /chunks /diagram-S2PKOQOG.991374da.js
| import{F as B,s as C,g as S,o as D,p as T,b as F,c as P,_ as b,G as m,K as z,v as E,l as w,N as A,k as W}from"./MermaidChart.svelte_svelte_type_style_lang.049405bf.js";import{p as _}from"./chunk-4BX2VUAB.d449a58b.js";import{p as N}from"./mermaid-parser.core.a74d421d.js";var L=B.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=C,this.getAccTitle=S,this.setDiagramTitle=D,this.getDiagramTitle=T,this.getAccDescription=F,this.setAccDescription=P}getConfig(){const t=m({...L,...z().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){E(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{_(e,t);let s=-1,r=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??(a=s+1),a!==s+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${s+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??(i=a+(d??1)-1),d??(d=i-a+1),s=i,w.debug(`Packet block ${a} - ${s} with label ${c}`);r.length<=l+1&&t.getPacket().length<M;){const[p,o]=G({start:a,end:i,bits:d,label:c},n,l);if(r.push(p),p.end+1===n*l&&(t.pushWord(r),r=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}t.pushWord(r)},"populate"),G=b((e,t,s)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];const r=t*s-1,n=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{var r;const t=await N("packet",e),s=(r=x.parser)==null?void 0:r.yy;if(!(s instanceof v))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.");w.debug(t),Y(t,s)},"parse")},I=b((e,t,s,r)=>{const n=r.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=A(t);f.attr("viewbox",`0 0 ${k} ${g}`),W(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())K(f,$,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),K=b((e,t,s,{rowHeight:r,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=s*(r+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),O={draw:I},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:e}={})=>{const t=m(j,e);return` | |
| .packetByte { | |
| font-size: ${t.byteFontSize}; | |
| } | |
| .packetByte.start { | |
| fill: ${t.startByteColor}; | |
| } | |
| .packetByte.end { | |
| fill: ${t.endByteColor}; | |
| } | |
| .packetLabel { | |
| fill: ${t.labelColor}; | |
| font-size: ${t.labelFontSize}; | |
| } | |
| .packetTitle { | |
| fill: ${t.titleColor}; | |
| font-size: ${t.titleFontSize}; | |
| } | |
| .packetBlock { | |
| stroke: ${t.blockStrokeColor}; | |
| stroke-width: ${t.blockStrokeWidth}; | |
| fill: ${t.blockFillColor}; | |
| } | |
| `},"styles"),q={parser:x,get db(){return new v},renderer:O,styles:H};export{q as diagram}; | |
Xet Storage Details
- Size:
- 4.25 kB
- Xet hash:
- 169482900a6517cd5f7d23f0b2b45c655b5a2ba64e46b0ddbab134dcd11fc179
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.