MCPcopy Index your code
hub / github.com/google/adk-python / te

Function te

src/google/adk/cli/browser/chunk-W7PRDKNL.js:10–10  ·  view source on GitHub ↗
(y,t)

Source from the content-addressed store, hash-verified

8 l${-g},0`,"createCylinderPathD"),Ce=b((y,t,g,o,l,r)=>[`M${y},${t}`,`M${y+g},${t}`,`a${l},${r} 0,0,0 0,${-o}`,`l${-g},0`,`a${l},${r} 0,0,0 0,${o}`,`l${g},0`].join(" "),"createOuterCylinderPathD"),Pe=b((y,t,g,o,l,r)=>[`M${y+g/2},${-o/2}`,`a${l},${r} 0,0,0 0,${o}`].join(" "),"createInnerCylinderPathD");function Fs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,label:f,halfPadding:a}=yield O(y,t,T(t)),c=t.look==="neo"?a*2:a,s=r.height+c,e=s/2,i=e/(2.5+s/50),h=r.width+i+c,{cssStyles:n}=t,p;if(t.look==="handDrawn"){let u=w.svg(l),m=Ce(0,0,h,s,i,e),d=Pe(0,0,h,s,i,e),x=u.path(m,N(t,{})),D=u.path(d,N(t,{fill:"none"}));p=l.insert(()=>D,":first-child"),p=l.insert(()=>x,":first-child"),p.attr("class","basic label-container"),n&&p.attr("style",n)}else{let u=Me(0,0,h,s,i,e);p=l.insert("path",":first-child").attr("d",u).attr("class","basic label-container").attr("style",st(n)).attr("style",o),p.attr("class","basic label-container"),n&&p.selectAll("path").attr("style",n),o&&p.selectAll("path").attr("style",o)}return p.attr("label-offset-x",i),p.attr("transform",`translate(${-h/2}, ${s/2} )`),f.attr("transform",`translate(${-(r.width/2)-i-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),A(t,p),t.intersect=function(u){let m=P.rect(t,u),d=m.y-(t.y??0);if(e!=0&&(Math.abs(d)<(t.height??0)/2||Math.abs(d)==(t.height??0)/2&&Math.abs(m.x-(t.x??0))>(t.width??0)/2-i)){let x=i*i*(1-d*d/(e*e));x!=0&&(x=Math.sqrt(Math.abs(x))),x=i-x,u.x-(t.x??0)>0&&(x=-x),m.x+=x}return m},l})}b(Fs,"tiltedCylinder");function Gs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r}=yield O(y,t,T(t)),f=r.width+t.padding,a=r.height+t.padding,c=[{x:-3*a/6,y:0},{x:f+3*a/6,y:0},{x:f,y:-a},{x:0,y:-a}],s,{cssStyles:e}=t;if(t.look==="handDrawn"){let i=w.svg(l),h=N(t,{}),n=z(c),p=i.path(n,h);s=l.insert(()=>p,":first-child").attr("transform",`translate(${-f/2}, ${a/2})`),e&&s.attr("style",e)}else s=ht(l,f,a,c);return o&&s.attr("style",o),t.width=f,t.height=a,A(t,s),t.intersect=function(i){return P.polygon(t,c,i)},l})}b(Gs,"trapezoid");function zs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r}=yield O(y,t,T(t)),f=60,a=20,c=Math.max(f,r.width+(t.padding??0)*2,t?.width??0),s=Math.max(a,r.height+(t.padding??0)*2,t?.height??0),{cssStyles:e}=t,i=w.svg(l),h=N(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let n=[{x:-c/2*.8,y:-s/2},{x:c/2*.8,y:-s/2},{x:c/2,y:-s/2*.6},{x:c/2,y:s/2},{x:-c/2,y:s/2},{x:-c/2,y:-s/2*.6}],p=z(n),u=i.path(p,h),m=l.insert(()=>u,":first-child");return m.attr("class","basic label-container"),e&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",e),o&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",o),A(t,m),t.intersect=function(d){return P.polygon(t,n,d)},l})}b(zs,"trapezoidalPentagon");function Vs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,label:f}=yield O(y,t,T(t)),a=t.useHtmlLabels||it(U()),c=r.width+(t.padding??0),s=c+r.height,e=c+r.height,i=[{x:0,y:0},{x:e,y:0},{x:e/2,y:-s}],{cssStyles:h}=t,n=w.svg(l),p=N(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let u=z(i),m=n.path(u,p),d=l.insert(()=>m,":first-child").attr("transform",`translate(${-s/2}, ${s/2})`);return h&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",h),o&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",o),t.width=c,t.height=s,A(t,d),f.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${s/2-(r.height+(t.padding??0)/(a?2:1)-(r.y-(r.top??0)))})`),t.intersect=function(x){return Z.info("Triangle intersect",t,i,x),P.polygon(t,i,x)},l})}b(Vs,"triangle");function Zs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,label:f}=yield O(y,t,T(t)),a=Math.max(r.width+(t.padding??0)*2,t?.width??0),c=Math.max(r.height+(t.padding??0)*2,t?.height??0),s=c/8,e=c+s,{cssStyles:i}=t,n=70-a,p=n>0?n/2:0,u=w.svg(l),m=N(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=[{x:-a/2-p,y:e/2},...ft(-a/2-p,e/2,a/2+p,e/2,s,.8),{x:a/2+p,y:-e/2},{x:-a/2-p,y:-e/2}],x=z(d),D=u.path(x,m),S=l.insert(()=>D,":first-child");return S.attr("class","basic label-container"),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),o&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",o),S.attr("transform",`translate(0,${-s/2})`),f.attr("transform",`translate(${-a/2+(t.padding??0)-(r.x-(r.left??0))},${-c/2+(t.padding??0)-s-(r.y-(r.top??0))})`),A(t,S),t.intersect=function($){return P.polygon(t,d,$)},l})}b(Zs,"waveEdgedRectangle");function Js(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r}=yield O(y,t,T(t)),f=100,a=50,c=Math.max(r.width+(t.padding??0)*2,t?.width??0),s=Math.max(r.height+(t.padding??0)*2,t?.height??0),e=c/s,i=c,h=s;i>h*e?h=i/e:i=h*e,i=Math.max(i,f),h=Math.max(h,a);let n=Math.min(h*.2,h/4),p=h+n*2,{cssStyles:u}=t,m=w.svg(l),d=N(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let x=[{x:-i/2,y:p/2},...ft(-i/2,p/2,i/2,p/2,n,1),{x:i/2,y:-p/2},...ft(i/2,-p/2,-i/2,-p/2,n,-1)],D=z(x),S=m.path(D,d),$=l.insert(()=>S,":first-child");return $.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",u),o&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",o),A(t,$),t.intersect=function(v){return P.polygon(t,x,v)},l})}b(Js,"waveRectangle");function Qs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,label:f}=yield O(y,t,T(t)),a=Math.max(r.width+(t.padding??0)*2,t?.width??0),c=Math.max(r.height+(t.padding??0)*2,t?.height??0),s=5,e=-a/2,i=-c/2,{cssStyles:h}=t,n=w.svg(l),p=N(t,{}),u=[{x:e-s,y:i-s},{x:e-s,y:i+c},{x:e+a,y:i+c},{x:e+a,y:i-s}],m=`M${e-s},${i-s} L${e+a},${i-s} L${e+a},${i+c} L${e-s},${i+c} L${e-s},${i-s}
9 M${e-s},${i} L${e+a},${i}
10 M${e},${i-s} L${e},${i+c}`;t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let d=n.path(m,p),x=l.insert(()=>d,":first-child");return x.attr("transform",`translate(${s/2}, ${s/2})`),x.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",h),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),f.attr("transform",`translate(${-(r.width/2)+s/2-(r.x-(r.left??0))}, ${-(r.height/2)+s/2-(r.y-(r.top??0))})`),A(t,x),t.intersect=function(D){return P.polygon(t,u,D)},l})}b(Qs,"windowPane");function Et(y,t){return C(this,null,function*(){let g=t;if(g.alias&&(t.label=g.alias),t.look==="handDrawn"){let{themeVariables:G}=dt(),{background:J}=G,et=rt(tt({},t),{id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${J}`]});yield Et(y,et)}let o=dt();t.useHtmlLabels=o.htmlLabels;let l=o.er?.diagramPadding??10,r=o.er?.entityPadding??6,{cssStyles:f}=t,{labelStyles:a,nodeStyles:c}=R(t);if(g.attributes.length===0&&t.label){let G={rx:0,ry:0,labelPaddingX:l,labelPaddingY:l*1.5,classes:""};wt(t.label,o)+G.labelPaddingX*2<o.er.minEntityWidth&&(t.width=o.er.minEntityWidth);let J=yield Dt(y,t,G);if(!ut(o.htmlLabels)){let et=J.select("text"),at=et.node()?.getBBox();et.attr("transform",`translate(${-at.width/2}, 0)`)}return J}o.htmlLabels||(l*=1.25,r*=1.25);let s=T(t);s||(s="node default");let e=y.insert("g").attr("class",s).attr("id",t.domId||t.id),i=yield mt(e,t.label??"",o,0,0,["name"],a);i.height+=r;let h=0,n=[],p=[],u=0,m=0,d=0,x=0,D=!0,S=!0;for(let G of g.attributes){let J=yield mt(e,G.type,o,0,h,["attribute-type"],a);u=Math.max(u,J.width+l);let et=yield mt(e,G.name,o,0,h,["attribute-name"],a);m=Math.max(m,et.width+l);let at=yield mt(e,G.keys.join(),o,0,h,["attribute-keys"],a);d=Math.max(d,at.width+l);let pt=yield mt(e,G.comment,o,0,h,["attribute-comment"],a);x=Math.max(x,pt.width+l);let gt=Math.max(J.height,et.height,at.height,pt.height)+r;p.push({yOffset:h,rowHeight:gt}),h+=gt}let $=4;d<=l&&(D=!1,d=0,$--),x<=l&&(S=!1,x=0,$--);let v=e.node().getBBox();if(i.width+l*2-(u+m+d+x)>0){let G=i.width+l*2-(u+m+d+x);u+=G/$,m+=G/$,d>0&&(d+=G/$),x>0&&(x+=G/$)}let B=u+m+d+x,k=w.svg(e),M=N(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let I=0;p.length>0&&(I=p.reduce((G,J)=>G+(J?.rowHeight??0),0));let Y=Math.max(v.width+l*2,t?.width||0,B),V=Math.max((I??0)+i.height,t?.height||0),q=-Y/2,W=-V/2;e.selectAll("g:not(:first-child)").each((G,J,et)=>{let at=Q(et[J]),pt=at.attr("transform"),gt=0,Tt=0;if(pt){let Ct=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(pt);Ct&&(gt=parseFloat(Ct[1]),Tt=parseFloat(Ct[2]),at.attr("class").includes("attribute-name")?gt+=u:at.attr("class").includes("attribute-keys")?gt+=u+m:at.attr("class").includes("attribute-comment")&&(gt+=u+m+d))}at.attr("transform",`translate(${q+l/2+gt}, ${Tt+W+i.height+r/2})`)}),e.select(".name").attr("transform","translate("+-i.width/2+", "+(W+r/2)+")");let j=k.rectangle(q,W,Y,V,M),L=e.insert(()=>j,":first-child").attr("style",f.join("")),{themeVariables:F}=dt(),{rowEven:_,rowOdd:H,nodeBorder:X}=F;n.push(0);for(let[G,J]of p.entries()){let at=(G+1)%2===0&&J.yOffset!==0,pt=k.rectangle(q,i.height+W+J?.yOffset,Y,J?.rowHeight,rt(tt({},M),{fill:at?_:H,stroke:X}));e.insert(()=>pt,"g.label").attr("style",f.join("")).attr("class",`row-rect-${at?"even":"odd"}`)}let E=k.line(q,i.height+W,Y+q,i.height+W,M);e.insert(()=>E).attr("class","divider"),E=k.line(u+q,i.height+W,u+q,V+W,M),e.insert(()=>E).attr("class","divider"),D&&(E=k.line(u+m+q,i.height+W,u+m+q,V+W,M),e.insert(()=>E).attr("class","divider")),S&&(E=k.line(u+m+d+q,i.height+W,u+m+d+q,V+W,M),e.insert(()=>E).attr("class","divider"));for(let G of n)E=k.line(q,i.height+W+G,Y+q,i.height+W+G,M),e.insert(()=>E).attr("class","divider");if(A(t,L),c&&t.look!=="handDrawn"){let J=c.split(";")?.filter(et=>et.includes("stroke"))?.map(et=>`${et}`).join("; ");e.selectAll("path").attr("style",J??""),e.selectAll(".row-rect-even path").attr("style",c)}return t.intersect=function(G){return P.rect(t,G)},e})}b(Et,"erBox");function mt(a,c,s){return C(this,arguments,function*(y,t,g,o=0,l=0,r=[],f=""){let e=y.insert("g").attr("class",`label ${r.join(" ")}`).attr("transform",`translate(${o}, ${l})`).attr("style",f);t!==Nt(t)&&(t=Nt(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));let i=e.node().appendChild(yield nt(e,t,{width:wt(t,g)+100,style:f,useHtmlLabels:g.htmlLabels},g));if(t.includes("&lt;")||t.includes("&gt;")){let n=i.children[0];for(n.textContent=n.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");n.childNodes[0];)n=n.childNodes[0],n.textContent=n.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let h=i.getBBox();if(ut(g.htmlLabels)){let n=i.children[0];n.style.textAlign="start";let p=Q(i);h=n.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}return h})}b(mt,"addText");function Us(r,f,a,c){return C(this,arguments,function*(y,t,g,o,l=g.class.padding??12){let s=o?0:3,e=y.insert("g").attr("class",T(t)).attr("id",t.domId||t.id),i=null,h=null,n=null,p=null,u=0,m=0,d=0;if(i=e.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let v=t.annotations[0];yield vt(i,{text:`\xAB${v}\xBB`},0),u=i.node().getBBox().height}h=e.insert("g").attr("class","label-group text"),yield vt(h,t,0,["font-weight: bolder"]);let x=h.node().getBBox();m=x.height,n=e.insert("g").attr("class","members-group text");let D=0;for(let v of t.members){let B=yield vt(n,v,D,[v.parseClassifier()]);D+=B+s}d=n.node().getBBox().height,d<=0&&(d=l/2),p=e.insert("g").attr("class","methods-group text");let S=0;for(let v of t.methods){let B=yield vt(p,v,S,[v.parseClassifier()]);S+=B+s}let $=e.node().getBBox();if(i!==null){let v=i.node().getBBox();i.attr("transform",`translate(${-v.width/2})`)}return h.attr("transform",`translate(${-x.width/2}, ${u})`),$=e.node().getBBox(),n.attr("transform",`translate(0, ${u+m+l*2})`),$=e.node().getBBox(),p.attr("transform",`translate(0, ${u+m+(d?d+l*4:l*2)})`),$=e.node().getBBox(),{shapeSvg:e,bbox:$}})}b(Us,"textHelper");function vt(l,r,f){return C(this,arguments,function*(y,t,g,o=[]){let a=y.insert("g").attr("class","label").attr("style",o.join("; ")),c=dt(),s="useHtmlLabels"in t?t.useHtmlLabels:ut(c.htmlLabels)??!0,e="";"text"in t?e=t.text:e=t.label,!s&&e.startsWith("\\")&&(e=e.substring(1)),_t(e)&&(s=!0);let i=yield nt(a,Rt(bt(e)),{width:wt(e,c)+50,classes:"markdown-node-label",useHtmlLabels:s},c),h,n=1;if(s){let p=i.children[0],u=Q(i);n=p.innerHTML.split("<br>").length,p.innerHTML.includes("</math>")&&(n+=p.innerHTML.split("<mrow>").length-1);let m=p.getElementsByTagName("img");if(m){let d=e.replace(/<img[^>]*>/g,"").trim()==="";yield Promise.all([...m].map(x=>new Promise(D=>{function S(){if(x.style.display="flex",x.style.flexDirection="column",d){let $=c.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,B=parseInt($,10)*5+"px";x.style.minWidth=B,x.style.maxWidth=B}else x.style.width="100%";D(x)}b(S,"setupImage"),setTimeout(()=>{x.complete&&S()}),x.addEventListener("error",S),x.addEventListener("load",S)})))}h=p.getBoundingClientRect(),u.attr("width",h.width),u.attr("height",h.height)}else{o.includes("font-weight: bolder")&&Q(i).selectAll("tspan").attr("font-weight",""),n=i.children.length;let p=i.children[0];(i.textContent===""||i.textContent.includes("&gt"))&&(p.textContent=e[0]+e.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),e[1]===" "&&(p.textContent=p.textContent[0]+" "+p.textContent.substring(1))),p.textContent==="undefined"&&(p.textContent=""),h=i.getBBox()}return a.attr("transform","translate(0,"+(-h.height/(2*n)+g)+")"),h.height})}b(vt,"addText");function Ks(y,t){return C(this,null,function*(){let g=U(),o=g.class.padding??12,l=o,r=t.useHtmlLabels??ut(g.htmlLabels)??!0,f=t;f.annotations=f.annotations??[],f.members=f.members??[],f.methods=f.methods??[];let{shapeSvg:a,bbox:c}=yield Us(y,t,g,r,l),{labelStyles:s,nodeStyles:e}=R(t);t.labelStyle=s,t.cssStyles=f.styles||"";let i=f.styles?.join(";")||e||"";t.cssStyles||(t.cssStyles=i.replaceAll("!important","").split(";"));let h=f.members.length===0&&f.methods.length===0&&!g.class?.hideEmptyMembersBox,n=w.svg(a),p=N(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let u=c.width,m=c.height;f.members.length===0&&f.methods.length===0?m+=l:f.members.length>0&&f.methods.length===0&&(m+=l*2);let d=-u/2,x=-m/2,D=n.rectangle(d-o,x-o-(h?o:f.members.length===0&&f.methods.length===0?-o/2:0),u+2*o,m+2*o+(h?o*2:f.members.length===0&&f.methods.length===0?-o:0),p),S=a.insert(()=>D,":first-child");S.attr("class","basic label-container");let $=S.node().getBBox();a.selectAll(".text").each((M,I,Y)=>{let V=Q(Y[I]),q=V.attr("transform"),W=0;if(q){let _=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(q);_&&(W=parseFloat(_[2]))}let j=W+x+o-(h?o:f.members.length===0&&f.methods.length===0?-o/2:0);r||(j-=4);let L=d;(V.attr("class").includes("label-group")||V.attr("class").includes("annotation-group"))&&(L=-V.node()?.getBBox().width/2||0,a.selectAll("text").each(function(F,_,H){window.getComputedStyle(H[_]).textAnchor==="middle"&&(L=0)})),V.attr("transform",`translate(${L}, ${j})`)});let v=a.select(".annotation-group").node().getBBox().height-(h?o/2:0)||0,B=a.select(".label-group").node().getBBox().height-(h?o/2:0)||0,k=a.select(".members-group").node().getBBox().height-(h?o/2:0)||0;if(f.members.length>0||f.methods.length>0||h){let M=n.line($.x,v+B+x+o,$.x+$.width,v+B+x+o,p);a.insert(()=>M).attr("class","divider").attr("style",i)}if(h||f.members.length>0||f.methods.length>0){let M=n.line($.x,v+B+k+x+l*2+o,$.x+$.width,v+B+k+x+o+l*2,p);a.insert(()=>M).attr("class","divider").attr("style",i)}if(f.look!=="handDrawn"&&a.selectAll("path").attr("style",i),S.select(":nth-child(2)").attr("style",i),a.selectAll(".divider").select("path").attr("style",i),t.labelStyle?a.selectAll("span").attr("style",t.labelStyle):a.selectAll("span").attr("style",i),!r){let M=RegExp(/color\s*:\s*([^;]*)/),I=M.exec(i);if(I){let Y=I[0].replace("color","fill");a.selectAll("tspan").attr("style",Y)}else if(s){let Y=M.exec(s);if(Y){let V=Y[0].replace("color","fill");a.selectAll("tspan").attr("style",V)}}}return A(t,S),t.intersect=function(M){return P.rect(t,M)},a})}b(Ks,"classBox");function te(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let l=t,r=t,f=20,a=20,c="verifyMethod"in t,s=T(t),e=y.insert("g").attr("class",s).attr("id",t.domId??t.id),i;c?i=yield lt(e,`&lt;&lt;${l.type}&gt;&gt;`,0,t.labelStyle):i=yield lt(e,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let h=i,n=yield lt(e,l.name,h,t.labelStyle+"; font-weight: bold;");if(h+=n+a,c){let v=yield lt(e,`${l.requirementId?`ID: ${l.requirementId}`:""}`,h,t.labelStyle);h+=v;let B=yield lt(e,`${l.text?`Text: ${l.text}`:""}`,h,t.labelStyle);h+=B;let k=yield lt(e,`${l.risk?`Risk: ${l.risk}`:""}`,h,t.labelStyle);h+=k,yield lt(e,`${l.verifyMethod?`Verification: ${l.verifyMethod}`:""}`,h,t.labelStyle)}else{let v=yield lt(e,`${r.type?`Type: ${r.type}`:""}`,h,t.labelStyle);h+=v,yield lt(e,`${r.docRef?`Doc Ref: ${r.docRef}`:""}`,h,t.labelStyle)}let p=(e.node()?.getBBox().width??200)+f,u=(e.node()?.getBBox().height??200)+f,m=-p/2,d=-u/2,x=w.svg(e),D=N(t,{});t.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let S=x.rectangle(m,d,p,u,D),$=e.insert(()=>S,":first-child");if($.attr("class","basic label-container").attr("style",o),e.selectAll(".label").each((v,B,k)=>{let M=Q(k[B]),I=M.attr("transform"),Y=0,V=0;if(I){let L=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);L&&(Y=parseFloat(L[1]),V=parseFloat(L[2]))}let q=V-u/2,W=m+f/2;(B===0||B===1)&&(W=Y),M.attr("transform",`translate(${W}, ${q+f})`)}),h>i+n+a){let v=x.line(m,d+i+n+a,m+p,d+i+n+a,D);e.insert(()=>v).attr("style",o)}return A(t,$),t.intersect=function(v){return P.rect(t,v)},e})}b(te,"requirementBox");function lt(y,t,g,o=""){return C(this,null,function*(){if(t==="")return 0;let l=y.insert("g").attr("class","label").attr("style",o),r=U(),f=r.htmlLabels??!0,a=yield nt(l,Rt(bt(t)),{width:wt(t,r)+50,classes:"markdown-node-label",useHtmlLabels:f,style:o},r),c;if(f){let s=a.children[0],e=Q(a);c=s.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}else{let s=a.children[0];for(let e of s.children)e.textContent=e.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),o&&e.setAttribute("style",o);c=a.getBBox(),c.height+=6}return l.attr("transform",`translate(${-c.width/2},${-c.height/2+g})`),c.height})}b(lt,"addText");var Ne=b(y=>{switch(y){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");function se(o,l,r){return C(this,arguments,function*(y,t,{config:g}){let{labelStyles:f,nodeStyles:a}=R(t);t.labelStyle=f||"";let c=10,s=t.width;t.width=(t.width??200)-10;let{shapeSvg:e,bbox:i,label:h}=yield O(y,t,T(t)),n=t.padding||10,p="",u;"ticket"in t&&t.ticket&&g?.kanban?.ticketBaseUrl&&(p=g?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=e.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",p).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},d,x;u?{label:d,bbox:x}=yield Lt(u,"ticket"in t&&t.ticket||"",m):{label:d,bbox:x}=yield Lt(e,"ticket"in t&&t.ticket||"",m);let{label:D,bbox:S}=yield Lt(e,"assigned"in t&&t.assigned||"",m);t.width=s;let $=10,v=t?.width||0,B=Math.max(x.height,S.height)/2,k=Math.max(i.height+$*2,t?.height||0)+B,M=-v/2,I=-k/2;h.attr("transform","translate("+(n-v/2)+", "+(-B-i.height/2)+")"),d.attr("transform","translate("+(n-v/2)+", "+(-B+i.height/2)+")"),D.attr("transform","translate("+(n+v/2-S.width-2*c)+", "+(-B+i.height/2)+")");let Y,{rx:V,ry:q}=t,{cssStyles:W}=t;if(t.look==="handDrawn"){let j=w.svg(e),L=N(t,{}),F=V||q?j.path(yt(M,I,v,k,V||0),L):j.rectangle(M,I,v,k,L);Y=e.insert(()=>F,":first-child"),Y.attr("class","basic label-container").attr("style",W||null)}else{Y=e.insert("rect",":first-child"),Y.attr("class","basic label-container __APA__").attr("style",a).attr("rx",V??5).attr("ry",q??5).attr("x",M).attr("y",I).attr("width",v).attr("height",k);let j="priority"in t&&t.priority;if(j){let L=e.append("line"),F=M+2,_=I+Math.floor((V??0)/2),H=I+k-Math.floor((V??0)/2);L.attr("x1",F).attr("y1",_).attr("x2",F).attr("y2",H).attr("stroke-width","4").attr("stroke",Ne(j))}}return A(t,Y),t.height=k,t.intersect=function(j){return P.rect(t,j)},e})}b(se,"kanbanItem");function ee(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,halfPadding:f,label:a}=yield O(y,t,T(t)),c=r.width+10*f,s=r.height+8*f,e=.15*c,{cssStyles:i}=t,h=r.width+20,n=r.height+20,p=Math.max(c,h),u=Math.max(s,n);a.attr("transform",`translate(${-r.width/2}, ${-r.height/2})`);let m,d=`M0 0
11 a${e},${e} 1 0,0 ${p*.25},${-1*u*.1}
12 a${e},${e} 1 0,0 ${p*.25},0
13 a${e},${e} 1 0,0 ${p*.25},0

Callers

nothing calls this directly

Calls 12

AFunction · 0.90
rectangleMethod · 0.80
rectMethod · 0.80
CFunction · 0.70
RFunction · 0.70
TFunction · 0.70
ltFunction · 0.70
NFunction · 0.70
QFunction · 0.70
insertMethod · 0.45
nodeMethod · 0.45
lineMethod · 0.45

Tested by

no test coverage detected