You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
36 KiB
JavaScript
1 line
36 KiB
JavaScript
|
9 months ago
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3549],{21390:function(t,e,r){r.d(e,{a:function(){return d},c:function(){return s}});var a=r(51893),n=r(56858),i=r(54525);function l(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}function s(t,e,r){var a;let n=t.append("text"),i=l(n,1,e);o(i,[{content:r,type:"normal"}]);let s=null==(a=i.node())?void 0:a.getBoundingClientRect();return s&&n.remove(),s}function o(t,e){t.text(""),e.forEach((e,r)=>{let a=t.append("tspan").attr("font-style","emphasis"===e.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===e.type?"bold":"normal");0===r?a.text(e.content):a.text(" "+e.content)})}let d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",{style:r="",isTitle:s=!1,classes:d="",useHtmlLabels:c=!0,isNode:h=!0,width:p=200,addSvgBackground:g=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(a.l.info("createText",e,r,s,d,c,h,g),!c)return function(t,e,r){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=e.append("g"),i=n.insert("rect").attr("class","background"),s=n.append("text").attr("y","-10.1"),d=0;for(let e of r){let r=e=>(function(t,e,r){let a=t.append("text"),n=l(a,1,1.1);o(n,r);let i=n.node().getComputedTextLength();return a.remove(),i})(n,0,e)<=t;for(let t of r(e)?[e]:function(t,e){if(t.some(t=>{let{content:e}=t;return e.includes("\n")}))throw Error("splitLineToFitWidth does not support newlines in the line");return function t(e,r){var a,n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(0===e.length)return l.length>0&&i.push(l),i.length>0?i:[];let s="";" "===e[0].content&&(s=" ",e.shift());let o=null!==(a=e.shift())&&void 0!==a?a:{content:" ",type:"normal"},d=[...l];if(""!==s&&d.push({content:s,type:"normal"}),d.push(o),r(d))return t(e,r,i,d);if(l.length>0)i.push(l),e.unshift(o);else if(o.content){let[t,a]=function t(e,r,a,n){if(0===a.length)return[{content:r.join(""),type:n},{content:"",type:n}];let[i,...l]=a,s=[...r,i];return e([{content:s.join(""),type:n}])?t(e,s,l,n):(0===r.length&&i&&(r.push(i),a.shift()),[{content:r.join(""),type:n},{content:a.join(""),type:n}])}(r,[],(n=o.content,Intl.Segmenter?[...new Intl.Segmenter().segment(n)].map(t=>t.segment):[...n]),o.type);i.push([t]),a.content&&e.unshift(a)}return t(e,r,i)}(t,e)}(e,r))o(l(s,d,1.1),t),d++}if(!a)return s.node();{let t=s.node().getBBox();return i.attr("x",-2).attr("y",-2).attr("width",t.width+4).attr("height",t.height+4),n.node()}}(p,t,function(t){let e=function(t){let e=t.replace(/\n{2,}/g,"\n");return(0,i.Z)(e)}(t),{children:r}=(0,n.V)(e),a=[[]],l=0;return r.forEach(t=>{"paragraph"===t.type&&t.children.forEach(t=>{!function t(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";"text"===e.type?e.value.split("\n").forEach((t,e)=>{0!==e&&(l++,a.push([])),t.split(" ").forEach(t=>{t&&a[l].push({content:t,type:r})})}):("strong"===e.type||"emphasis"===e.type)&&e.children.forEach(r=>{t(r,e.type)})}(t)})}),a}(e),g);{let i=function(t){let{children:e}=(0,n.V)(t);return e.map(function t(e){return"text"===e.type?e.value.replace(/\n/g,"<br/>"):"strong"===e.type?"<strong>".concat(e.children.map(t).join(""),"</strong>"):"emphasis"===e.type?"<em>".concat(e.children.map(t).join(""),"</em>"):"paragraph"===e.type?"<p>".concat(e.children.map(t).join(""),"</p>"):"Unsupported markdown: ".concat(e.type)}).join("")}(e);return function(t,e,r,a){var n;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=t.append("foreignObject"),s=l.append("xhtml:div"),o=e.label,d=e.isNode?"nodeLabel":"edgeLabel";s.html('\n <span class="'.concat(d," ").concat(a,'" ')+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+o+"</span>"),(n=e.labelStyle)&&s.attr("style",n),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("max-width",r+"px"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&s.attr("class","labelBkg");let c=s.node().getBoundingClientRect();retur
|