@ucap-llm/ai-ui 1.2.0-beta → 1.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/{_basePickBy-B_kocBSO.mjs → _basePickBy-CJPOXTUJ.mjs} +2 -2
  2. package/ai-ui.es.js +1 -1
  3. package/ai-ui.umd.js +3 -3
  4. package/{arc-CeSXch7x.mjs → arc-DHp8dZR2.mjs} +1 -1
  5. package/{architecture-4AB2E3PP-CJ-3PEyJ.mjs → architecture-4AB2E3PP-DIzWvIs0.mjs} +1 -1
  6. package/{architectureDiagram-IEHRJDOE-DQqmIYoK.mjs → architectureDiagram-IEHRJDOE-CGVZ12rI.mjs} +4 -4
  7. package/{blockDiagram-JOT3LUYC-BUyYlLUo.mjs → blockDiagram-JOT3LUYC-B4nysI6t.mjs} +4 -4
  8. package/{c4Diagram-VJAJSXHY-n6OxREqX.mjs → c4Diagram-VJAJSXHY-yH-TUtpK.mjs} +2 -2
  9. package/{channel-DLHWfhRv.mjs → channel-DR2YZxUc.mjs} +1 -1
  10. package/{chunk-4BMEZGHF-uzgZ2L_n.mjs → chunk-4BMEZGHF-QHCkbkxt.mjs} +1 -1
  11. package/{chunk-A2AXSNBT-ztfHhjDV.mjs → chunk-A2AXSNBT-Dz5kIAS8.mjs} +2 -2
  12. package/{chunk-AEK57VVT-BRd9MdOV.mjs → chunk-AEK57VVT-CAjmfb6I.mjs} +2 -2
  13. package/{chunk-D6G4REZN-D1yLjpUx.mjs → chunk-D6G4REZN-1n5GhPIw.mjs} +1 -1
  14. package/{chunk-RZ5BOZE2-xdRKS4sX.mjs → chunk-RZ5BOZE2-BZHe7l6F.mjs} +1 -1
  15. package/{chunk-XZIHB7SX-CybnO1Hd.mjs → chunk-XZIHB7SX-B5Ijj4qi.mjs} +1 -1
  16. package/{classDiagram-GIVACNV2-kjDgUhUC.mjs → classDiagram-GIVACNV2-DQKRMa90.mjs} +2 -2
  17. package/{classDiagram-v2-COTLJTTW-kjDgUhUC.mjs → classDiagram-v2-COTLJTTW-DQKRMa90.mjs} +2 -2
  18. package/{clone-KFWgjcn5.mjs → clone-fvQ93sYM.mjs} +1 -1
  19. package/{dagre-OKDRZEBW-Botk173z.mjs → dagre-OKDRZEBW-DSWBX1Ve.mjs} +6 -6
  20. package/{diagram-SSKATNLV-MsvcMBUY.mjs → diagram-SSKATNLV-BaQ9v2nS.mjs} +3 -3
  21. package/{diagram-VNBRO52H-BbiY8YLZ.mjs → diagram-VNBRO52H-DHU_iuRJ.mjs} +3 -3
  22. package/{erDiagram-Q7BY3M3F-CJrQJqhq.mjs → erDiagram-Q7BY3M3F-BlcDDBQ3.mjs} +3 -3
  23. package/{flowDiagram-4HSFHLVR-Dvfo18Sv.mjs → flowDiagram-4HSFHLVR-55Tth8sr.mjs} +3 -3
  24. package/{ganttDiagram-APWFNJXF-C9eQEGsW.mjs → ganttDiagram-APWFNJXF-2SX-yOmZ.mjs} +2 -2
  25. package/{gitGraph-O2Q2CXLX-DG71ELFI.mjs → gitGraph-O2Q2CXLX-BL4cY0Bb.mjs} +1 -1
  26. package/{gitGraphDiagram-7IBYFJ6S-Cv9RZMoU.mjs → gitGraphDiagram-7IBYFJ6S-B8WEr0Ye.mjs} +4 -4
  27. package/{graph-B5acxDmH.mjs → graph-rBJ9WWwQ.mjs} +2 -2
  28. package/{index-DIxA_42a.mjs → index-Cp05Y3Eg.mjs} +31 -31
  29. package/info-4N47QTOZ-DIq82AFF.mjs +5 -0
  30. package/{infoDiagram-PH2N3AL5-Cvd12dXk.mjs → infoDiagram-PH2N3AL5-ZZzHzUm_.mjs} +2 -2
  31. package/{journeyDiagram-U35MCT3I-BmqPAhL5.mjs → journeyDiagram-U35MCT3I-C1_E4XkD.mjs} +3 -3
  32. package/{kanban-definition-NDS4AKOZ-BdoUwXV9.mjs → kanban-definition-NDS4AKOZ-IlwI_jV3.mjs} +1 -1
  33. package/{layout-CZ2FJ6Nz.mjs → layout-D4i57JaQ.mjs} +4 -4
  34. package/{linear-CCwNFipv.mjs → linear-Dg6w2_sG.mjs} +1 -1
  35. package/{mermaid-parser.core-D9-47Nfi.mjs → mermaid-parser.core-lHmBsMbr.mjs} +10 -10
  36. package/{mindmap-definition-ALO5MXBD-DiR36Axt.mjs → mindmap-definition-ALO5MXBD-B_Eq-hWr.mjs} +1 -1
  37. package/package.json +1 -1
  38. package/{packet-KVYON367-BKP_TTQ-.mjs → packet-KVYON367-D2sM6HBR.mjs} +1 -1
  39. package/pie-R6RNRRYF-CvqcN47y.mjs +5 -0
  40. package/{pieDiagram-IB7DONF6-Bnc0aob-.mjs → pieDiagram-IB7DONF6-DB2JkQHp.mjs} +4 -4
  41. package/{quadrantDiagram-7GDLP6J5-BMHIM43s.mjs → quadrantDiagram-7GDLP6J5-yI_dnQvv.mjs} +2 -2
  42. package/{radar-MK3ICKWK-CCigSEaJ.mjs → radar-MK3ICKWK-PiV-1NC6.mjs} +1 -1
  43. package/{reduce-DkrcTnRq.mjs → reduce-DnPuHtIq.mjs} +1 -1
  44. package/{requirementDiagram-KVF5MWMF-Cp3NQUib.mjs → requirementDiagram-KVF5MWMF-Ck8jwO6F.mjs} +2 -2
  45. package/{sankeyDiagram-QLVOVGJD-BOQJCx0y.mjs → sankeyDiagram-QLVOVGJD-B--Izyta.mjs} +1 -1
  46. package/{sequenceDiagram-X6HHIX6F-fhNFWCh_.mjs → sequenceDiagram-X6HHIX6F-DuBCRXd3.mjs} +3 -3
  47. package/{stateDiagram-DGXRK772-C0GqDf8j.mjs → stateDiagram-DGXRK772-FytOcOPn.mjs} +4 -4
  48. package/{stateDiagram-v2-YXO3MK2T-D_cJkNdW.mjs → stateDiagram-v2-YXO3MK2T-CnY0WOUo.mjs} +2 -2
  49. package/style.css +1 -1
  50. package/{timeline-definition-BDJGKUSR-DDn6fWth.mjs → timeline-definition-BDJGKUSR-DuFvgtqz.mjs} +2 -2
  51. package/{xychartDiagram-VJFVF3MP-LTpuURWu.mjs → xychartDiagram-VJFVF3MP-BpAVUWho.mjs} +2 -2
  52. package/info-4N47QTOZ-BakaVj1F.mjs +0 -5
  53. package/pie-R6RNRRYF-DEgHZ_DV.mjs +0 -5
@@ -1,5 +1,5 @@
1
- import { d as x, a as b, e as v, g as P, h as p, j as w, k as I, t as N, l as A } from "./reduce-DkrcTnRq.mjs";
2
- import { aM as g, az as E, aN as M, aO as c, aP as F, aQ as l, aE as T, aR as _, aS as $, aT as B, aU as S, aV as y } from "./index-DIxA_42a.mjs";
1
+ import { d as x, a as b, e as v, g as P, h as p, j as w, k as I, t as N, l as A } from "./reduce-DnPuHtIq.mjs";
2
+ import { aM as g, az as E, aN as M, aO as c, aP as F, aQ as l, aE as T, aR as _, aS as $, aT as B, aU as S, aV as y } from "./index-Cp05Y3Eg.mjs";
3
3
  var R = /\s/;
4
4
  function z(n) {
5
5
  for (var r = n.length; r-- && R.test(n.charAt(r)); )
package/ai-ui.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bN as r, bM as t, bQ as b, bP as i, bO as e, bR as o, bS as A, bT as d, bU as h, bK as C, bV as u, bL as c } from "./index-DIxA_42a.mjs";
1
+ import { bN as r, bM as t, bQ as b, bP as i, bO as e, bR as o, bS as A, bT as d, bU as h, bK as C, bV as u, bL as c } from "./index-Cp05Y3Eg.mjs";
2
2
  export {
3
3
  r as AiChat,
4
4
  t as AiChatList,
package/ai-ui.umd.js CHANGED
@@ -781,7 +781,7 @@ function print() { __p += __j.call(arguments, '') }
781
781
  <div>${n}</div>
782
782
  \u4F60\u53EF\u4EE5\u5C1D\u8BD5\u524D\u5F80 Mermaid \u5B98\u7F51\u6765\u6821\u9A8C\u4F60\u7684\u5185\u5BB9, \u6216\u8005\u67E5\u770B<a href='https://mermaid.live/edit' target='_blank'>\u76F8\u5173\u6587\u6863</a>
783
783
  </div>`}).finally(()=>{tH.set(e,{eleid:r,element:document.getElementById(r)})}),`<div class="mermaid-wrap" id="${r}">${r}</div>`}}else{const r=Hne.getLanguage(t)?t:"plaintext";return`<pre><code class="hljs language-${r}">${Hne.highlight(e,{language:r}).value}</code></pre>`}}},extensions:[{name:"no-single-tilde",level:"inline",start(e){var t;return(t=e.match(/~[^~]/))==null?void 0:t.index},tokenizer(e){const t=e.match(/^~([^~]+)~/);if(t)return{type:"text",raw:t[0],text:t[0]}}}]});function Xct(e){const t=[];let r=0;return e=e.replace(/\$\$([\s\S]*?)\$\$/g,n=>{const i=`__PROTECTED_MATH_BLOCK_${r}__`;return t[r]=n,r++,i}),e=e.replace(/\$([^\$\n]+?)\$/g,n=>{const i=`__PROTECTED_INLINE_MATH_${r}__`;return t[r]=n,r++,i}),e=e.replace(/```[\s\S]*?```/g,n=>{const i=`__PROTECTED_CODE_BLOCK_${r}__`;return t[r]=n,r++,i}),e=e.replace(/`([^`]+)`/g,n=>{const i=`__PROTECTED_INLINE_CODE_${r}__`;return t[r]=n,r++,i}),{markdown:e,protectedRegions:t}}function Kct(e,t){let r=e;return t.forEach((n,i)=>{let a="INLINE_CODE";n.includes("$$")?a="MATH_BLOCK":n.includes("$")?a="INLINE_MATH":n.includes("```")&&(a="CODE_BLOCK");const o=`__PROTECTED_${a}_${i}__`;r=r.split(o).join(n)}),r}function Zct(e){return e.replace(/\\n/g,`
784
- `).replace(/\\r/g,"\r").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/ {2,}/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v")}function Jct(e){const{markdown:t,protectedRegions:r}=Xct(e),n=Zct(t);return Kct(n,r)}const e2t=/(?:https?:\/\/|www\.)?[a-zA-Z0-9][-a-zA-Z0-9.]+(?:\.[a-zA-Z]{2,})(?:\/[^\s\)\]\u4e00-\u9fa5]*)?(?:\?[^\s\)\]\u4e00-\u9fa5]*)?(?:#[^\s\)\]\u4e00-\u9fa5]*)?/g;function t2t(e){return e.replace(e2t,t=>` ${t} `)}const r2t=/(\n*)(\$\$)([\s\S]*?)(\$\$)/g;function n2t(e){return e.replace(r2t,(t,r,n,i)=>i.startsWith(`
784
+ `).replace(/\\r/g,"\r").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/ {2,}/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v")}function Jct(e){const{markdown:t,protectedRegions:r}=Xct(e),n=Zct(t);return Kct(n,r)}const e2t=/(?:https?:\/\/|www\.)?[a-zA-Z0-9][-a-zA-Z0-9.]+(?:\.[a-zA-Z]{2,})(?:\/[^\s\)\]\}\u4e00-\u9fa5()"'“”‘’}]*)?(?:\?[^\s\)\]\}\u4e00-\u9fa5()"'“”‘’}]*)?(?:#[^\s\)\]\}\u4e00-\u9fa5()"'“”‘’}]*)?/g;function t2t(e){return e.replace(e2t,t=>` ${t} `)}const r2t=/(\n*)(\$\$)([\s\S]*?)(\$\$)/g;function n2t(e){return e.replace(r2t,(t,r,n,i)=>i.startsWith(`
785
785
  `)&&i.endsWith(`
786
786
  `)&&r.length<2?`
787
787
  `.repeat(2-r.length)+t:t)}const i2t=e=>jct.flow([Jct,t2t,n2t])(e),a2t=HE.parse;HE.parse=function(e,t){const r=i2t(e);return a2t.call(this,r,t)},HE.use(TKe({throwOnError:!1,nonStandard:!0}));function o2t(){return"xxxxx-xxxxx-4xxxx-yxxxx-xxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString()})}function S0e(e,t){if(e){const r=new Date(e),n={"M+":r.getMonth()+1,"d+":r.getDate(),"h+":r.getHours(),"m+":r.getMinutes(),"s+":r.getSeconds(),"q+":Math.floor((r.getMonth()+3)/3),S:r.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(r.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in n)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,RegExp.$1.length===1?n[i]:("00"+n[i]).substr((""+n[i]).length)));return t}else return""}function s2t(e){const t=document.createElement("link");t.type="text/css",t.rel="stylesheet",t.href=e,document.getElementsByTagName("head")[0].appendChild(t)}function l2t(e){return new Promise((t,r)=>{try{const n=document.createElement("script");n.src=e,document.getElementsByTagName("head")[0].appendChild(n),n.onload=()=>{t()}}catch(n){r(n)}})}function c2t(e){e<.1*1024?e=e.toFixed(2)+"B":e<.1*1024*1024?e=(e/1024).toFixed(2)+"KB":e<.1*1024*1024*1024?e=(e/(1024*1024)).toFixed(2)+"MB":e=(e/(1024*1024*1024)).toFixed(2)+"GB";let t=e+"",r=t.indexOf(".");return t.substr(r+1,2)==="00"?t.substring(0,r)+t.substr(r+3,2):e}function u2t(e){return/<\/?[\w\s="/.':;#-\/\[\]@]+>/.test(e)}function C0e(e){return new Promise((t,r)=>{try{const n=e.innerHTML,i=e.innerText;if(navigator.clipboard){const a=new DataTransfer;a.setData("text/plain",i),a.setData("text/html",n),navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([i],{type:"text/plain"}),"text/html":new Blob([n],{type:"text/html"})})]).then(()=>{t()}).catch(o=>{r()})}else{let a=document.createElement("textarea");a.readOnly=!0,a.style.position="absolute",a.style.left="-9999px",a.value=i,document.body.appendChild(a),a.select(),document.execCommand("Copy"),document.body.removeChild(a),t()}}catch{r()}})}function rH(e){return new Promise((t,r)=>{try{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(e).then(()=>{t()}).catch(()=>{r()});else{let n=document.createElement("textarea");n.readOnly=!0,n.style.position="absolute",n.style.left="-9999px",n.value=e,document.body.appendChild(n),n.select(),document.execCommand("Copy"),document.body.removeChild(n),t()}}catch{r()}})}const L0e=HE,d2t=Object.freeze(Object.defineProperty({__proto__:null,bytesToSize:c2t,copy:C0e,copyText:rH,dateFmt:S0e,guid:o2t,isHtmlString:u2t,loadScript:l2t,loadStyle:s2t,marked:L0e},Symbol.toStringTag,{value:"Module"})),h2t={key:0,class:"ai-loading-message"},f2t=ta({__name:"Loading",props:{theme:{type:String,default:"dark"},message:{type:String,default:""}},setup(e){return(t,r)=>(I.openBlock(),I.createElementBlock("div",{class:I.normalizeClass(["ai-loading",{"ai-loading--theme-light":e.theme==="light"}])},[r[0]||(r[0]=I.createElementVNode("div",{class:"ai-loading-icon"},[I.createElementVNode("div",{class:"bounce1"}),I.createElementVNode("div",{class:"bounce2"}),I.createElementVNode("div",{class:"bounce3"})],-1)),e.message?(I.openBlock(),I.createElementBlock("div",h2t,I.toDisplayString(e.message),1)):I.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-59568942"]]);function p2t(...e){return function(...t){let r=e.length?e[0].apply(this,t):t[0];for(let n=1;n<e.length;n++)r=e[n].call(this,r);return r}}function A0e(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}function Ujt(){}const _s=u4(/[A-Za-z]/),qo=u4(/[\dA-Za-z]/),T2t=u4(/[#-'*+\--9=?A-Z^-~]/);function BE(e){return e!==null&&(e<32||e===127)}const nH=u4(/\d/),g2t=u4(/[\dA-Fa-f]/),m2t=u4(/[!-/:-@[-`{-~]/);function _r(e){return e!==null&&e<-2}function oi(e){return e!==null&&(e<0||e===32)}function gn(e){return e===-2||e===-1||e===32}const FE=u4(new RegExp("\\p{P}|\\p{S}","u")),h5=u4(/\s/);function u4(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function v2t(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const g9=function(e){if(e==null)return b2t;if(typeof e=="function")return VE(e);if(typeof e=="object")return Array.isArray(e)?y2t(e):_2t(e);if(typeof e=="string")return Q2t(e);throw new Error("Expected function, string, or object as test")};function y2t(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=g9(e[r]);return VE(n);function n(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function _2t(e){const t=e;return VE(r);function r(n){const i=n;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Q2t(e){return VE(t);function t(r){return r&&r.type===e}}function VE(e){return t;function t(r,n,i){return!!(E2t(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function b2t(){return!0}function E2t(e){return e!==null&&typeof e=="object"&&"type"in e}function Gjt(e){return e}const w0e=[],x2t=!0,iH=!1,aH="skip";function $E(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;const a=g9(i),o=n?-1:1;s(e,void 0,[])();function s(l,u,d){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=w0e,T,g,v;if((!t||a(l,u,d[d.length-1]||void 0))&&(p=S2t(r(l,d)),p[0]===iH))return p;if("children"in l&&l.children){const m=l;if(m.children&&p[0]!==aH)for(g=(n?m.children.length:-1)+o,v=d.concat(m);g>-1&&g<m.children.length;){const y=m.children[g];if(T=s(y,g,v)(),T[0]===iH)return T;g=typeof T[1]=="number"?T[1]:g+o}}return p}}}function S2t(e){return Array.isArray(e)?e:typeof e=="number"?[x2t,e]:e==null?w0e:[e]}function oH(e,t,r){const i=g9((r||{}).ignore||[]),a=C2t(t);let o=-1;for(;++o<a.length;)$E(e,"text",s);function s(u,d){let h=-1,f;for(;++h<d.length;){const p=d[h],T=f?f.children:void 0;if(i(p,T?T.indexOf(p):void 0,f))return;f=p}if(f)return l(u,d)}function l(u,d){const h=d[d.length-1],f=a[o][0],p=a[o][1];let T=0;const v=h.children.indexOf(u);let m=!1,y=[];f.lastIndex=0;let _=f.exec(u.value);for(;_;){const E=_.index,Q={index:_.index,input:_.input,stack:[...d,u]};let b=p(..._,Q);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?f.lastIndex=E+1:(T!==E&&y.push({type:"text",value:u.value.slice(T,E)}),Array.isArray(b)?y.push(...b):b&&y.push(b),T=E+_[0].length,m=!0),!f.global)break;_=f.exec(u.value)}return m?(T<u.value.length&&y.push({type:"text",value:u.value.slice(T)}),h.children.splice(v,1,...y)):y=[u],v+y.length}}function C2t(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let n=-1;for(;++n<r.length;){const i=r[n];t.push([L2t(i[0]),A2t(i[1])])}return t}function L2t(e){return typeof e=="string"?new RegExp(v2t(e),"g"):e}function A2t(e){return typeof e=="function"?e:function(){return e}}const sH="phrasing",lH=["autolink","link","image","label"];function w2t(){return{transforms:[k2t],enter:{literalAutolink:R2t,literalAutolinkEmail:cH,literalAutolinkHttp:cH,literalAutolinkWww:cH},exit:{literalAutolink:D2t,literalAutolinkEmail:I2t,literalAutolinkHttp:N2t,literalAutolinkWww:M2t}}}function O2t(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:sH,notInConstruct:lH},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:sH,notInConstruct:lH},{character:":",before:"[ps]",after:"\\/",inConstruct:sH,notInConstruct:lH}]}}function R2t(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function cH(e){this.config.enter.autolinkProtocol.call(this,e)}function N2t(e){this.config.exit.autolinkProtocol.call(this,e)}function M2t(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function I2t(e){this.config.exit.autolinkEmail.call(this,e)}function D2t(e){this.exit(e)}function k2t(e){oH(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,P2t],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),H2t]],{ignore:["link","linkReference"]})}function P2t(e,t,r,n,i){let a="";if(!O0e(i)||(/^w/i.test(t)&&(r=t+r,t="",a="http://"),!B2t(r)))return!1;const o=F2t(r+n);if(!o[0])return!1;const s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function H2t(e,t,r,n){return!O0e(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function B2t(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function F2t(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],n=r.indexOf(")");const i=A0e(e,"(");let a=A0e(e,")");for(;n!==-1&&i>a;)e+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),a++;return[e,r]}function O0e(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||h5(r)||FE(r))&&(!t||r!==47)}function xc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}R0e.peek=j2t;function V2t(){this.buffer()}function $2t(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function U2t(){this.buffer()}function G2t(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function z2t(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=xc(this.sliceSerialize(e)).toLowerCase(),r.label=t}function q2t(e){this.exit(e)}function Y2t(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=xc(this.sliceSerialize(e)).toLowerCase(),r.label=t}function W2t(e){this.exit(e)}function j2t(){return"["}function R0e(e,t,r,n){const i=r.createTracker(n);let a=i.move("[^");const o=r.enter("footnoteReference"),s=r.enter("reference");return a+=i.move(r.safe(r.associationId(e),{after:"]",before:a})),s(),o(),a+=i.move("]"),a}function X2t(){return{enter:{gfmFootnoteCallString:V2t,gfmFootnoteCall:$2t,gfmFootnoteDefinitionLabelString:U2t,gfmFootnoteDefinition:G2t},exit:{gfmFootnoteCallString:z2t,gfmFootnoteCall:q2t,gfmFootnoteDefinitionLabelString:Y2t,gfmFootnoteDefinition:W2t}}}function K2t(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:R0e},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,a,o){const s=a.createTracker(o);let l=s.move("[^");const u=a.enter("footnoteDefinition"),d=a.enter("label");return l+=s.move(a.safe(a.associationId(n),{before:l,after:"]"})),d(),l+=s.move("]:"),n.children&&n.children.length>0&&(s.shift(4),l+=s.move((t?`
@@ -886,8 +886,8 @@ function print() { __p += __j.call(arguments, '') }
886
886
  `))]))),128)),o[20]||(o[20]=I.createTextVNode(`
887
887
  `))],2),o[23]||(o[23]=I.createTextVNode(`
888
888
  `))])}}},[["__scopeId","data-v-c854dd88"]]);function PB(e){return I.getCurrentScope()?(I.onScopeDispose(e),!0):!1}const E9t=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const x9t=e=>e!=null,S9t=Object.prototype.toString,C9t=e=>S9t.call(e)==="[object Object]",o7=()=>{};function HB(e,t){function r(...n){return new Promise((i,a)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(i).catch(a)})}return r}const L9t=e=>e();function u8e(e,t={}){let r,n,i=o7;const a=l=>{clearTimeout(l),i(),i=o7};let o;return l=>{const u=I.toValue(e),d=I.toValue(t.maxWait);return r&&a(r),u<=0||d!==void 0&&d<=0?(n&&(a(n),n=null),Promise.resolve(l())):new Promise((h,f)=>{i=t.rejectOnCancel?f:h,o=l,d&&!n&&(n=setTimeout(()=>{r&&a(r),n=null,h(o())},d)),r=setTimeout(()=>{n&&a(n),n=null,h(l())},u)})}}function A9t(...e){let t=0,r,n=!0,i=o7,a,o,s,l,u;!I.isRef(e[0])&&typeof e[0]=="object"?{delay:o,trailing:s=!0,leading:l=!0,rejectOnCancel:u=!1}=e[0]:[o,s=!0,l=!0,u=!1]=e;const d=()=>{r&&(clearTimeout(r),r=void 0,i(),i=o7)};return f=>{const p=I.toValue(o),T=Date.now()-t,g=()=>a=f();return d(),p<=0?(t=Date.now(),g()):(T>p&&(l||!n)?(t=Date.now(),g()):s&&(a=new Promise((v,m)=>{i=u?m:v,r=setTimeout(()=>{t=Date.now(),n=!0,v(g()),d()},Math.max(0,p-T))})),!l&&!r&&(r=setTimeout(()=>n=!0,p)),n=!1,a)}}function vx(e){return Array.isArray(e)?e:[e]}function w9t(e){return I.getCurrentInstance()}function O9t(e,t=200,r={}){return HB(u8e(t,r),e)}function R9t(e,t=200,r=!1,n=!0,i=!1){return HB(A9t(t,r,n,i),e)}function N9t(e,t,r={}){const{eventFilter:n=L9t,...i}=r;return I.watch(e,HB(n,t),i)}function M9t(e,t=!0,r){w9t()?I.onMounted(e,r):t?e():I.nextTick(e)}function I9t(e,t,r={}){const{debounce:n=0,maxWait:i=void 0,...a}=r;return N9t(e,t,{...a,eventFilter:u8e(n,{maxWait:i})})}function D9t(e,t,r){return I.watch(e,t,{...r,immediate:!0})}const yx=E9t?window:void 0;function s7(e){var t;const r=I.toValue(e);return(t=r==null?void 0:r.$el)!=null?t:r}function d8e(...e){const t=[],r=()=>{t.forEach(s=>s()),t.length=0},n=(s,l,u,d)=>(s.addEventListener(l,u,d),()=>s.removeEventListener(l,u,d)),i=I.computed(()=>{const s=vx(I.toValue(e[0])).filter(l=>l!=null);return s.every(l=>typeof l!="string")?s:void 0}),a=D9t(()=>{var s,l;return[(l=(s=i.value)==null?void 0:s.map(u=>s7(u)))!=null?l:[yx].filter(u=>u!=null),vx(I.toValue(i.value?e[1]:e[0])),vx(I.unref(i.value?e[2]:e[1])),I.toValue(i.value?e[3]:e[2])]},([s,l,u,d])=>{if(r(),!(s!=null&&s.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const h=C9t(d)?{...d}:d;t.push(...s.flatMap(f=>l.flatMap(p=>u.map(T=>n(f,p,T,h)))))},{flush:"post"}),o=()=>{a(),r()};return PB(r),o}function k9t(){const e=I.shallowRef(!1),t=I.getCurrentInstance();return t&&I.onMounted(()=>{e.value=!0},t),e}function h8e(e){const t=k9t();return I.computed(()=>(t.value,!!e()))}function P9t(e,t,r={}){const{window:n=yx,...i}=r;let a;const o=h8e(()=>n&&"MutationObserver"in n),s=()=>{a&&(a.disconnect(),a=void 0)},l=I.computed(()=>{const f=I.toValue(e),p=vx(f).map(s7).filter(x9t);return new Set(p)}),u=I.watch(()=>l.value,f=>{s(),o.value&&f.size&&(a=new MutationObserver(t),f.forEach(p=>a.observe(p,i)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),h=()=>{u(),s()};return PB(h),{isSupported:o,stop:h,takeRecords:d}}function H9t(e,t,r={}){const{window:n=yx,...i}=r;let a;const o=h8e(()=>n&&"ResizeObserver"in n),s=()=>{a&&(a.disconnect(),a=void 0)},l=I.computed(()=>{const h=I.toValue(e);return Array.isArray(h)?h.map(f=>s7(f)):[s7(h)]}),u=I.watch(l,h=>{if(s(),o.value&&n){a=new ResizeObserver(t);for(const f of h)f&&a.observe(f,i)}},{immediate:!0,flush:"post"}),d=()=>{s(),u()};return PB(d),{isSupported:o,stop:d}}const f8e=1;function B9t(e,t={}){const{throttle:r=0,idle:n=200,onStop:i=o7,onScroll:a=o7,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:l="auto",window:u=yx,onError:d=x=>{console.error(x)}}=t,h=I.shallowRef(0),f=I.shallowRef(0),p=I.computed({get(){return h.value},set(x){g(x,void 0)}}),T=I.computed({get(){return f.value},set(x){g(void 0,x)}});function g(x,S){var C,A,w,N;if(!u)return;const P=I.toValue(e);if(!P)return;(w=P instanceof Document?u.document.body:P)==null||w.scrollTo({top:(C=I.toValue(S))!=null?C:T.value,left:(A=I.toValue(x))!=null?A:p.value,behavior:I.toValue(l)});const R=((N=P==null?void 0:P.document)==null?void 0:N.documentElement)||(P==null?void 0:P.documentElement)||P;p!=null&&(h.value=R.scrollLeft),T!=null&&(f.value=R.scrollTop)}const v=I.shallowRef(!1),m=I.reactive({left:!0,right:!1,top:!0,bottom:!1}),y=I.reactive({left:!1,right:!1,top:!1,bottom:!1}),_=x=>{v.value&&(v.value=!1,y.left=!1,y.right=!1,y.top=!1,y.bottom=!1,i(x))},E=O9t(_,r+n),Q=x=>{var S;if(!u)return;const C=((S=x==null?void 0:x.document)==null?void 0:S.documentElement)||(x==null?void 0:x.documentElement)||s7(x),{display:A,flexDirection:w,direction:N}=getComputedStyle(C),P=N==="rtl"?-1:1,R=C.scrollLeft;y.left=R<h.value,y.right=R>h.value;const M=Math.abs(R*P)<=(o.left||0),H=Math.abs(R*P)+C.clientWidth>=C.scrollWidth-(o.right||0)-f8e;A==="flex"&&w==="row-reverse"?(m.left=H,m.right=M):(m.left=M,m.right=H),h.value=R;let F=C.scrollTop;x===u.document&&!F&&(F=u.document.body.scrollTop),y.top=F<f.value,y.bottom=F>f.value;const k=Math.abs(F)<=(o.top||0),V=Math.abs(F)+C.clientHeight>=C.scrollHeight-(o.bottom||0)-f8e;A==="flex"&&w==="column-reverse"?(m.top=V,m.bottom=k):(m.top=k,m.bottom=V),f.value=F},b=x=>{var S;if(!u)return;const C=(S=x.target.documentElement)!=null?S:x.target;Q(C),v.value=!0,E(x),a(x)};return d8e(e,"scroll",r?R9t(b,r,!0,!1):b,s),M9t(()=>{try{const x=I.toValue(e);if(!x)return;Q(x)}catch(x){d(x)}}),d8e(e,"scrollend",_,s),{x:p,y:T,isScrolling:v,arrivedState:m,directions:y,measure(){const x=I.toValue(e);u&&x&&Q(x)}}}const F9t={class:"mermaid-wrapper"},V9t={class:"mermaid-body"},$9t=["innerHTML"],U9t={key:1,style:{margin:"32px 0"}},G9t=ta({__name:"MermaidParser",props:{code:{type:String,required:!0}},setup(e){const t=e,r=g6.PRESENTED_IMAGE_SIMPLE,n=[{value:1,label:"\u56FE\u8868"},{value:2,label:"\u6E90\u7801"}],i=I.ref(n[0].value),a=I.ref("");I.onMounted(()=>{p9.initialize({startOnLoad:!1,theme:"default",securityLevel:"loose",fontFamily:"arial"})});const o=I.computed(()=>!a.value);I9t(()=>t.code,async b=>{if(b){try{await p9.parse(b)}catch{return}try{const{svg:x}=await p9.render(`mermaid-${Date.now()}`,b);a.value=x}catch{a.value=""}}},{immediate:!0,debounce:50,maxWait:100});const s=async()=>{try{await rH(t.code),na.success("\u590D\u5236\u6210\u529F!")}catch(b){na.error(b)}};function l({key:b}){b==="1"?u():b==="2"?d():b==="3"&&h()}function u(){if(!a.value){na.error("\u6682\u65E0\u53EF\u4E0B\u8F7D\u7684SVG");return}const b=a.value,x=new Blob([b],{type:"image/svg+xml"}),S=URL.createObjectURL(x),C=document.createElement("a");C.href=S;const A=new Date,w=P=>P.toString().padStart(2,"0"),N=`${A.getFullYear()}${w(A.getMonth()+1)}${w(A.getDate())}`;C.download=`${N}-mermaid.svg`,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(S),na.success("\u4E0B\u8F7D\u6210\u529F!")}function d(){if(!a.value){na.error("\u6682\u65E0\u53EF\u4E0B\u8F7D\u7684PNG");return}let b=a.value;b.includes('xmlns="http://www.w3.org/2000/svg"')||(b=b.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let x=800,S=600;const C=b.match(/viewBox="([\d.\s]+)"/);if(C){const M=C[1].split(" ");M.length===4&&(x=parseFloat(M[2]),S=parseFloat(M[3]))}else{const M=b.match(/width="([\d.]+)(px)?"/),H=b.match(/height="([\d.]+)(px)?"/);M&&(x=parseFloat(M[1])),H&&(S=parseFloat(H[1]))}const A=2,w=x*A,N=S*A,P=window.btoa(unescape(encodeURIComponent(b))),R=new Image;R.onload=function(){const M=document.createElement("canvas");M.width=w,M.height=N;const H=M.getContext("2d");H.fillStyle="#fff",H.fillRect(0,0,w,N),H.drawImage(R,0,0,w,N),M.toBlob(function(F){if(!F){na.error("PNG\u751F\u6210\u5931\u8D25\uFF0Ccanvas\u5185\u5BB9\u4E3A\u7A7A");return}const k=document.createElement("a");k.href=URL.createObjectURL(F);const V=new Date,B=z=>z.toString().padStart(2,"0"),$=`${V.getFullYear()}${B(V.getMonth()+1)}${B(V.getDate())}`;k.download=`${$}-mermaid.png`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(k.href),na.success("PNG\u5DF2\u4E0B\u8F7D")},"image/png")},R.onerror=function(){na.error("PNG\u751F\u6210\u5931\u8D25")},R.src=`data:image/svg+xml;base64,${P}`}function h(){if(!t.code){na.error("\u6682\u65E0\u53EF\u4E0B\u8F7D\u7684\u6E90\u7801");return}const b=new Blob([t.code],{type:"text/plain"}),x=URL.createObjectURL(b),S=document.createElement("a");S.href=x;const C=new Date,A=N=>N.toString().padStart(2,"0"),w=`${C.getFullYear()}${A(C.getMonth()+1)}${A(C.getDate())}`;S.download=`${w}-mermaid.txt`,document.body.appendChild(S),S.click(),document.body.removeChild(S),URL.revokeObjectURL(x),na.success("\u6E90\u7801\u5DF2\u4E0B\u8F7D")}const f=I.ref(1),p=I.ref({x:0,y:0}),T=I.ref(!1),g=I.ref({x:0,y:0}),v=I.computed(()=>({transform:`translate(${p.value.x}px, ${p.value.y}px) scale(${f.value})`,"transform-origin":"center top",cursor:T.value?"grabbing":"grab",userSelect:T.value?"none":"auto"}));function m(){f.value<3&&(f.value+=.1)}function y(){f.value>.2&&(f.value-=.1)}function _(b){T.value=!0,g.value={x:b.clientX,y:b.clientY},document.addEventListener("mousemove",E),document.addEventListener("mouseup",Q)}function E(b){if(!T.value)return;const x=b.clientX-g.value.x,S=b.clientY-g.value.y;p.value.x+=x,p.value.y+=S,g.value={x:b.clientX,y:b.clientY}}function Q(){T.value=!1,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",Q)}return(b,x)=>{const S=WGe,C=O2,A=X8,w=eQ,N=RUe,P=Jh,R=z3,M=wu,H=g6;return I.openBlock(),I.createElementBlock("div",F9t,[I.createVNode(Xpe,null,{title:I.withCtx(()=>[I.createVNode(S,{value:i.value,"onUpdate:value":x[0]||(x[0]=F=>i.value=F),options:n},null,8,["value"])]),actions:I.withCtx(()=>[i.value===1?(I.openBlock(),I.createBlock(w,{key:0},{default:I.withCtx(()=>[I.createVNode(A,null,{title:I.withCtx(()=>x[1]||(x[1]=[I.createTextVNode("\u7F29\u5C0F")])),default:I.withCtx(()=>[I.createVNode(C,{type:"text",size:"small",disabled:f.value<=.2||o.value,onClick:y},{default:I.withCtx(()=>[I.createVNode(I.unref(_Q))]),_:1},8,["disabled"])]),_:1}),I.createVNode(A,null,{title:I.withCtx(()=>x[2]||(x[2]=[I.createTextVNode("\u653E\u5927")])),default:I.withCtx(()=>[I.createVNode(C,{type:"text",size:"small",disabled:f.value>=3||o.value,onClick:m},{default:I.withCtx(()=>[I.createVNode(I.unref(yQ))]),_:1},8,["disabled"])]),_:1})]),_:1})):I.createCommentVNode("",!0),i.value===1?(I.openBlock(),I.createBlock(N,{key:1,type:"vertical"})):I.createCommentVNode("",!0),I.createVNode(A,null,{title:I.withCtx(()=>x[3]||(x[3]=[I.createTextVNode("\u590D\u5236")])),default:I.withCtx(()=>[I.createVNode(C,{type:"text",size:"small",onClick:s},{default:I.withCtx(()=>[I.createVNode(I.unref(bQ))]),_:1})]),_:1}),I.createVNode(M,{disabled:o.value},{overlay:I.withCtx(()=>[I.createVNode(R,{onClick:l},{default:I.withCtx(()=>[I.createVNode(P,{key:"1"},{default:I.withCtx(()=>x[4]||(x[4]=[I.createTextVNode(" \u4E0B\u8F7DSVG ")])),_:1,__:[4]}),I.createVNode(P,{key:"2"},{default:I.withCtx(()=>x[5]||(x[5]=[I.createTextVNode(" \u4E0B\u8F7DPNG ")])),_:1,__:[5]}),I.createVNode(P,{key:"3"},{default:I.withCtx(()=>x[6]||(x[6]=[I.createTextVNode(" \u4E0B\u8F7D\u6E90\u7801 ")])),_:1,__:[6]})]),_:1})]),default:I.withCtx(()=>[I.createVNode(C,{type:"text",size:"small"},{default:I.withCtx(()=>[I.createVNode(I.unref(EQ))]),_:1})]),_:1},8,["disabled"])]),_:1}),I.createElementVNode("div",V9t,[i.value===1?(I.openBlock(),I.createElementBlock(I.Fragment,{key:0},[a.value?(I.openBlock(),I.createElementBlock("div",{key:0,innerHTML:a.value,class:"mermaid-content",style:I.normalizeStyle(v.value),onMousedown:_},null,44,$9t)):(I.openBlock(),I.createBlock(H,{key:1,description:"\u6E32\u67D3\u5931\u8D25",image:I.unref(r)},null,8,["image"]))],64)):(I.openBlock(),I.createElementBlock("pre",U9t,[x[7]||(x[7]=I.createTextVNode(" ")),I.createElementVNode("code",null,I.toDisplayString(e.code),1),x[8]||(x[8]=I.createTextVNode(`
889
- `))]))])])}}},[["__scopeId","data-v-285e7110"]]),z9t={__name:"FenceParser",props:{node:{type:Object,default:()=>null}},setup(e){const t=I.ref(""),r=I.ref("");return I.watch(()=>e.node,()=>{e.node&&v9(e.node,n=>{var i,a,o;n.type==="text"?t.value=n.value:n.type==="element"&&n.tagName==="code"&&(r.value=((o=(a=(i=n.properties)==null?void 0:i.className)==null?void 0:a[0])==null?void 0:o.replace("language-",""))||"")})},{immediate:!0}),(n,i)=>r.value==="mermaid"?(I.openBlock(),I.createBlock(G9t,{key:0,code:t.value},null,8,["code"])):(I.openBlock(),I.createBlock(b9t,{key:1,code:t.value,lang:r.value},null,8,["code","lang"]))}},q9t={class:"markdown-body"},Y9t=["href"],_x={__name:"MdParser",props:I.mergeDefaults({content:String},{content:""}),setup(e){function t(d){const h=[];let f=0;return d=d.replace(/\$\$([\s\S]*?)\$\$/g,p=>{const T=`__PROTECTED_MATH_BLOCK_${f}__`;return h[f]=p,f++,T}),d=d.replace(/\$([^\$\n]+?)\$/g,p=>{const T=`__PROTECTED_INLINE_MATH_${f}__`;return h[f]=p,f++,T}),d=d.replace(/```[\s\S]*?```/g,p=>{const T=`__PROTECTED_CODE_BLOCK_${f}__`;return h[f]=p,f++,T}),d=d.replace(/`([^`]+)`/g,p=>{const T=`__PROTECTED_INLINE_CODE_${f}__`;return h[f]=p,f++,T}),{markdown:d,protectedRegions:h}}function r(d,h){let f=d;return h.forEach((p,T)=>{let g="INLINE_CODE";p.includes("$$")?g="MATH_BLOCK":p.includes("$")?g="INLINE_MATH":p.includes("```")&&(g="CODE_BLOCK");const v=`__PROTECTED_${g}_${T}__`;f=f.split(v).join(p)}),f}function n(d){return d.replace(/\\n/g,`
890
- `).replace(/\\r/g,"\r").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v")}function i(d){const{markdown:h,protectedRegions:f}=t(d),p=n(h);return r(p,f)}const a=/(?:https?:\/\/|www\.)?[a-zA-Z0-9][-a-zA-Z0-9.]+(?:\.[a-zA-Z]{2,})(?:\/[^\s\)\]\u4e00-\u9fa5]*)?(?:\?[^\s\)\]\u4e00-\u9fa5]*)?(?:#[^\s\)\]\u4e00-\u9fa5]*)?/g;function o(d){return d.replace(a,h=>` ${h} `)}const s=d=>p2t(i,o)(d),l=I.computed(()=>s(e.content)),u={singleTilde:!1};return(d,h)=>{const f=I6;return I.openBlock(),I.createElementBlock("div",q9t,[I.createVNode(kB,{markdown:l.value,remarkPlugins:[[I.unref(J3t),u],I.unref(p4t),I.unref(r4t),I.unref(f4t)],rehypePlugins:[I.unref(Wdt),I.unref(mht),I.unref(n8t)]},{a:I.withCtx(({node:p})=>{var T;return[I.createElementVNode("a",{href:p.properties.href,target:"_blank",rel:"noopener noreferrer"},I.toDisplayString((T=p.children[0])==null?void 0:T.value),9,Y9t)]}),pre:I.withCtx(({node:p})=>[I.createVNode(z9t,{node:p},null,8,["node"])]),img:I.withCtx(({node:p})=>[I.createVNode(f,{src:p.properties.src,previewMask:!1,style:{cursor:"pointer"}},null,8,["src"])]),_:1},8,["markdown","remarkPlugins","rehypePlugins"])])}}},W9t={key:0,class:"ai-chat-record-avatar"},j9t={class:"ai-chat-record-wrap"},X9t={class:"ai-chat-record-head"},K9t={key:0,class:"ai-chat-record-time"},Z9t={class:"ai-chat-record-body"},J9t={key:0,class:"ai-chat-record-loading-wrap"},egt={key:1,class:"ai-chat-record-content"},tgt={class:"ai-chat-record-content-before"},rgt={class:"ai-chat-record-content-inner"},ngt={class:"ai-chat-record-content-after"},igt={key:0,class:"character-count"},agt={key:0,class:"ai-chat-record-foot"},ogt={class:"foot-actions"},sgt={key:0,class:"copy-tooltip-inner"},lgt={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},p8e=ta(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(e,{expose:t,emit:r}){const n={Loading:"loading",Generating:"generating",Done:"done"},i=e,a=r,o=I.ref(),s=I.ref(!0),l=I.ref(!1),u=I.computed(()=>S0e(i.time,i.timeFormat)),d=I.computed(()=>{var f,p;if(i.status==="done"){let T=(p=(f=o.value)==null?void 0:f.querySelector(".ai-chat-record-content-inner"))==null?void 0:p.innerText;return(T==null?void 0:T.length)??0}else return 0});function h(){var T;let f=(T=o.value)==null?void 0:T.querySelector(".ai-chat-record-content-inner");if(!f)return;function p(){i.copyTipType==="message"?s.value?na.success("\u590D\u5236\u6210\u529F"):na.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}C0e(f).then(()=>{s.value=!0,p()}).catch(()=>{s.value=!1,p()})}return t({statusEnum:n}),(f,p)=>{const T=Xh,g=X8;return I.openBlock(),I.createElementBlock("div",{ref_key:"elRef",ref:o,class:I.normalizeClass(["ai-chat-record",{"ai-chat-record--r":e.pos==="r","ai-chat-record--full-width":e.fullWidth,"ai-chat-record--show-time":e.showTime}])},[e.showAvatar?(I.openBlock(),I.createElementBlock("div",W9t,[I.renderSlot(f.$slots,"avatar",{},()=>[I.createVNode(T,{size:40,src:e.avatar},{icon:I.withCtx(()=>p[1]||(p[1]=[])),_:1},8,["src"])],!0)])):I.createCommentVNode("",!0),I.createElementVNode("div",j9t,[I.createElementVNode("div",X9t,[I.renderSlot(f.$slots,"head",{},()=>[e.showTime?(I.openBlock(),I.createElementBlock("div",K9t,[I.renderSlot(f.$slots,"time",{time:u.value},()=>[I.createTextVNode(I.toDisplayString(u.value),1)],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"headRight",{},void 0,!0)],!0)]),I.createElementVNode("div",Z9t,[e.status===n.Loading?(I.openBlock(),I.createElementBlock("div",J9t,[I.renderSlot(f.$slots,"loading",{},()=>[I.createVNode(f2t,{theme:e.pos==="r"?"light":"",message:e.loadingMessage},null,8,["theme","message"])],!0)])):(I.openBlock(),I.createElementBlock("div",egt,[I.createElementVNode("div",tgt,[I.renderSlot(f.$slots,"contentBefore",{},void 0,!0)]),I.createElementVNode("div",rgt,[I.renderSlot(f.$slots,"content",{},()=>[I.createVNode(_x,{content:e.content},null,8,["content"])],!0)]),I.createElementVNode("div",ngt,[I.renderSlot(f.$slots,"contentAfter",{},void 0,!0)]),e.showCharacterCount&&e.status===n.Done?(I.openBlock(),I.createElementBlock("div",igt,[I.renderSlot(f.$slots,"characterCountBefore",{},void 0,!0),I.renderSlot(f.$slots,"characterCount",{},()=>[I.withDirectives(I.createElementVNode("span",null,"\u5171"+I.toDisplayString(d.value)+"\u4E2A\u5B57\u7B26",513),[[I.vShow,d.value]])],!0),I.renderSlot(f.$slots,"characterCountAfter",{},void 0,!0)])):I.createCommentVNode("",!0)]))]),e.showFoot?(I.openBlock(),I.createElementBlock("div",agt,[I.renderSlot(f.$slots,"foot",{},()=>[I.createElementVNode("div",ogt,[I.renderSlot(f.$slots,"actionsBefore",{},void 0,!0),I.renderSlot(f.$slots,"actions",{},()=>[I.createVNode(g,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:I.withCtx(()=>[s.value?(I.openBlock(),I.createElementBlock("span",sgt,[I.createVNode(I.unref(R6),{class:"copy-tooltip-icon"}),p[2]||(p[2]=I.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(I.openBlock(),I.createElementBlock("span",lgt,[I.createVNode(I.unref(X_),{class:"copy-tooltip-icon"}),p[3]||(p[3]=I.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:I.withCtx(()=>[e.status===n.Done&&e.actions.includes("copy")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:h},p[4]||(p[4]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1),I.createTextVNode(" \u590D\u5236 ")]))):I.createCommentVNode("",!0)]),_:1},8,["open"]),e.status===n.Done&&e.actions.includes("regenerate")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:p[0]||(p[0]=v=>a("regenerate"))},p[5]||(p[5]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1),I.createTextVNode(" \u91CD\u65B0\u751F\u6210 ")]))):I.createCommentVNode("",!0)],!0),I.renderSlot(f.$slots,"actionsAfter",{},void 0,!0)])],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-b789f5b0"]]);var T8e=11;function cgt(e,t){var r=t.attributes,n,i,a,o,s;if(!(t.nodeType===T8e||e.nodeType===T8e)){for(var l=r.length-1;l>=0;l--)n=r[l],i=n.name,a=n.namespaceURI,o=n.value,a?(i=n.localName||i,s=e.getAttributeNS(a,i),s!==o&&(n.prefix==="xmlns"&&(i=n.name),e.setAttributeNS(a,i,o))):(s=e.getAttribute(i),s!==o&&e.setAttribute(i,o));for(var u=e.attributes,d=u.length-1;d>=0;d--)n=u[d],i=n.name,a=n.namespaceURI,a?(i=n.localName||i,t.hasAttributeNS(a,i)||e.removeAttributeNS(a,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Qx,ugt="http://www.w3.org/1999/xhtml",Zs=typeof document>"u"?void 0:document,dgt=!!Zs&&"content"in Zs.createElement("template"),hgt=!!Zs&&Zs.createRange&&"createContextualFragment"in Zs.createRange();function fgt(e){var t=Zs.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function pgt(e){Qx||(Qx=Zs.createRange(),Qx.selectNode(Zs.body));var t=Qx.createContextualFragment(e);return t.childNodes[0]}function Tgt(e){var t=Zs.createElement("body");return t.innerHTML=e,t.childNodes[0]}function ggt(e){return e=e.trim(),dgt?fgt(e):hgt?pgt(e):Tgt(e)}function bx(e,t){var r=e.nodeName,n=t.nodeName,i,a;return r===n?!0:(i=r.charCodeAt(0),a=n.charCodeAt(0),i<=90&&a>=97?r===n.toUpperCase():a<=90&&i>=97?n===r.toUpperCase():!1)}function mgt(e,t){return!t||t===ugt?Zs.createElement(e):Zs.createElementNS(t,e)}function vgt(e,t){for(var r=e.firstChild;r;){var n=r.nextSibling;t.appendChild(r),r=n}return t}function BB(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var g8e={OPTION:function(e,t){var r=e.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}BB(e,t,"selected")},INPUT:function(e,t){BB(e,t,"checked"),BB(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var n=e.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==e.placeholder)return;n.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r=-1,n=0,i=e.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild;else{if(o==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}e.selectedIndex=r}}},Cm=1,m8e=11,v8e=3,y8e=8;function y4(){}function ygt(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function _gt(e){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var a=n;n=Zs.createElement("html"),n.innerHTML=a}else n=ggt(n);else n.nodeType===m8e&&(n=n.firstElementChild);var o=i.getNodeKey||ygt,s=i.onBeforeNodeAdded||y4,l=i.onNodeAdded||y4,u=i.onBeforeElUpdated||y4,d=i.onElUpdated||y4,h=i.onBeforeNodeDiscarded||y4,f=i.onNodeDiscarded||y4,p=i.onBeforeElChildrenUpdated||y4,T=i.skipFromChildren||y4,g=i.addChild||function(F,k){return F.appendChild(k)},v=i.childrenOnly===!0,m=Object.create(null),y=[];function _(F){y.push(F)}function E(F,k){if(F.nodeType===Cm)for(var V=F.firstChild;V;){var B=void 0;k&&(B=o(V))?_(B):(f(V),V.firstChild&&E(V,k)),V=V.nextSibling}}function Q(F,k,V){h(F)!==!1&&(k&&k.removeChild(F),f(F),E(F,V))}function b(F){if(F.nodeType===Cm||F.nodeType===m8e)for(var k=F.firstChild;k;){var V=o(k);V&&(m[V]=k),b(k),k=k.nextSibling}}b(r);function x(F){l(F);for(var k=F.firstChild;k;){var V=k.nextSibling,B=o(k);if(B){var $=m[B];$&&bx(k,$)?(k.parentNode.replaceChild($,k),C($,k)):x(k)}else x(k);k=V}}function S(F,k,V){for(;k;){var B=k.nextSibling;(V=o(k))?_(V):Q(k,F,!0),k=B}}function C(F,k,V){var B=o(k);if(B&&delete m[B],!V){var $=u(F,k);if($===!1||($ instanceof HTMLElement&&(F=$,b(F)),e(F,k),d(F),p(F,k)===!1))return}F.nodeName!=="TEXTAREA"?A(F,k):g8e.TEXTAREA(F,k)}function A(F,k){var V=T(F,k),B=k.firstChild,$=F.firstChild,z,G,J,ie,re;e:for(;B;){for(ie=B.nextSibling,z=o(B);!V&&$;){if(J=$.nextSibling,B.isSameNode&&B.isSameNode($)){B=ie,$=J;continue e}G=o($);var j=$.nodeType,oe=void 0;if(j===B.nodeType&&(j===Cm?(z?z!==G&&((re=m[z])?J===re?oe=!1:(F.insertBefore(re,$),G?_(G):Q($,F,!0),$=re,G=o($)):oe=!1):G&&(oe=!1),oe=oe!==!1&&bx($,B),oe&&C($,B)):(j===v8e||j==y8e)&&(oe=!0,$.nodeValue!==B.nodeValue&&($.nodeValue=B.nodeValue))),oe){B=ie,$=J;continue e}G?_(G):Q($,F,!0),$=J}if(z&&(re=m[z])&&bx(re,B))V||g(F,re),C(re,B);else{var ee=s(B);ee!==!1&&(ee&&(B=ee),B.actualize&&(B=B.actualize(F.ownerDocument||Zs)),g(F,B),x(B))}B=ie,$=J}S(F,$,G);var X=g8e[F.nodeName];X&&X(F,k)}var w=r,N=w.nodeType,P=n.nodeType;if(!v){if(N===Cm)P===Cm?bx(r,n)||(f(r),w=vgt(r,mgt(n.nodeName,n.namespaceURI))):w=n;else if(N===v8e||N===y8e){if(P===N)return w.nodeValue!==n.nodeValue&&(w.nodeValue=n.nodeValue),w;w=n}}if(w===n)f(r);else{if(n.isSameNode&&n.isSameNode(w))return;if(C(w,n,v),y)for(var R=0,M=y.length;R<M;R++){var H=m[y[R]];H&&Q(H,H.parentNode,!1)}}return!v&&w!==r&&r.parentNode&&(w.actualize&&(w=w.actualize(r.ownerDocument||Zs)),r.parentNode.replaceChild(w,r)),w}}var Qgt=_gt(cgt);const bgt={key:1,class:"ai-content-parser-inner"},_8e=Object.assign({name:"AiContentParser"},{__name:"ContentParser",props:{type:{type:String,default:"text"},content:String,stream:{type:Boolean,default:!1},streamDone:{type:Boolean,default:!1}},setup(e){const t=e,r=I.ref(null),n=I.ref("");return I.onMounted(()=>{I.watch(()=>t.content,()=>{if(n.value=t.type==="markdown"?L0e.parse(t.content):t.content,t.type==="markdown"||t.type==="html"){const i=document.createElement("div");i.innerHTML=n.value,i.classList.add("ai-content-parser-inner"),Qgt(r.value,i)}},{immediate:!0})}),(i,a)=>(I.openBlock(),I.createElementBlock("div",{class:I.normalizeClass(["ai-content-parser",`ai-content-parser--${e.type}`])},[e.type==="html"||e.type==="markdown"?(I.openBlock(),I.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"ai-content-parser-inner"},null,512)):(I.openBlock(),I.createElementBlock("div",bgt,I.toDisplayString(n.value),1))],2))}}),Egt={class:"ai-think-parser"},xgt={class:"ai-think-parser-content"},Q8e=ta(Object.assign({name:"AiThinkParser"},{__name:"ThinkParser",setup(e){return(t,r)=>(I.openBlock(),I.createElementBlock("div",Egt,[I.createElementVNode("div",xgt,[I.renderSlot(t.$slots,"content",{},()=>[I.createVNode(_x,I.normalizeProps(I.guardReactiveProps(t.$attrs)),null,16)],!0)])]))}}),[["__scopeId","data-v-70d4677e"]]),Sgt=e=>{const t=()=>{r.bottom&&s({behavior:"instant"})},{arrivedState:r,measure:n}=B9t(e,{offset:{bottom:50,top:50}}),{stop:i}=P9t(e,t,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),{stop:a}=H9t(e,t),o=I.computed(()=>s7(e)),s=({behavior:l="smooth"}={})=>{if(o.value)try{o.value.scrollTo({top:o.value.scrollHeight,behavior:l})}catch{o.value.scrollTop=o.value.scrollHeight}};return I.onMounted(()=>{I.nextTick(()=>{s({behavior:"instant"})})}),I.onUnmounted(()=>{i(),a()}),{scrollToBottom:s,arrivedState:r,measure:n}},Cgt=[Xq,FJ,VJ,$J,p8e,_8e,_x,Q8e,kB],b8e=(e,t={})=>{Cgt.forEach(r=>{e.component(r.name,r)})};typeof window<"u"&&window.Vue&&b8e(window.Vue);const Lgt={install:b8e};var Agt="\0",hd="\0",E8e="";class Js{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=$h(void 0),this._defaultEdgeLabelFn=$h(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[hd]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return S1(t)||(t=$h(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return La(this._nodes)}sources(){var t=this;return Yi(this.nodes(),function(r){return On(t._in[r])})}sinks(){var t=this;return Yi(this.nodes(),function(r){return On(t._out[r])})}setNodes(t,r){var n=arguments,i=this;return at(t,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=hd,this._children[t]={},this._children[hd][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],at(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),at(La(this._in[t]),r),delete this._in[t],delete this._preds[t],at(La(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Hn(r))r=hd;else{r+="";for(var n=r;!Hn(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==hd)return r}}children(t){if(Hn(t)&&(t=hd),this._isCompound){var r=this._children[t];if(r)return La(r)}else{if(t===hd)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return La(r)}successors(t){var r=this._sucs[t];if(r)return La(r)}neighbors(t){var r=this.predecessors(t);if(r)return _Be(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;at(this._nodes,function(o,s){t(s)&&r.setNode(s,o)}),at(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var s=n.parent(o);return s===void 0||r.hasNode(s)?(i[o]=s,s):s in i?i[s]:a(s)}return this._isCompound&&at(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(t){return S1(t)||(t=$h(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return ei(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return ma(t,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var t,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(t=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(t=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,r=""+r,Hn(n)||(n=""+n);var s=Lm(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!Hn(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(t,r,n);var l=wgt(this._isDirected,t,r,n);return t=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,x8e(this._preds[r],t),x8e(this._sucs[t],r),this._in[r][s]=l,this._out[t][s]=l,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?FB(this._isDirected,arguments[0]):Lm(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?FB(this._isDirected,arguments[0]):Lm(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?FB(this._isDirected,arguments[0]):Lm(this._isDirected,t,r,n),a=this._edgeObjs[i];return a&&(t=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],S8e(this._preds[r],t),S8e(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=ei(n);return r?Yi(i,function(a){return a.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=ei(n);return r?Yi(i,function(a){return a.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}}Js.prototype._nodeCount=0,Js.prototype._edgeCount=0;function x8e(e,t){e[t]?e[t]++:e[t]=1}function S8e(e,t){--e[t]||delete e[t]}function Lm(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}return i+E8e+a+E8e+(Hn(n)?Agt:n)}function wgt(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function FB(e,t){return Lm(e,t.v,t.w,t.name)}class Ogt{constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,r=t._prev;if(r!==t)return C8e(r),r}enqueue(t){var r=this._sentinel;t._prev&&t._next&&C8e(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){for(var t=[],r=this._sentinel,n=r._prev;n!==r;)t.push(JSON.stringify(n,Rgt)),n=n._prev;return"["+t.join(", ")+"]"}}function C8e(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Rgt(e,t){if(e!=="_next"&&e!=="_prev")return t}var Ngt=$h(1);function Mgt(e,t){if(e.nodeCount()<=1)return[];var r=Dgt(e,t||Ngt),n=Igt(r.graph,r.buckets,r.zeroIdx);return eo(Wt(n,function(i){return e.outEdges(i.v,i.w)}))}function Igt(e,t,r){for(var n=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)VB(e,t,r,o);for(;o=i.dequeue();)VB(e,t,r,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){n=n.concat(VB(e,t,r,o,!0));break}}}return n}function VB(e,t,r,n,i){var a=i?[]:void 0;return at(e.inEdges(n.v),function(o){var s=e.edge(o),l=e.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,$B(t,r,l)}),at(e.outEdges(n.v),function(o){var s=e.edge(o),l=o.w,u=e.node(l);u.in-=s,$B(t,r,u)}),e.removeNode(n.v),a}function Dgt(e,t){var r=new Js,n=0,i=0;at(e.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),at(e.edges(),function(s){var l=r.edge(s.v,s.w)||0,u=t(s),d=l+u;r.setEdge(s.v,s.w,d),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=qh(i+n+3).map(function(){return new Ogt}),o=n+1;return at(r.nodes(),function(s){$B(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function $B(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function kgt(e){var t=e.graph().acyclicer==="greedy"?Mgt(e,r(e)):Pgt(e);at(t,function(n){var i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,fO("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function Pgt(e){var t=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,at(e.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?t.push(o):i(o.w)}),delete r[a])}return at(e.nodes(),i),t}function Hgt(e){at(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}function l7(e,t,r,n){var i;do i=fO(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function Bgt(e){var t=new Js().setGraph(e.graph());return at(e.nodes(),function(r){t.setNode(r,e.node(r))}),at(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function L8e(e){var t=new Js({multigraph:e.isMultigraph()}).setGraph(e.graph());return at(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),at(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function A8e(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,s=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:r+l,y:n+u}}function Ex(e){var t=Wt(qh(O8e(e)+1),function(){return[]});return at(e.nodes(),function(r){var n=e.node(r),i=n.rank;Hn(i)||(t[i][n.order]=r)}),t}function Fgt(e){var t=zh(Wt(e.nodes(),function(r){return e.node(r).rank}));at(e.nodes(),function(r){var n=e.node(r);Ar(n,"rank")&&(n.rank-=t)})}function Vgt(e){var t=zh(Wt(e.nodes(),function(a){return e.node(a).rank})),r=[];at(e.nodes(),function(a){var o=e.node(a).rank-t;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=e.graph().nodeRankFactor;at(r,function(a,o){Hn(a)&&o%i!==0?--n:n&&at(a,function(s){e.node(s).rank+=n})})}function w8e(e,t,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),l7(e,"border",i,t)}function O8e(e){return O6(Wt(e.nodes(),function(t){var r=e.node(t).rank;if(!Hn(r))return r}))}function $gt(e,t){var r={lhs:[],rhs:[]};return at(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Ugt(e,t){return t()}function Ggt(e){function t(r){var n=e.children(r),i=e.node(r);if(n.length&&at(n,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)R8e(e,"borderLeft","_bl",r,i,a),R8e(e,"borderRight","_br",r,i,a)}}at(e.children(),t)}function R8e(e,t,r,n,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],l=l7(e,"border",o,r);i[t][a]=l,e.setParent(l,n),s&&e.setEdge(s,l,{weight:1})}function zgt(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&N8e(e)}function qgt(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&Ygt(e),(t==="lr"||t==="rl")&&(Wgt(e),N8e(e))}function N8e(e){at(e.nodes(),function(t){M8e(e.node(t))}),at(e.edges(),function(t){M8e(e.edge(t))})}function M8e(e){var t=e.width;e.width=e.height,e.height=t}function Ygt(e){at(e.nodes(),function(t){UB(e.node(t))}),at(e.edges(),function(t){var r=e.edge(t);at(r.points,UB),Object.prototype.hasOwnProperty.call(r,"y")&&UB(r)})}function UB(e){e.y=-e.y}function Wgt(e){at(e.nodes(),function(t){GB(e.node(t))}),at(e.edges(),function(t){var r=e.edge(t);at(r.points,GB),Object.prototype.hasOwnProperty.call(r,"x")&&GB(r)})}function GB(e){var t=e.x;e.x=e.y,e.y=t}function jgt(e){e.graph().dummyChains=[],at(e.edges(),function(t){Xgt(e,t)})}function Xgt(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),l=s.labelRank;if(a!==n+1){e.removeEdge(t);var u=void 0,d,h;for(h=0,++n;n<a;++h,++n)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:n},d=l7(e,"edge",u,"_d"),n===l&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),e.setEdge(r,d,{weight:s.weight},o),h===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:s.weight},o)}}function Kgt(e){at(e.graph().dummyChains,function(t){var r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=i,r=e.node(t)})}function zB(e){var t={};function r(n){var i=e.node(n);if(Object.prototype.hasOwnProperty.call(t,n))return i.rank;t[n]=!0;var a=zh(Wt(e.outEdges(n),function(o){return r(o.w)-e.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}at(e.sources(),r)}function Am(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function I8e(e){var t=new Js({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,a;Zgt(t,e)<n;)i=Jgt(t,e),a=t.hasNode(i.v)?Am(e,i):-Am(e,i),emt(t,e,a);return t}function Zgt(e,t){function r(n){at(t.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;!e.hasNode(o)&&!Am(t,i)&&(e.setNode(o,{}),e.setEdge(n,o,{}),r(o))})}return at(e.nodes(),r),e.nodeCount()}function Jgt(e,t){return dO(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Am(t,r)})}function emt(e,t,r){at(e.nodes(),function(n){t.node(n).rank+=r})}function tmt(){}tmt.prototype=new Error;function D8e(e,t,r){pn(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return at(t,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);k8e(e,o,r==="post",a,n,i)}),i}function k8e(e,t,r,n,i,a){Object.prototype.hasOwnProperty.call(n,t)||(n[t]=!0,r||a.push(t),at(i(t),function(o){k8e(e,o,r,n,i,a)}),r&&a.push(t))}function rmt(e,t){return D8e(e,t,"post")}function nmt(e,t){return D8e(e,t,"pre")}fd.initLowLimValues=YB,fd.initCutValues=qB,fd.calcCutValue=P8e,fd.leaveEdge=B8e,fd.enterEdge=F8e,fd.exchangeEdges=V8e;function fd(e){e=Bgt(e),zB(e);var t=I8e(e);YB(t),qB(t,e);for(var r,n;r=B8e(t);)n=F8e(t,e,r),V8e(t,e,r,n)}function qB(e,t){var r=rmt(e,e.nodes());r=r.slice(0,r.length-1),at(r,function(n){imt(e,t,n)})}function imt(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=P8e(e,t,r)}function P8e(e,t,r){var n=e.node(r),i=n.parent,a=!0,o=t.edge(r,i),s=0;return o||(a=!1,o=t.edge(i,r)),s=o.weight,at(t.nodeEdges(r),function(l){var u=l.v===r,d=u?l.w:l.v;if(d!==i){var h=u===a,f=t.edge(l).weight;if(s+=h?f:-f,omt(e,r,d)){var p=e.edge(r,d).cutvalue;s+=h?-p:p}}}),s}function YB(e,t){arguments.length<2&&(t=e.nodes()[0]),H8e(e,{},1,t)}function H8e(e,t,r,n,i){var a=r,o=e.node(n);return t[n]=!0,at(e.neighbors(n),function(s){Object.prototype.hasOwnProperty.call(t,s)||(r=H8e(e,t,r,s,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function B8e(e){return Cu(e.edges(),function(t){return e.edge(t).cutvalue<0})}function F8e(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var a=e.node(n),o=e.node(i),s=a,l=!1;a.lim>o.lim&&(s=o,l=!0);var u=Yi(t.edges(),function(d){return l===$8e(e,e.node(d.v),s)&&l!==$8e(e,e.node(d.w),s)});return dO(u,function(d){return Am(t,d)})}function V8e(e,t,r,n){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(n.v,n.w,{}),YB(e),qB(e,t),amt(e,t)}function amt(e,t){var r=Cu(e.nodes(),function(i){return!t.node(i).parent}),n=nmt(e,r);n=n.slice(1),at(n,function(i){var a=e.node(i).parent,o=t.edge(i,a),s=!1;o||(o=t.edge(a,i),s=!0),t.node(i).rank=t.node(a).rank+(s?o.minlen:-o.minlen)})}function omt(e,t,r){return e.hasEdge(t,r)}function $8e(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}function smt(e){switch(e.graph().ranker){case"network-simplex":U8e(e);break;case"tight-tree":cmt(e);break;case"longest-path":lmt(e);break;default:U8e(e)}}var lmt=zB;function cmt(e){zB(e),I8e(e)}function U8e(e){fd(e)}function umt(e){var t=l7(e,"root",{},"_root"),r=dmt(e),n=O6(ei(r))-1,i=2*n+1;e.graph().nestingRoot=t,at(e.edges(),function(o){e.edge(o).minlen*=i});var a=hmt(e)+1;at(e.children(),function(o){G8e(e,t,i,a,n,r,o)}),e.graph().nodeRankFactor=i}function G8e(e,t,r,n,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:r});return}var l=w8e(e,"_bt"),u=w8e(e,"_bb"),d=e.node(o);e.setParent(l,o),d.borderTop=l,e.setParent(u,o),d.borderBottom=u,at(s,function(h){G8e(e,t,r,n,i,a,h);var f=e.node(h),p=f.borderTop?f.borderTop:h,T=f.borderBottom?f.borderBottom:h,g=f.borderTop?n:2*n,v=p!==T?1:i-a[o]+1;e.setEdge(l,p,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(T,u,{weight:g,minlen:v,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,l,{weight:0,minlen:i+a[o]})}function dmt(e){var t={};function r(n,i){var a=e.children(n);a&&a.length&&at(a,function(o){r(o,i+1)}),t[n]=i}return at(e.children(),function(n){r(n,1)}),t}function hmt(e){return ma(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function fmt(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,at(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}function pmt(e,t,r){var n={},i;at(r,function(a){for(var o=e.parent(a),s,l;o;){if(s=e.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){t.setEdge(l,o);return}o=s}})}function Tmt(e,t,r){var n=gmt(e),i=new Js({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return e.node(a)});return at(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),at(e[r](a),function(l){var u=l.v===a?l.w:l.v,d=i.edge(u,a),h=Hn(d)?0:d.weight;i.setEdge(u,a,{weight:e.edge(l).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function gmt(e){for(var t;e.hasNode(t=fO("_root")););return t}function mmt(e,t){for(var r=0,n=1;n<t.length;++n)r+=vmt(e,t[n-1],t[n]);return r}function vmt(e,t,r){for(var n=xBe(r,Wt(r,function(u,d){return d})),i=eo(Wt(t,function(u){return W8(Wt(e.outEdges(u),function(d){return{pos:n[d.w],weight:e.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var o=2*a-1;a-=1;var s=Wt(new Array(o),function(){return 0}),l=0;return at(i.forEach(function(u){var d=u.pos+a;s[d]+=u.weight;for(var h=0;d>0;)d%2&&(h+=s[d+1]),d=d-1>>1,s[d]+=u.weight;l+=u.weight*h})),l}function ymt(e){var t={},r=Yi(e.nodes(),function(s){return!e.children(s).length}),n=O6(Wt(r,function(s){return e.node(s).rank})),i=Wt(qh(n+1),function(){return[]});function a(s){if(!Ar(t,s)){t[s]=!0;var l=e.node(s);i[l.rank].push(s),at(e.successors(s),a)}}var o=W8(r,function(s){return e.node(s).rank});return at(o,a),i}function _mt(e,t){return Wt(t,function(r){var n=e.inEdges(r);if(n.length){var i=ma(n,function(a,o){var s=e.edge(o),l=e.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Qmt(e,t){var r={};at(e,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Hn(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),at(t.edges(),function(i){var a=r[i.v],o=r[i.w];!Hn(a)&&!Hn(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=Yi(r,function(i){return!i.indegree});return bmt(n)}function bmt(e){var t=[];function r(a){return function(o){o.merged||(Hn(o.barycenter)||Hn(a.barycenter)||o.barycenter>=a.barycenter)&&Emt(a,o)}}function n(a){return function(o){o.in.push(a),--o.indegree===0&&e.push(o)}}for(;e.length;){var i=e.pop();t.push(i),at(i.in.reverse(),r(i)),at(i.out,n(i))}return Wt(Yi(t,function(a){return!a.merged}),function(a){return z_(a,["vs","i","barycenter","weight"])})}function Emt(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}function xmt(e,t){var r=$gt(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=W8(r.rhs,function(d){return-d.i}),a=[],o=0,s=0,l=0;n.sort(Smt(!!t)),l=z8e(a,i,l),at(n,function(d){l+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,s+=d.weight,l=z8e(a,i,l)});var u={vs:eo(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function z8e(e,t,r){for(var n;t.length&&(n=w2(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Smt(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}function q8e(e,t,r,n){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=Yi(i,function(T){return T!==o&&T!==s}));var u=_mt(e,i);at(u,function(T){if(e.children(T.v).length){var g=q8e(e,T.v,r,n);l[T.v]=g,Object.prototype.hasOwnProperty.call(g,"barycenter")&&Lmt(T,g)}});var d=Qmt(u,r);Cmt(d,l);var h=xmt(d,n);if(o&&(h.vs=eo([o,h.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+p.order)/(h.weight+2),h.weight+=2}return h}function Cmt(e,t){at(e,function(r){r.vs=eo(r.vs.map(function(n){return t[n]?t[n].vs:n}))})}function Lmt(e,t){Hn(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Amt(e){var t=O8e(e),r=Y8e(e,qh(1,t+1),"inEdges"),n=Y8e(e,qh(t-1,-1,-1),"outEdges"),i=ymt(e);W8e(e,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){wmt(s%2?r:n,s%4>=2),i=Ex(e);var u=mmt(e,i);u<a&&(l=0,o=cHe(i),a=u)}W8e(e,o)}function Y8e(e,t,r){return Wt(t,function(n){return Tmt(e,n,r)})}function wmt(e,t){var r=new Js;at(e,function(n){var i=n.graph().root,a=q8e(n,i,r,t);at(a.vs,function(o,s){n.node(o).order=s}),pmt(n,r,a.vs)})}function W8e(e,t){at(t,function(r){at(r,function(n,i){e.node(n).order=i})})}function Omt(e){var t=Nmt(e);at(e.graph().dummyChains,function(r){for(var n=e.node(r),i=n.edgeObj,a=Rmt(e,t,i.v,i.w),o=a.path,s=a.lca,l=0,u=o[l],d=!0;r!==i.w;){if(n=e.node(r),d){for(;(u=o[l])!==s&&e.node(u).maxRank<n.rank;)l++;u===s&&(d=!1)}if(!d){for(;l<o.length-1&&e.node(u=o[l+1]).minRank<=n.rank;)l++;u=o[l]}e.setParent(r,u),r=e.successors(r)[0]}})}function Rmt(e,t,r,n){var i=[],a=[],o=Math.min(t[r].low,t[n].low),s=Math.max(t[r].lim,t[n].lim),l,u;l=r;do l=e.parent(l),i.push(l);while(l&&(t[l].low>o||s>t[l].lim));for(u=l,l=n;(l=e.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function Nmt(e){var t={},r=0;function n(i){var a=r;at(e.children(i),n),t[i]={low:a,lim:r++}}return at(e.children(),n),t}function Mmt(e,t){var r={};function n(i,a){var o=0,s=0,l=i.length,u=w2(a);return at(a,function(d,h){var f=Dmt(e,d),p=f?e.node(f).order:l;(f||d===u)&&(at(a.slice(s,h+1),function(T){at(e.predecessors(T),function(g){var v=e.node(g),m=v.order;(m<o||p<m)&&!(v.dummy&&e.node(T).dummy)&&j8e(r,g,T)})}),s=h+1,o=p)}),a}return ma(t,n),r}function Imt(e,t){var r={};function n(a,o,s,l,u){var d;at(qh(o,s),function(h){d=a[h],e.node(d).dummy&&at(e.predecessors(d),function(f){var p=e.node(f);p.dummy&&(p.order<l||p.order>u)&&j8e(r,f,d)})})}function i(a,o){var s=-1,l,u=0;return at(o,function(d,h){if(e.node(d).dummy==="border"){var f=e.predecessors(d);f.length&&(l=e.node(f[0]).order,n(o,u,h,s,l),u=h,s=l)}n(o,u,o.length,l,a.length)}),o}return ma(t,i),r}function Dmt(e,t){if(e.node(t).dummy)return Cu(e.predecessors(t),function(r){return e.node(r).dummy})}function j8e(e,t,r){if(t>r){var n=t;t=r,r=n}var i=e[t];i||(e[t]=i={}),i[r]=!0}function kmt(e,t,r){if(t>r){var n=t;t=r,r=n}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],r)}function Pmt(e,t,r,n){var i={},a={},o={};return at(t,function(s){at(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),at(t,function(s){var l=-1;at(s,function(u){var d=n(u);if(d.length){d=W8(d,function(g){return o[g]});for(var h=(d.length-1)/2,f=Math.floor(h),p=Math.ceil(h);f<=p;++f){var T=d[f];a[u]===u&&l<o[T]&&!kmt(r,u,T)&&(a[T]=u,a[u]=i[u]=i[T],l=o[T])}}})}),{root:i,align:a}}function Hmt(e,t,r,n,i){var a={},o=Bmt(e,t,r,i),s=i?"borderLeft":"borderRight";function l(h,f){for(var p=o.nodes(),T=p.pop(),g={};T;)g[T]?h(T):(g[T]=!0,p.push(T),p=p.concat(f(T))),T=p.pop()}function u(h){a[h]=o.inEdges(h).reduce(function(f,p){return Math.max(f,a[p.v]+o.edge(p))},0)}function d(h){var f=o.outEdges(h).reduce(function(T,g){return Math.min(T,a[g.w]-o.edge(g))},Number.POSITIVE_INFINITY),p=e.node(h);f!==Number.POSITIVE_INFINITY&&p.borderType!==s&&(a[h]=Math.max(a[h],f))}return l(u,o.predecessors.bind(o)),l(d,o.successors.bind(o)),at(n,function(h){a[h]=a[r[h]]}),a}function Bmt(e,t,r,n){var i=new Js,a=e.graph(),o=Gmt(a.nodesep,a.edgesep,n);return at(t,function(s){var l;at(s,function(u){var d=r[u];if(i.setNode(d),l){var h=r[l],f=i.edge(h,d);i.setEdge(h,d,Math.max(o(e,u,l),f||0))}l=u})}),i}function Fmt(e,t){return dO(ei(t),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return PHe(r,function(a,o){var s=zmt(e,o)/2;n=Math.max(a+s,n),i=Math.min(a-s,i)}),n-i})}function Vmt(e,t){var r=ei(t),n=zh(r),i=O6(r);at(["u","d"],function(a){at(["l","r"],function(o){var s=a+o,l=e[s],u;if(l!==t){var d=ei(l);u=o==="l"?n-zh(d):i-O6(d),u&&(e[s]=U_(l,function(h){return h+u}))}})})}function $mt(e,t){return U_(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var i=W8(Wt(e,n));return(i[1]+i[2])/2})}function Umt(e){var t=Ex(e),r=G_(Mmt(e,t),Imt(e,t)),n={},i;at(["u","d"],function(o){i=o==="u"?t:ei(t).reverse(),at(["l","r"],function(s){s==="r"&&(i=Wt(i,function(h){return ei(h).reverse()}));var l=(o==="u"?e.predecessors:e.successors).bind(e),u=Pmt(e,i,r,l),d=Hmt(e,i,u.root,u.align,s==="r");s==="r"&&(d=U_(d,function(h){return-h})),n[o+s]=d})});var a=Fmt(e,n);return Vmt(n,a),$mt(n,e.graph().align)}function Gmt(e,t,r){return function(n,i,a){var o=n.node(i),s=n.node(a),l=0,u;if(l+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(l+=r?u:-u),u=0,l+=(o.dummy?t:e)/2,l+=(s.dummy?t:e)/2,l+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(l+=r?u:-u),u=0,l}}function zmt(e,t){return e.node(t).width}function qmt(e){e=L8e(e),Ymt(e),HHe(Umt(e),function(t,r){e.node(r).x=t})}function Ymt(e){var t=Ex(e),r=e.graph().ranksep,n=0;at(t,function(i){var a=O6(Wt(i,function(o){return e.node(o).height}));at(i,function(o){e.node(o).y=n+a/2}),n+=a+r})}function X8e(e,t){var r=Ugt;r("layout",()=>{var n=r(" buildLayoutGraph",()=>ivt(e));r(" runLayout",()=>Wmt(n,r)),r(" updateInputGraph",()=>jmt(e,n))})}function Wmt(e,t){t(" makeSpaceForEdgeLabels",()=>avt(e)),t(" removeSelfEdges",()=>pvt(e)),t(" acyclic",()=>kgt(e)),t(" nestingGraph.run",()=>umt(e)),t(" rank",()=>smt(L8e(e))),t(" injectEdgeLabelProxies",()=>ovt(e)),t(" removeEmptyRanks",()=>Vgt(e)),t(" nestingGraph.cleanup",()=>fmt(e)),t(" normalizeRanks",()=>Fgt(e)),t(" assignRankMinMax",()=>svt(e)),t(" removeEdgeLabelProxies",()=>lvt(e)),t(" normalize.run",()=>jgt(e)),t(" parentDummyChains",()=>Omt(e)),t(" addBorderSegments",()=>Ggt(e)),t(" order",()=>Amt(e)),t(" insertSelfEdges",()=>Tvt(e)),t(" adjustCoordinateSystem",()=>zgt(e)),t(" position",()=>qmt(e)),t(" positionSelfEdges",()=>gvt(e)),t(" removeBorderNodes",()=>fvt(e)),t(" normalize.undo",()=>Kgt(e)),t(" fixupEdgeLabelCoords",()=>dvt(e)),t(" undoCoordinateSystem",()=>qgt(e)),t(" translateGraph",()=>cvt(e)),t(" assignNodeIntersects",()=>uvt(e)),t(" reversePoints",()=>hvt(e)),t(" acyclic.undo",()=>Hgt(e))}function jmt(e,t){at(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),at(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Xmt=["nodesep","edgesep","ranksep","marginx","marginy"],Kmt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Zmt=["acyclicer","ranker","rankdir","align"],Jmt=["width","height"],evt={width:0,height:0},tvt=["minlen","weight","width","height","labeloffset"],rvt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nvt=["labelpos"];function ivt(e){var t=new Js({multigraph:!0,compound:!0}),r=jB(e.graph());return t.setGraph(G_({},Kmt,WB(r,Xmt),z_(r,Zmt))),at(e.nodes(),function(n){var i=jB(e.node(n));t.setNode(n,F_(WB(i,Jmt),evt)),t.setParent(n,e.parent(n))}),at(e.edges(),function(n){var i=jB(e.edge(n));t.setEdge(n,G_({},rvt,WB(i,tvt),z_(i,nvt)))}),t}function avt(e){var t=e.graph();t.ranksep/=2,at(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function ovt(e){at(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};l7(e,"edge-proxy",a,"_ep")}})}function svt(e){var t=0;at(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=O6(t,n.maxRank))}),e.graph().maxRank=t}function lvt(e){at(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function cvt(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function l(u){var d=u.x,h=u.y,f=u.width,p=u.height;t=Math.min(t,d-f/2),r=Math.max(r,d+f/2),n=Math.min(n,h-p/2),i=Math.max(i,h+p/2)}at(e.nodes(),function(u){l(e.node(u))}),at(e.edges(),function(u){var d=e.edge(u);Object.prototype.hasOwnProperty.call(d,"x")&&l(d)}),t-=o,n-=s,at(e.nodes(),function(u){var d=e.node(u);d.x-=t,d.y-=n}),at(e.edges(),function(u){var d=e.edge(u);at(d.points,function(h){h.x-=t,h.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=t),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-t+o,a.height=i-n+s}function uvt(e){at(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),i=e.node(t.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(A8e(n,a)),r.points.push(A8e(i,o))})}function dvt(e){at(e.edges(),function(t){var r=e.edge(t);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function hvt(e){at(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function fvt(e){at(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(w2(r.borderLeft)),o=e.node(w2(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),at(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function pvt(e){at(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Tvt(e){var t=Ex(e);at(t,function(r){var n=0;at(r,function(i,a){var o=e.node(i);o.order=a+n,at(o.selfEdges,function(s){l7(e,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:a+ ++n,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function gvt(e){at(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,s=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],r.label.x=r.x,r.label.y=r.y}})}function WB(e,t){return U_(z_(e,t),Number)}function jB(e){var t={};return at(e,function(r,n){t[n.toLowerCase()]=r}),t}function Z2(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:mvt(e),edges:vvt(e)};return Hn(e.graph())||(t.value=wa(e.graph())),t}function mvt(e){return Wt(e.nodes(),function(t){var r=e.node(t),n=e.parent(t),i={v:t};return Hn(r)||(i.value=r),Hn(n)||(i.parent=n),i})}function vvt(e){return Wt(e.edges(),function(t){var r=e.edge(t),n={v:t.v,w:t.w};return Hn(t.name)||(n.name=t.name),Hn(r)||(n.value=r),n})}var an=new Map,pd=new Map,K8e=new Map,yvt=O(()=>{pd.clear(),K8e.clear(),an.clear()},"clear"),xx=O((e,t)=>{const r=pd.get(t)||[];return ge.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),_vt=O((e,t)=>{const r=pd.get(t)||[];return ge.info("Descendants of ",t," is ",r),ge.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||xx(e.v,t)||xx(e.w,t)||r.includes(e.w):(ge.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),Z8e=O((e,t,r,n)=>{ge.warn("Copying children of ",e,"root",n,"data",t.node(e),n);const i=t.children(e)||[];e!==n&&i.push(e),ge.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)Z8e(a,t,r,n);else{const o=t.node(a);ge.info("cp ",a," to ",n," with parent ",e),r.setNode(a,o),n!==t.parent(a)&&(ge.warn("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==n&&a!==e?(ge.debug("Setting parent",a,e),r.setParent(a,e)):(ge.info("In copy ",e,"root",n,"data",t.node(e),n),ge.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==n,"node!==clusterId",a!==e));const s=t.edges(a);ge.debug("Copying Edges",s),s.forEach(l=>{ge.info("Edge",l);const u=t.edge(l.v,l.w,l.name);ge.info("Edge data",u,n);try{_vt(l,n)?(ge.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ge.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):ge.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",e)}catch(d){ge.error(d)}})}ge.debug("Removing node",a),t.removeNode(a)})},"copy"),J8e=O((e,t)=>{const r=t.children(e);let n=[...r];for(const i of r)K8e.set(i,e),n=[...n,...J8e(i,t)];return n},"extractDescendants"),Qvt=O((e,t,r)=>{const n=e.edges().filter(l=>l.v===t||l.w===t),i=e.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===t?r:l.v,w:l.w===t?t:l.w})),o=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>o.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),wm=O((e,t,r)=>{const n=t.children(e);if(ge.trace("Searching children of id ",e,n),n.length<1)return e;let i;for(const a of n){const o=wm(a,t,r),s=Qvt(t,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),eTe=O(e=>!an.has(e)||!an.get(e).externalConnections?e:an.has(e)?an.get(e).id:e,"getAnchorId"),bvt=O((e,t)=>{if(!e||t>10){ge.debug("Opting out, no graph ");return}else ge.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(ge.warn("Cluster identified",r," Replacement id in edges: ",wm(r,e,r)),pd.set(r,J8e(r,e)),an.set(r,{id:wm(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const n=e.children(r),i=e.edges();n.length>0?(ge.debug("Cluster identified",r,pd),i.forEach(a=>{const o=xx(a.v,r),s=xx(a.w,r);o^s&&(ge.warn("Edge: ",a," leaves cluster ",r),ge.warn("Descendants of XXX ",r,": ",pd.get(r)),an.get(r).externalConnections=!0)})):ge.debug("Not a cluster ",r,pd)});for(let r of an.keys()){const n=an.get(r).id,i=e.parent(n);i!==r&&an.has(i)&&!an.get(i).externalConnections&&(an.get(r).id=i)}e.edges().forEach(function(r){const n=e.edge(r);ge.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),ge.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let i=r.v,a=r.w;if(ge.warn("Fix XXX",an,"ids:",r.v,r.w,"Translating: ",an.get(r.v)," --- ",an.get(r.w)),an.get(r.v)||an.get(r.w)){if(ge.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=eTe(r.v),a=eTe(r.w),e.removeEdge(r.v,r.w,r.name),i!==r.v){const o=e.parent(i);an.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const o=e.parent(a);an.get(o).externalConnections=!0,n.toCluster=r.w}ge.warn("Fix Replacing with XXX",i,a,r.name),e.setEdge(i,a,n,r.name)}}),ge.warn("Adjusted Graph",Z2(e)),tTe(e,0),ge.trace(an)},"adjustClustersAndEdges"),tTe=O((e,t)=>{var i,a;if(ge.warn("extractor - ",t,Z2(e),e.children("D")),t>10){ge.error("Bailing out");return}let r=e.nodes(),n=!1;for(const o of r){const s=e.children(o);n=n||s.length>0}if(!n){ge.debug("Done, no node has children",e.nodes());return}ge.debug("Nodes = ",r,t);for(const o of r)if(ge.debug("Extracting node",o,an,an.has(o)&&!an.get(o).externalConnections,!e.parent(o),e.node(o),e.children("D")," Depth ",t),!an.has(o))ge.debug("Not a cluster",o,t);else if(!an.get(o).externalConnections&&e.children(o)&&e.children(o).length>0){ge.warn("Cluster without external connections, without a parent and with children",o,t);let l=e.graph().rankdir==="TB"?"LR":"TB";(a=(i=an.get(o))==null?void 0:i.clusterData)!=null&&a.dir&&(l=an.get(o).clusterData.dir,ge.warn("Fixing dir",an.get(o).clusterData.dir,l));const u=new Js({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});ge.warn("Old graph before copy",Z2(e)),Z8e(o,e,u,o),e.setNode(o,{clusterNode:!0,id:o,clusterData:an.get(o).clusterData,label:an.get(o).label,graph:u}),ge.warn("New graph after copy node: (",o,")",Z2(u)),ge.debug("Old graph after copy",Z2(e))}else ge.warn("Cluster ** ",o," **not meeting the criteria !externalConnections:",!an.get(o).externalConnections," no parent: ",!e.parent(o)," children ",e.children(o)&&e.children(o).length>0,e.children("D"),t),ge.debug(an);r=e.nodes(),ge.warn("New list of nodes",r);for(const o of r){const s=e.node(o);ge.warn(" Now next level",o,s),s!=null&&s.clusterNode&&tTe(s.graph,t+1)}},"extractor"),rTe=O((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(n=>{const i=e.children(n),a=rTe(e,i);r=[...r,...a]}),r},"sorter"),Evt=O(e=>rTe(e,e.children()),"sortNodesByHierarchy"),nTe=O(async(e,t,r,n,i,a)=>{ge.warn("Graph in recursive render:XAX",Z2(t),i);const o=t.graph().rankdir;ge.trace("Dir in recursive render - dir:",o);const s=e.insert("g").attr("class","root");t.nodes()?ge.info("Recursive render XXX",t.nodes()):ge.info("No nodes found for",t),t.edges().length>0&&ge.info("Recursive edges",t.edge(t.edges()[0]));const l=s.insert("g").attr("class","clusters"),u=s.insert("g").attr("class","edgePaths"),d=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(g){const v=t.node(g);if(i!==void 0){const m=JSON.parse(JSON.stringify(i.clusterData));ge.trace(`Setting data for parent cluster XXX
889
+ `))]))])])}}},[["__scopeId","data-v-285e7110"]]),z9t={__name:"FenceParser",props:{node:{type:Object,default:()=>null}},setup(e){const t=I.ref(""),r=I.ref("");return I.watch(()=>e.node,()=>{e.node&&v9(e.node,n=>{var i,a,o;n.type==="text"?t.value=n.value:n.type==="element"&&n.tagName==="code"&&(r.value=((o=(a=(i=n.properties)==null?void 0:i.className)==null?void 0:a[0])==null?void 0:o.replace("language-",""))||"")})},{immediate:!0}),(n,i)=>r.value==="mermaid"?(I.openBlock(),I.createBlock(G9t,{key:0,code:t.value},null,8,["code"])):(I.openBlock(),I.createBlock(b9t,{key:1,code:t.value,lang:r.value},null,8,["code","lang"]))}},q9t={class:"markdown-body"},Y9t=["href"],_x=Object.assign({name:"AiMdParser"},{__name:"MdParser",props:I.mergeDefaults({content:String},{content:""}),setup(e){function t(d){const h=[];let f=0;return d=d.replace(/\$\$([\s\S]*?)\$\$/g,p=>{const T=`__PROTECTED_MATH_BLOCK_${f}__`;return h[f]=p,f++,T}),d=d.replace(/\$([^\$\n]+?)\$/g,p=>{const T=`__PROTECTED_INLINE_MATH_${f}__`;return h[f]=p,f++,T}),d=d.replace(/```[\s\S]*?```/g,p=>{const T=`__PROTECTED_CODE_BLOCK_${f}__`;return h[f]=p,f++,T}),d=d.replace(/`([^`]+)`/g,p=>{const T=`__PROTECTED_INLINE_CODE_${f}__`;return h[f]=p,f++,T}),{markdown:d,protectedRegions:h}}function r(d,h){let f=d;return h.forEach((p,T)=>{let g="INLINE_CODE";p.includes("$$")?g="MATH_BLOCK":p.includes("$")?g="INLINE_MATH":p.includes("```")&&(g="CODE_BLOCK");const v=`__PROTECTED_${g}_${T}__`;f=f.split(v).join(p)}),f}function n(d){return d.replace(/\\n/g,`
890
+ `).replace(/\\r/g,"\r").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v")}function i(d){const{markdown:h,protectedRegions:f}=t(d),p=n(h);return r(p,f)}const a=/(?:https?:\/\/|www\.)?[a-zA-Z0-9][-a-zA-Z0-9.]+(?:\.[a-zA-Z]{2,})(?:\/[^\s\)\]\}\u4e00-\u9fa5()"'“”‘’}]*)?(?:\?[^\s\)\]\}\u4e00-\u9fa5()"'“”‘’}]*)?(?:#[^\s\)\]\}\u4e00-\u9fa5()"'“”‘’}]*)?/g;function o(d){return d.replace(a,h=>` ${h} `)}const s=d=>p2t(i,o)(d),l=I.computed(()=>s(e.content)),u={singleTilde:!1};return(d,h)=>{const f=I6;return I.openBlock(),I.createElementBlock("div",q9t,[I.createVNode(kB,{markdown:l.value,remarkPlugins:[[I.unref(J3t),u],I.unref(p4t),I.unref(r4t),I.unref(f4t)],rehypePlugins:[I.unref(Wdt),I.unref(mht),I.unref(n8t)]},{a:I.withCtx(({node:p})=>{var T;return[I.createElementVNode("a",{href:p.properties.href,target:"_blank",rel:"noopener noreferrer"},I.toDisplayString((T=p.children[0])==null?void 0:T.value),9,Y9t)]}),pre:I.withCtx(({node:p})=>[I.createVNode(z9t,{node:p},null,8,["node"])]),img:I.withCtx(({node:p})=>[I.createVNode(f,{src:p.properties.src,previewMask:!1,style:{cursor:"pointer"}},null,8,["src"])]),_:1},8,["markdown","remarkPlugins","rehypePlugins"])])}}}),W9t={key:0,class:"ai-chat-record-avatar"},j9t={class:"ai-chat-record-wrap"},X9t={class:"ai-chat-record-head"},K9t={key:0,class:"ai-chat-record-time"},Z9t={class:"ai-chat-record-body"},J9t={key:0,class:"ai-chat-record-loading-wrap"},egt={key:1,class:"ai-chat-record-content"},tgt={class:"ai-chat-record-content-before"},rgt={class:"ai-chat-record-content-inner"},ngt={class:"ai-chat-record-content-after"},igt={key:0,class:"character-count"},agt={key:0,class:"ai-chat-record-foot"},ogt={class:"foot-actions"},sgt={key:0,class:"copy-tooltip-inner"},lgt={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},p8e=ta(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(e,{expose:t,emit:r}){const n={Loading:"loading",Generating:"generating",Done:"done"},i=e,a=r,o=I.ref(),s=I.ref(!0),l=I.ref(!1),u=I.computed(()=>S0e(i.time,i.timeFormat)),d=I.computed(()=>{var f,p;if(i.status==="done"){let T=(p=(f=o.value)==null?void 0:f.querySelector(".ai-chat-record-content-inner"))==null?void 0:p.innerText;return(T==null?void 0:T.length)??0}else return 0});function h(){var T;let f=(T=o.value)==null?void 0:T.querySelector(".ai-chat-record-content-inner");if(!f)return;function p(){i.copyTipType==="message"?s.value?na.success("\u590D\u5236\u6210\u529F"):na.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}C0e(f).then(()=>{s.value=!0,p()}).catch(()=>{s.value=!1,p()})}return t({statusEnum:n}),(f,p)=>{const T=Xh,g=X8;return I.openBlock(),I.createElementBlock("div",{ref_key:"elRef",ref:o,class:I.normalizeClass(["ai-chat-record",{"ai-chat-record--r":e.pos==="r","ai-chat-record--full-width":e.fullWidth,"ai-chat-record--show-time":e.showTime}])},[e.showAvatar?(I.openBlock(),I.createElementBlock("div",W9t,[I.renderSlot(f.$slots,"avatar",{},()=>[I.createVNode(T,{size:40,src:e.avatar},{icon:I.withCtx(()=>p[1]||(p[1]=[])),_:1},8,["src"])],!0)])):I.createCommentVNode("",!0),I.createElementVNode("div",j9t,[I.createElementVNode("div",X9t,[I.renderSlot(f.$slots,"head",{},()=>[e.showTime?(I.openBlock(),I.createElementBlock("div",K9t,[I.renderSlot(f.$slots,"time",{time:u.value},()=>[I.createTextVNode(I.toDisplayString(u.value),1)],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"headRight",{},void 0,!0)],!0)]),I.createElementVNode("div",Z9t,[e.status===n.Loading?(I.openBlock(),I.createElementBlock("div",J9t,[I.renderSlot(f.$slots,"loading",{},()=>[I.createVNode(f2t,{theme:e.pos==="r"?"light":"",message:e.loadingMessage},null,8,["theme","message"])],!0)])):(I.openBlock(),I.createElementBlock("div",egt,[I.createElementVNode("div",tgt,[I.renderSlot(f.$slots,"contentBefore",{},void 0,!0)]),I.createElementVNode("div",rgt,[I.renderSlot(f.$slots,"content",{},()=>[I.createVNode(_x,{content:e.content},null,8,["content"])],!0)]),I.createElementVNode("div",ngt,[I.renderSlot(f.$slots,"contentAfter",{},void 0,!0)]),e.showCharacterCount&&e.status===n.Done?(I.openBlock(),I.createElementBlock("div",igt,[I.renderSlot(f.$slots,"characterCountBefore",{},void 0,!0),I.renderSlot(f.$slots,"characterCount",{},()=>[I.withDirectives(I.createElementVNode("span",null,"\u5171"+I.toDisplayString(d.value)+"\u4E2A\u5B57\u7B26",513),[[I.vShow,d.value]])],!0),I.renderSlot(f.$slots,"characterCountAfter",{},void 0,!0)])):I.createCommentVNode("",!0)]))]),e.showFoot?(I.openBlock(),I.createElementBlock("div",agt,[I.renderSlot(f.$slots,"foot",{},()=>[I.createElementVNode("div",ogt,[I.renderSlot(f.$slots,"actionsBefore",{},void 0,!0),I.renderSlot(f.$slots,"actions",{},()=>[I.createVNode(g,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:I.withCtx(()=>[s.value?(I.openBlock(),I.createElementBlock("span",sgt,[I.createVNode(I.unref(R6),{class:"copy-tooltip-icon"}),p[2]||(p[2]=I.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(I.openBlock(),I.createElementBlock("span",lgt,[I.createVNode(I.unref(X_),{class:"copy-tooltip-icon"}),p[3]||(p[3]=I.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:I.withCtx(()=>[e.status===n.Done&&e.actions.includes("copy")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:h},p[4]||(p[4]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1),I.createTextVNode(" \u590D\u5236 ")]))):I.createCommentVNode("",!0)]),_:1},8,["open"]),e.status===n.Done&&e.actions.includes("regenerate")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:p[0]||(p[0]=v=>a("regenerate"))},p[5]||(p[5]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1),I.createTextVNode(" \u91CD\u65B0\u751F\u6210 ")]))):I.createCommentVNode("",!0)],!0),I.renderSlot(f.$slots,"actionsAfter",{},void 0,!0)])],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-b789f5b0"]]);var T8e=11;function cgt(e,t){var r=t.attributes,n,i,a,o,s;if(!(t.nodeType===T8e||e.nodeType===T8e)){for(var l=r.length-1;l>=0;l--)n=r[l],i=n.name,a=n.namespaceURI,o=n.value,a?(i=n.localName||i,s=e.getAttributeNS(a,i),s!==o&&(n.prefix==="xmlns"&&(i=n.name),e.setAttributeNS(a,i,o))):(s=e.getAttribute(i),s!==o&&e.setAttribute(i,o));for(var u=e.attributes,d=u.length-1;d>=0;d--)n=u[d],i=n.name,a=n.namespaceURI,a?(i=n.localName||i,t.hasAttributeNS(a,i)||e.removeAttributeNS(a,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Qx,ugt="http://www.w3.org/1999/xhtml",Zs=typeof document>"u"?void 0:document,dgt=!!Zs&&"content"in Zs.createElement("template"),hgt=!!Zs&&Zs.createRange&&"createContextualFragment"in Zs.createRange();function fgt(e){var t=Zs.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function pgt(e){Qx||(Qx=Zs.createRange(),Qx.selectNode(Zs.body));var t=Qx.createContextualFragment(e);return t.childNodes[0]}function Tgt(e){var t=Zs.createElement("body");return t.innerHTML=e,t.childNodes[0]}function ggt(e){return e=e.trim(),dgt?fgt(e):hgt?pgt(e):Tgt(e)}function bx(e,t){var r=e.nodeName,n=t.nodeName,i,a;return r===n?!0:(i=r.charCodeAt(0),a=n.charCodeAt(0),i<=90&&a>=97?r===n.toUpperCase():a<=90&&i>=97?n===r.toUpperCase():!1)}function mgt(e,t){return!t||t===ugt?Zs.createElement(e):Zs.createElementNS(t,e)}function vgt(e,t){for(var r=e.firstChild;r;){var n=r.nextSibling;t.appendChild(r),r=n}return t}function BB(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var g8e={OPTION:function(e,t){var r=e.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}BB(e,t,"selected")},INPUT:function(e,t){BB(e,t,"checked"),BB(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var n=e.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==e.placeholder)return;n.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r=-1,n=0,i=e.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild;else{if(o==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}e.selectedIndex=r}}},Cm=1,m8e=11,v8e=3,y8e=8;function y4(){}function ygt(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function _gt(e){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var a=n;n=Zs.createElement("html"),n.innerHTML=a}else n=ggt(n);else n.nodeType===m8e&&(n=n.firstElementChild);var o=i.getNodeKey||ygt,s=i.onBeforeNodeAdded||y4,l=i.onNodeAdded||y4,u=i.onBeforeElUpdated||y4,d=i.onElUpdated||y4,h=i.onBeforeNodeDiscarded||y4,f=i.onNodeDiscarded||y4,p=i.onBeforeElChildrenUpdated||y4,T=i.skipFromChildren||y4,g=i.addChild||function(F,k){return F.appendChild(k)},v=i.childrenOnly===!0,m=Object.create(null),y=[];function _(F){y.push(F)}function E(F,k){if(F.nodeType===Cm)for(var V=F.firstChild;V;){var B=void 0;k&&(B=o(V))?_(B):(f(V),V.firstChild&&E(V,k)),V=V.nextSibling}}function Q(F,k,V){h(F)!==!1&&(k&&k.removeChild(F),f(F),E(F,V))}function b(F){if(F.nodeType===Cm||F.nodeType===m8e)for(var k=F.firstChild;k;){var V=o(k);V&&(m[V]=k),b(k),k=k.nextSibling}}b(r);function x(F){l(F);for(var k=F.firstChild;k;){var V=k.nextSibling,B=o(k);if(B){var $=m[B];$&&bx(k,$)?(k.parentNode.replaceChild($,k),C($,k)):x(k)}else x(k);k=V}}function S(F,k,V){for(;k;){var B=k.nextSibling;(V=o(k))?_(V):Q(k,F,!0),k=B}}function C(F,k,V){var B=o(k);if(B&&delete m[B],!V){var $=u(F,k);if($===!1||($ instanceof HTMLElement&&(F=$,b(F)),e(F,k),d(F),p(F,k)===!1))return}F.nodeName!=="TEXTAREA"?A(F,k):g8e.TEXTAREA(F,k)}function A(F,k){var V=T(F,k),B=k.firstChild,$=F.firstChild,z,G,J,ie,re;e:for(;B;){for(ie=B.nextSibling,z=o(B);!V&&$;){if(J=$.nextSibling,B.isSameNode&&B.isSameNode($)){B=ie,$=J;continue e}G=o($);var j=$.nodeType,oe=void 0;if(j===B.nodeType&&(j===Cm?(z?z!==G&&((re=m[z])?J===re?oe=!1:(F.insertBefore(re,$),G?_(G):Q($,F,!0),$=re,G=o($)):oe=!1):G&&(oe=!1),oe=oe!==!1&&bx($,B),oe&&C($,B)):(j===v8e||j==y8e)&&(oe=!0,$.nodeValue!==B.nodeValue&&($.nodeValue=B.nodeValue))),oe){B=ie,$=J;continue e}G?_(G):Q($,F,!0),$=J}if(z&&(re=m[z])&&bx(re,B))V||g(F,re),C(re,B);else{var ee=s(B);ee!==!1&&(ee&&(B=ee),B.actualize&&(B=B.actualize(F.ownerDocument||Zs)),g(F,B),x(B))}B=ie,$=J}S(F,$,G);var X=g8e[F.nodeName];X&&X(F,k)}var w=r,N=w.nodeType,P=n.nodeType;if(!v){if(N===Cm)P===Cm?bx(r,n)||(f(r),w=vgt(r,mgt(n.nodeName,n.namespaceURI))):w=n;else if(N===v8e||N===y8e){if(P===N)return w.nodeValue!==n.nodeValue&&(w.nodeValue=n.nodeValue),w;w=n}}if(w===n)f(r);else{if(n.isSameNode&&n.isSameNode(w))return;if(C(w,n,v),y)for(var R=0,M=y.length;R<M;R++){var H=m[y[R]];H&&Q(H,H.parentNode,!1)}}return!v&&w!==r&&r.parentNode&&(w.actualize&&(w=w.actualize(r.ownerDocument||Zs)),r.parentNode.replaceChild(w,r)),w}}var Qgt=_gt(cgt);const bgt={key:1,class:"ai-content-parser-inner"},_8e=Object.assign({name:"AiContentParser"},{__name:"ContentParser",props:{type:{type:String,default:"text"},content:String,stream:{type:Boolean,default:!1},streamDone:{type:Boolean,default:!1}},setup(e){const t=e,r=I.ref(null),n=I.ref("");return I.onMounted(()=>{I.watch(()=>t.content,()=>{if(n.value=t.type==="markdown"?L0e.parse(t.content):t.content,t.type==="markdown"||t.type==="html"){const i=document.createElement("div");i.innerHTML=n.value,i.classList.add("ai-content-parser-inner"),Qgt(r.value,i)}},{immediate:!0})}),(i,a)=>(I.openBlock(),I.createElementBlock("div",{class:I.normalizeClass(["ai-content-parser",`ai-content-parser--${e.type}`])},[e.type==="html"||e.type==="markdown"?(I.openBlock(),I.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"ai-content-parser-inner"},null,512)):(I.openBlock(),I.createElementBlock("div",bgt,I.toDisplayString(n.value),1))],2))}}),Egt={class:"ai-think-parser"},xgt={class:"ai-think-parser-content"},Q8e=ta(Object.assign({name:"AiThinkParser"},{__name:"ThinkParser",setup(e){return(t,r)=>(I.openBlock(),I.createElementBlock("div",Egt,[I.createElementVNode("div",xgt,[I.renderSlot(t.$slots,"content",{},()=>[I.createVNode(_x,I.normalizeProps(I.guardReactiveProps(t.$attrs)),null,16)],!0)])]))}}),[["__scopeId","data-v-70d4677e"]]),Sgt=e=>{const t=()=>{r.bottom&&s({behavior:"instant"})},{arrivedState:r,measure:n}=B9t(e,{offset:{bottom:50,top:50}}),{stop:i}=P9t(e,t,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),{stop:a}=H9t(e,t),o=I.computed(()=>s7(e)),s=({behavior:l="smooth"}={})=>{if(o.value)try{o.value.scrollTo({top:o.value.scrollHeight,behavior:l})}catch{o.value.scrollTop=o.value.scrollHeight}};return I.onMounted(()=>{I.nextTick(()=>{s({behavior:"instant"})})}),I.onUnmounted(()=>{i(),a()}),{scrollToBottom:s,arrivedState:r,measure:n}},Cgt=[Xq,FJ,VJ,$J,p8e,_8e,_x,Q8e,kB],b8e=(e,t={})=>{Cgt.forEach(r=>{e.component(r.name,r)})};typeof window<"u"&&window.Vue&&b8e(window.Vue);const Lgt={install:b8e};var Agt="\0",hd="\0",E8e="";class Js{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=$h(void 0),this._defaultEdgeLabelFn=$h(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[hd]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return S1(t)||(t=$h(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return La(this._nodes)}sources(){var t=this;return Yi(this.nodes(),function(r){return On(t._in[r])})}sinks(){var t=this;return Yi(this.nodes(),function(r){return On(t._out[r])})}setNodes(t,r){var n=arguments,i=this;return at(t,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=hd,this._children[t]={},this._children[hd][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],at(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),at(La(this._in[t]),r),delete this._in[t],delete this._preds[t],at(La(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Hn(r))r=hd;else{r+="";for(var n=r;!Hn(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==hd)return r}}children(t){if(Hn(t)&&(t=hd),this._isCompound){var r=this._children[t];if(r)return La(r)}else{if(t===hd)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return La(r)}successors(t){var r=this._sucs[t];if(r)return La(r)}neighbors(t){var r=this.predecessors(t);if(r)return _Be(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;at(this._nodes,function(o,s){t(s)&&r.setNode(s,o)}),at(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var s=n.parent(o);return s===void 0||r.hasNode(s)?(i[o]=s,s):s in i?i[s]:a(s)}return this._isCompound&&at(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(t){return S1(t)||(t=$h(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return ei(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return ma(t,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var t,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(t=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(t=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,r=""+r,Hn(n)||(n=""+n);var s=Lm(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!Hn(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(t,r,n);var l=wgt(this._isDirected,t,r,n);return t=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,x8e(this._preds[r],t),x8e(this._sucs[t],r),this._in[r][s]=l,this._out[t][s]=l,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?FB(this._isDirected,arguments[0]):Lm(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?FB(this._isDirected,arguments[0]):Lm(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?FB(this._isDirected,arguments[0]):Lm(this._isDirected,t,r,n),a=this._edgeObjs[i];return a&&(t=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],S8e(this._preds[r],t),S8e(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=ei(n);return r?Yi(i,function(a){return a.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=ei(n);return r?Yi(i,function(a){return a.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}}Js.prototype._nodeCount=0,Js.prototype._edgeCount=0;function x8e(e,t){e[t]?e[t]++:e[t]=1}function S8e(e,t){--e[t]||delete e[t]}function Lm(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}return i+E8e+a+E8e+(Hn(n)?Agt:n)}function wgt(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function FB(e,t){return Lm(e,t.v,t.w,t.name)}class Ogt{constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,r=t._prev;if(r!==t)return C8e(r),r}enqueue(t){var r=this._sentinel;t._prev&&t._next&&C8e(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){for(var t=[],r=this._sentinel,n=r._prev;n!==r;)t.push(JSON.stringify(n,Rgt)),n=n._prev;return"["+t.join(", ")+"]"}}function C8e(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Rgt(e,t){if(e!=="_next"&&e!=="_prev")return t}var Ngt=$h(1);function Mgt(e,t){if(e.nodeCount()<=1)return[];var r=Dgt(e,t||Ngt),n=Igt(r.graph,r.buckets,r.zeroIdx);return eo(Wt(n,function(i){return e.outEdges(i.v,i.w)}))}function Igt(e,t,r){for(var n=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)VB(e,t,r,o);for(;o=i.dequeue();)VB(e,t,r,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){n=n.concat(VB(e,t,r,o,!0));break}}}return n}function VB(e,t,r,n,i){var a=i?[]:void 0;return at(e.inEdges(n.v),function(o){var s=e.edge(o),l=e.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,$B(t,r,l)}),at(e.outEdges(n.v),function(o){var s=e.edge(o),l=o.w,u=e.node(l);u.in-=s,$B(t,r,u)}),e.removeNode(n.v),a}function Dgt(e,t){var r=new Js,n=0,i=0;at(e.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),at(e.edges(),function(s){var l=r.edge(s.v,s.w)||0,u=t(s),d=l+u;r.setEdge(s.v,s.w,d),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=qh(i+n+3).map(function(){return new Ogt}),o=n+1;return at(r.nodes(),function(s){$B(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function $B(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function kgt(e){var t=e.graph().acyclicer==="greedy"?Mgt(e,r(e)):Pgt(e);at(t,function(n){var i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,fO("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function Pgt(e){var t=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,at(e.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?t.push(o):i(o.w)}),delete r[a])}return at(e.nodes(),i),t}function Hgt(e){at(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}function l7(e,t,r,n){var i;do i=fO(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function Bgt(e){var t=new Js().setGraph(e.graph());return at(e.nodes(),function(r){t.setNode(r,e.node(r))}),at(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function L8e(e){var t=new Js({multigraph:e.isMultigraph()}).setGraph(e.graph());return at(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),at(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function A8e(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,s=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:r+l,y:n+u}}function Ex(e){var t=Wt(qh(O8e(e)+1),function(){return[]});return at(e.nodes(),function(r){var n=e.node(r),i=n.rank;Hn(i)||(t[i][n.order]=r)}),t}function Fgt(e){var t=zh(Wt(e.nodes(),function(r){return e.node(r).rank}));at(e.nodes(),function(r){var n=e.node(r);Ar(n,"rank")&&(n.rank-=t)})}function Vgt(e){var t=zh(Wt(e.nodes(),function(a){return e.node(a).rank})),r=[];at(e.nodes(),function(a){var o=e.node(a).rank-t;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=e.graph().nodeRankFactor;at(r,function(a,o){Hn(a)&&o%i!==0?--n:n&&at(a,function(s){e.node(s).rank+=n})})}function w8e(e,t,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),l7(e,"border",i,t)}function O8e(e){return O6(Wt(e.nodes(),function(t){var r=e.node(t).rank;if(!Hn(r))return r}))}function $gt(e,t){var r={lhs:[],rhs:[]};return at(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Ugt(e,t){return t()}function Ggt(e){function t(r){var n=e.children(r),i=e.node(r);if(n.length&&at(n,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)R8e(e,"borderLeft","_bl",r,i,a),R8e(e,"borderRight","_br",r,i,a)}}at(e.children(),t)}function R8e(e,t,r,n,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],l=l7(e,"border",o,r);i[t][a]=l,e.setParent(l,n),s&&e.setEdge(s,l,{weight:1})}function zgt(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&N8e(e)}function qgt(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&Ygt(e),(t==="lr"||t==="rl")&&(Wgt(e),N8e(e))}function N8e(e){at(e.nodes(),function(t){M8e(e.node(t))}),at(e.edges(),function(t){M8e(e.edge(t))})}function M8e(e){var t=e.width;e.width=e.height,e.height=t}function Ygt(e){at(e.nodes(),function(t){UB(e.node(t))}),at(e.edges(),function(t){var r=e.edge(t);at(r.points,UB),Object.prototype.hasOwnProperty.call(r,"y")&&UB(r)})}function UB(e){e.y=-e.y}function Wgt(e){at(e.nodes(),function(t){GB(e.node(t))}),at(e.edges(),function(t){var r=e.edge(t);at(r.points,GB),Object.prototype.hasOwnProperty.call(r,"x")&&GB(r)})}function GB(e){var t=e.x;e.x=e.y,e.y=t}function jgt(e){e.graph().dummyChains=[],at(e.edges(),function(t){Xgt(e,t)})}function Xgt(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),l=s.labelRank;if(a!==n+1){e.removeEdge(t);var u=void 0,d,h;for(h=0,++n;n<a;++h,++n)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:n},d=l7(e,"edge",u,"_d"),n===l&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),e.setEdge(r,d,{weight:s.weight},o),h===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:s.weight},o)}}function Kgt(e){at(e.graph().dummyChains,function(t){var r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=i,r=e.node(t)})}function zB(e){var t={};function r(n){var i=e.node(n);if(Object.prototype.hasOwnProperty.call(t,n))return i.rank;t[n]=!0;var a=zh(Wt(e.outEdges(n),function(o){return r(o.w)-e.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}at(e.sources(),r)}function Am(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function I8e(e){var t=new Js({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,a;Zgt(t,e)<n;)i=Jgt(t,e),a=t.hasNode(i.v)?Am(e,i):-Am(e,i),emt(t,e,a);return t}function Zgt(e,t){function r(n){at(t.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;!e.hasNode(o)&&!Am(t,i)&&(e.setNode(o,{}),e.setEdge(n,o,{}),r(o))})}return at(e.nodes(),r),e.nodeCount()}function Jgt(e,t){return dO(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Am(t,r)})}function emt(e,t,r){at(e.nodes(),function(n){t.node(n).rank+=r})}function tmt(){}tmt.prototype=new Error;function D8e(e,t,r){pn(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return at(t,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);k8e(e,o,r==="post",a,n,i)}),i}function k8e(e,t,r,n,i,a){Object.prototype.hasOwnProperty.call(n,t)||(n[t]=!0,r||a.push(t),at(i(t),function(o){k8e(e,o,r,n,i,a)}),r&&a.push(t))}function rmt(e,t){return D8e(e,t,"post")}function nmt(e,t){return D8e(e,t,"pre")}fd.initLowLimValues=YB,fd.initCutValues=qB,fd.calcCutValue=P8e,fd.leaveEdge=B8e,fd.enterEdge=F8e,fd.exchangeEdges=V8e;function fd(e){e=Bgt(e),zB(e);var t=I8e(e);YB(t),qB(t,e);for(var r,n;r=B8e(t);)n=F8e(t,e,r),V8e(t,e,r,n)}function qB(e,t){var r=rmt(e,e.nodes());r=r.slice(0,r.length-1),at(r,function(n){imt(e,t,n)})}function imt(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=P8e(e,t,r)}function P8e(e,t,r){var n=e.node(r),i=n.parent,a=!0,o=t.edge(r,i),s=0;return o||(a=!1,o=t.edge(i,r)),s=o.weight,at(t.nodeEdges(r),function(l){var u=l.v===r,d=u?l.w:l.v;if(d!==i){var h=u===a,f=t.edge(l).weight;if(s+=h?f:-f,omt(e,r,d)){var p=e.edge(r,d).cutvalue;s+=h?-p:p}}}),s}function YB(e,t){arguments.length<2&&(t=e.nodes()[0]),H8e(e,{},1,t)}function H8e(e,t,r,n,i){var a=r,o=e.node(n);return t[n]=!0,at(e.neighbors(n),function(s){Object.prototype.hasOwnProperty.call(t,s)||(r=H8e(e,t,r,s,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function B8e(e){return Cu(e.edges(),function(t){return e.edge(t).cutvalue<0})}function F8e(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var a=e.node(n),o=e.node(i),s=a,l=!1;a.lim>o.lim&&(s=o,l=!0);var u=Yi(t.edges(),function(d){return l===$8e(e,e.node(d.v),s)&&l!==$8e(e,e.node(d.w),s)});return dO(u,function(d){return Am(t,d)})}function V8e(e,t,r,n){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(n.v,n.w,{}),YB(e),qB(e,t),amt(e,t)}function amt(e,t){var r=Cu(e.nodes(),function(i){return!t.node(i).parent}),n=nmt(e,r);n=n.slice(1),at(n,function(i){var a=e.node(i).parent,o=t.edge(i,a),s=!1;o||(o=t.edge(a,i),s=!0),t.node(i).rank=t.node(a).rank+(s?o.minlen:-o.minlen)})}function omt(e,t,r){return e.hasEdge(t,r)}function $8e(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}function smt(e){switch(e.graph().ranker){case"network-simplex":U8e(e);break;case"tight-tree":cmt(e);break;case"longest-path":lmt(e);break;default:U8e(e)}}var lmt=zB;function cmt(e){zB(e),I8e(e)}function U8e(e){fd(e)}function umt(e){var t=l7(e,"root",{},"_root"),r=dmt(e),n=O6(ei(r))-1,i=2*n+1;e.graph().nestingRoot=t,at(e.edges(),function(o){e.edge(o).minlen*=i});var a=hmt(e)+1;at(e.children(),function(o){G8e(e,t,i,a,n,r,o)}),e.graph().nodeRankFactor=i}function G8e(e,t,r,n,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:r});return}var l=w8e(e,"_bt"),u=w8e(e,"_bb"),d=e.node(o);e.setParent(l,o),d.borderTop=l,e.setParent(u,o),d.borderBottom=u,at(s,function(h){G8e(e,t,r,n,i,a,h);var f=e.node(h),p=f.borderTop?f.borderTop:h,T=f.borderBottom?f.borderBottom:h,g=f.borderTop?n:2*n,v=p!==T?1:i-a[o]+1;e.setEdge(l,p,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(T,u,{weight:g,minlen:v,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,l,{weight:0,minlen:i+a[o]})}function dmt(e){var t={};function r(n,i){var a=e.children(n);a&&a.length&&at(a,function(o){r(o,i+1)}),t[n]=i}return at(e.children(),function(n){r(n,1)}),t}function hmt(e){return ma(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function fmt(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,at(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}function pmt(e,t,r){var n={},i;at(r,function(a){for(var o=e.parent(a),s,l;o;){if(s=e.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){t.setEdge(l,o);return}o=s}})}function Tmt(e,t,r){var n=gmt(e),i=new Js({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return e.node(a)});return at(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),at(e[r](a),function(l){var u=l.v===a?l.w:l.v,d=i.edge(u,a),h=Hn(d)?0:d.weight;i.setEdge(u,a,{weight:e.edge(l).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function gmt(e){for(var t;e.hasNode(t=fO("_root")););return t}function mmt(e,t){for(var r=0,n=1;n<t.length;++n)r+=vmt(e,t[n-1],t[n]);return r}function vmt(e,t,r){for(var n=xBe(r,Wt(r,function(u,d){return d})),i=eo(Wt(t,function(u){return W8(Wt(e.outEdges(u),function(d){return{pos:n[d.w],weight:e.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var o=2*a-1;a-=1;var s=Wt(new Array(o),function(){return 0}),l=0;return at(i.forEach(function(u){var d=u.pos+a;s[d]+=u.weight;for(var h=0;d>0;)d%2&&(h+=s[d+1]),d=d-1>>1,s[d]+=u.weight;l+=u.weight*h})),l}function ymt(e){var t={},r=Yi(e.nodes(),function(s){return!e.children(s).length}),n=O6(Wt(r,function(s){return e.node(s).rank})),i=Wt(qh(n+1),function(){return[]});function a(s){if(!Ar(t,s)){t[s]=!0;var l=e.node(s);i[l.rank].push(s),at(e.successors(s),a)}}var o=W8(r,function(s){return e.node(s).rank});return at(o,a),i}function _mt(e,t){return Wt(t,function(r){var n=e.inEdges(r);if(n.length){var i=ma(n,function(a,o){var s=e.edge(o),l=e.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Qmt(e,t){var r={};at(e,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Hn(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),at(t.edges(),function(i){var a=r[i.v],o=r[i.w];!Hn(a)&&!Hn(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=Yi(r,function(i){return!i.indegree});return bmt(n)}function bmt(e){var t=[];function r(a){return function(o){o.merged||(Hn(o.barycenter)||Hn(a.barycenter)||o.barycenter>=a.barycenter)&&Emt(a,o)}}function n(a){return function(o){o.in.push(a),--o.indegree===0&&e.push(o)}}for(;e.length;){var i=e.pop();t.push(i),at(i.in.reverse(),r(i)),at(i.out,n(i))}return Wt(Yi(t,function(a){return!a.merged}),function(a){return z_(a,["vs","i","barycenter","weight"])})}function Emt(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}function xmt(e,t){var r=$gt(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=W8(r.rhs,function(d){return-d.i}),a=[],o=0,s=0,l=0;n.sort(Smt(!!t)),l=z8e(a,i,l),at(n,function(d){l+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,s+=d.weight,l=z8e(a,i,l)});var u={vs:eo(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function z8e(e,t,r){for(var n;t.length&&(n=w2(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Smt(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}function q8e(e,t,r,n){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=Yi(i,function(T){return T!==o&&T!==s}));var u=_mt(e,i);at(u,function(T){if(e.children(T.v).length){var g=q8e(e,T.v,r,n);l[T.v]=g,Object.prototype.hasOwnProperty.call(g,"barycenter")&&Lmt(T,g)}});var d=Qmt(u,r);Cmt(d,l);var h=xmt(d,n);if(o&&(h.vs=eo([o,h.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+p.order)/(h.weight+2),h.weight+=2}return h}function Cmt(e,t){at(e,function(r){r.vs=eo(r.vs.map(function(n){return t[n]?t[n].vs:n}))})}function Lmt(e,t){Hn(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Amt(e){var t=O8e(e),r=Y8e(e,qh(1,t+1),"inEdges"),n=Y8e(e,qh(t-1,-1,-1),"outEdges"),i=ymt(e);W8e(e,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){wmt(s%2?r:n,s%4>=2),i=Ex(e);var u=mmt(e,i);u<a&&(l=0,o=cHe(i),a=u)}W8e(e,o)}function Y8e(e,t,r){return Wt(t,function(n){return Tmt(e,n,r)})}function wmt(e,t){var r=new Js;at(e,function(n){var i=n.graph().root,a=q8e(n,i,r,t);at(a.vs,function(o,s){n.node(o).order=s}),pmt(n,r,a.vs)})}function W8e(e,t){at(t,function(r){at(r,function(n,i){e.node(n).order=i})})}function Omt(e){var t=Nmt(e);at(e.graph().dummyChains,function(r){for(var n=e.node(r),i=n.edgeObj,a=Rmt(e,t,i.v,i.w),o=a.path,s=a.lca,l=0,u=o[l],d=!0;r!==i.w;){if(n=e.node(r),d){for(;(u=o[l])!==s&&e.node(u).maxRank<n.rank;)l++;u===s&&(d=!1)}if(!d){for(;l<o.length-1&&e.node(u=o[l+1]).minRank<=n.rank;)l++;u=o[l]}e.setParent(r,u),r=e.successors(r)[0]}})}function Rmt(e,t,r,n){var i=[],a=[],o=Math.min(t[r].low,t[n].low),s=Math.max(t[r].lim,t[n].lim),l,u;l=r;do l=e.parent(l),i.push(l);while(l&&(t[l].low>o||s>t[l].lim));for(u=l,l=n;(l=e.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function Nmt(e){var t={},r=0;function n(i){var a=r;at(e.children(i),n),t[i]={low:a,lim:r++}}return at(e.children(),n),t}function Mmt(e,t){var r={};function n(i,a){var o=0,s=0,l=i.length,u=w2(a);return at(a,function(d,h){var f=Dmt(e,d),p=f?e.node(f).order:l;(f||d===u)&&(at(a.slice(s,h+1),function(T){at(e.predecessors(T),function(g){var v=e.node(g),m=v.order;(m<o||p<m)&&!(v.dummy&&e.node(T).dummy)&&j8e(r,g,T)})}),s=h+1,o=p)}),a}return ma(t,n),r}function Imt(e,t){var r={};function n(a,o,s,l,u){var d;at(qh(o,s),function(h){d=a[h],e.node(d).dummy&&at(e.predecessors(d),function(f){var p=e.node(f);p.dummy&&(p.order<l||p.order>u)&&j8e(r,f,d)})})}function i(a,o){var s=-1,l,u=0;return at(o,function(d,h){if(e.node(d).dummy==="border"){var f=e.predecessors(d);f.length&&(l=e.node(f[0]).order,n(o,u,h,s,l),u=h,s=l)}n(o,u,o.length,l,a.length)}),o}return ma(t,i),r}function Dmt(e,t){if(e.node(t).dummy)return Cu(e.predecessors(t),function(r){return e.node(r).dummy})}function j8e(e,t,r){if(t>r){var n=t;t=r,r=n}var i=e[t];i||(e[t]=i={}),i[r]=!0}function kmt(e,t,r){if(t>r){var n=t;t=r,r=n}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],r)}function Pmt(e,t,r,n){var i={},a={},o={};return at(t,function(s){at(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),at(t,function(s){var l=-1;at(s,function(u){var d=n(u);if(d.length){d=W8(d,function(g){return o[g]});for(var h=(d.length-1)/2,f=Math.floor(h),p=Math.ceil(h);f<=p;++f){var T=d[f];a[u]===u&&l<o[T]&&!kmt(r,u,T)&&(a[T]=u,a[u]=i[u]=i[T],l=o[T])}}})}),{root:i,align:a}}function Hmt(e,t,r,n,i){var a={},o=Bmt(e,t,r,i),s=i?"borderLeft":"borderRight";function l(h,f){for(var p=o.nodes(),T=p.pop(),g={};T;)g[T]?h(T):(g[T]=!0,p.push(T),p=p.concat(f(T))),T=p.pop()}function u(h){a[h]=o.inEdges(h).reduce(function(f,p){return Math.max(f,a[p.v]+o.edge(p))},0)}function d(h){var f=o.outEdges(h).reduce(function(T,g){return Math.min(T,a[g.w]-o.edge(g))},Number.POSITIVE_INFINITY),p=e.node(h);f!==Number.POSITIVE_INFINITY&&p.borderType!==s&&(a[h]=Math.max(a[h],f))}return l(u,o.predecessors.bind(o)),l(d,o.successors.bind(o)),at(n,function(h){a[h]=a[r[h]]}),a}function Bmt(e,t,r,n){var i=new Js,a=e.graph(),o=Gmt(a.nodesep,a.edgesep,n);return at(t,function(s){var l;at(s,function(u){var d=r[u];if(i.setNode(d),l){var h=r[l],f=i.edge(h,d);i.setEdge(h,d,Math.max(o(e,u,l),f||0))}l=u})}),i}function Fmt(e,t){return dO(ei(t),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return PHe(r,function(a,o){var s=zmt(e,o)/2;n=Math.max(a+s,n),i=Math.min(a-s,i)}),n-i})}function Vmt(e,t){var r=ei(t),n=zh(r),i=O6(r);at(["u","d"],function(a){at(["l","r"],function(o){var s=a+o,l=e[s],u;if(l!==t){var d=ei(l);u=o==="l"?n-zh(d):i-O6(d),u&&(e[s]=U_(l,function(h){return h+u}))}})})}function $mt(e,t){return U_(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var i=W8(Wt(e,n));return(i[1]+i[2])/2})}function Umt(e){var t=Ex(e),r=G_(Mmt(e,t),Imt(e,t)),n={},i;at(["u","d"],function(o){i=o==="u"?t:ei(t).reverse(),at(["l","r"],function(s){s==="r"&&(i=Wt(i,function(h){return ei(h).reverse()}));var l=(o==="u"?e.predecessors:e.successors).bind(e),u=Pmt(e,i,r,l),d=Hmt(e,i,u.root,u.align,s==="r");s==="r"&&(d=U_(d,function(h){return-h})),n[o+s]=d})});var a=Fmt(e,n);return Vmt(n,a),$mt(n,e.graph().align)}function Gmt(e,t,r){return function(n,i,a){var o=n.node(i),s=n.node(a),l=0,u;if(l+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(l+=r?u:-u),u=0,l+=(o.dummy?t:e)/2,l+=(s.dummy?t:e)/2,l+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(l+=r?u:-u),u=0,l}}function zmt(e,t){return e.node(t).width}function qmt(e){e=L8e(e),Ymt(e),HHe(Umt(e),function(t,r){e.node(r).x=t})}function Ymt(e){var t=Ex(e),r=e.graph().ranksep,n=0;at(t,function(i){var a=O6(Wt(i,function(o){return e.node(o).height}));at(i,function(o){e.node(o).y=n+a/2}),n+=a+r})}function X8e(e,t){var r=Ugt;r("layout",()=>{var n=r(" buildLayoutGraph",()=>ivt(e));r(" runLayout",()=>Wmt(n,r)),r(" updateInputGraph",()=>jmt(e,n))})}function Wmt(e,t){t(" makeSpaceForEdgeLabels",()=>avt(e)),t(" removeSelfEdges",()=>pvt(e)),t(" acyclic",()=>kgt(e)),t(" nestingGraph.run",()=>umt(e)),t(" rank",()=>smt(L8e(e))),t(" injectEdgeLabelProxies",()=>ovt(e)),t(" removeEmptyRanks",()=>Vgt(e)),t(" nestingGraph.cleanup",()=>fmt(e)),t(" normalizeRanks",()=>Fgt(e)),t(" assignRankMinMax",()=>svt(e)),t(" removeEdgeLabelProxies",()=>lvt(e)),t(" normalize.run",()=>jgt(e)),t(" parentDummyChains",()=>Omt(e)),t(" addBorderSegments",()=>Ggt(e)),t(" order",()=>Amt(e)),t(" insertSelfEdges",()=>Tvt(e)),t(" adjustCoordinateSystem",()=>zgt(e)),t(" position",()=>qmt(e)),t(" positionSelfEdges",()=>gvt(e)),t(" removeBorderNodes",()=>fvt(e)),t(" normalize.undo",()=>Kgt(e)),t(" fixupEdgeLabelCoords",()=>dvt(e)),t(" undoCoordinateSystem",()=>qgt(e)),t(" translateGraph",()=>cvt(e)),t(" assignNodeIntersects",()=>uvt(e)),t(" reversePoints",()=>hvt(e)),t(" acyclic.undo",()=>Hgt(e))}function jmt(e,t){at(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),at(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Xmt=["nodesep","edgesep","ranksep","marginx","marginy"],Kmt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Zmt=["acyclicer","ranker","rankdir","align"],Jmt=["width","height"],evt={width:0,height:0},tvt=["minlen","weight","width","height","labeloffset"],rvt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nvt=["labelpos"];function ivt(e){var t=new Js({multigraph:!0,compound:!0}),r=jB(e.graph());return t.setGraph(G_({},Kmt,WB(r,Xmt),z_(r,Zmt))),at(e.nodes(),function(n){var i=jB(e.node(n));t.setNode(n,F_(WB(i,Jmt),evt)),t.setParent(n,e.parent(n))}),at(e.edges(),function(n){var i=jB(e.edge(n));t.setEdge(n,G_({},rvt,WB(i,tvt),z_(i,nvt)))}),t}function avt(e){var t=e.graph();t.ranksep/=2,at(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function ovt(e){at(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};l7(e,"edge-proxy",a,"_ep")}})}function svt(e){var t=0;at(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=O6(t,n.maxRank))}),e.graph().maxRank=t}function lvt(e){at(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function cvt(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function l(u){var d=u.x,h=u.y,f=u.width,p=u.height;t=Math.min(t,d-f/2),r=Math.max(r,d+f/2),n=Math.min(n,h-p/2),i=Math.max(i,h+p/2)}at(e.nodes(),function(u){l(e.node(u))}),at(e.edges(),function(u){var d=e.edge(u);Object.prototype.hasOwnProperty.call(d,"x")&&l(d)}),t-=o,n-=s,at(e.nodes(),function(u){var d=e.node(u);d.x-=t,d.y-=n}),at(e.edges(),function(u){var d=e.edge(u);at(d.points,function(h){h.x-=t,h.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=t),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-t+o,a.height=i-n+s}function uvt(e){at(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),i=e.node(t.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(A8e(n,a)),r.points.push(A8e(i,o))})}function dvt(e){at(e.edges(),function(t){var r=e.edge(t);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function hvt(e){at(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function fvt(e){at(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(w2(r.borderLeft)),o=e.node(w2(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),at(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function pvt(e){at(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Tvt(e){var t=Ex(e);at(t,function(r){var n=0;at(r,function(i,a){var o=e.node(i);o.order=a+n,at(o.selfEdges,function(s){l7(e,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:a+ ++n,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function gvt(e){at(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,s=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],r.label.x=r.x,r.label.y=r.y}})}function WB(e,t){return U_(z_(e,t),Number)}function jB(e){var t={};return at(e,function(r,n){t[n.toLowerCase()]=r}),t}function Z2(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:mvt(e),edges:vvt(e)};return Hn(e.graph())||(t.value=wa(e.graph())),t}function mvt(e){return Wt(e.nodes(),function(t){var r=e.node(t),n=e.parent(t),i={v:t};return Hn(r)||(i.value=r),Hn(n)||(i.parent=n),i})}function vvt(e){return Wt(e.edges(),function(t){var r=e.edge(t),n={v:t.v,w:t.w};return Hn(t.name)||(n.name=t.name),Hn(r)||(n.value=r),n})}var an=new Map,pd=new Map,K8e=new Map,yvt=O(()=>{pd.clear(),K8e.clear(),an.clear()},"clear"),xx=O((e,t)=>{const r=pd.get(t)||[];return ge.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),_vt=O((e,t)=>{const r=pd.get(t)||[];return ge.info("Descendants of ",t," is ",r),ge.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||xx(e.v,t)||xx(e.w,t)||r.includes(e.w):(ge.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),Z8e=O((e,t,r,n)=>{ge.warn("Copying children of ",e,"root",n,"data",t.node(e),n);const i=t.children(e)||[];e!==n&&i.push(e),ge.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)Z8e(a,t,r,n);else{const o=t.node(a);ge.info("cp ",a," to ",n," with parent ",e),r.setNode(a,o),n!==t.parent(a)&&(ge.warn("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==n&&a!==e?(ge.debug("Setting parent",a,e),r.setParent(a,e)):(ge.info("In copy ",e,"root",n,"data",t.node(e),n),ge.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==n,"node!==clusterId",a!==e));const s=t.edges(a);ge.debug("Copying Edges",s),s.forEach(l=>{ge.info("Edge",l);const u=t.edge(l.v,l.w,l.name);ge.info("Edge data",u,n);try{_vt(l,n)?(ge.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ge.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):ge.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",e)}catch(d){ge.error(d)}})}ge.debug("Removing node",a),t.removeNode(a)})},"copy"),J8e=O((e,t)=>{const r=t.children(e);let n=[...r];for(const i of r)K8e.set(i,e),n=[...n,...J8e(i,t)];return n},"extractDescendants"),Qvt=O((e,t,r)=>{const n=e.edges().filter(l=>l.v===t||l.w===t),i=e.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===t?r:l.v,w:l.w===t?t:l.w})),o=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>o.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),wm=O((e,t,r)=>{const n=t.children(e);if(ge.trace("Searching children of id ",e,n),n.length<1)return e;let i;for(const a of n){const o=wm(a,t,r),s=Qvt(t,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),eTe=O(e=>!an.has(e)||!an.get(e).externalConnections?e:an.has(e)?an.get(e).id:e,"getAnchorId"),bvt=O((e,t)=>{if(!e||t>10){ge.debug("Opting out, no graph ");return}else ge.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(ge.warn("Cluster identified",r," Replacement id in edges: ",wm(r,e,r)),pd.set(r,J8e(r,e)),an.set(r,{id:wm(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const n=e.children(r),i=e.edges();n.length>0?(ge.debug("Cluster identified",r,pd),i.forEach(a=>{const o=xx(a.v,r),s=xx(a.w,r);o^s&&(ge.warn("Edge: ",a," leaves cluster ",r),ge.warn("Descendants of XXX ",r,": ",pd.get(r)),an.get(r).externalConnections=!0)})):ge.debug("Not a cluster ",r,pd)});for(let r of an.keys()){const n=an.get(r).id,i=e.parent(n);i!==r&&an.has(i)&&!an.get(i).externalConnections&&(an.get(r).id=i)}e.edges().forEach(function(r){const n=e.edge(r);ge.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),ge.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let i=r.v,a=r.w;if(ge.warn("Fix XXX",an,"ids:",r.v,r.w,"Translating: ",an.get(r.v)," --- ",an.get(r.w)),an.get(r.v)||an.get(r.w)){if(ge.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=eTe(r.v),a=eTe(r.w),e.removeEdge(r.v,r.w,r.name),i!==r.v){const o=e.parent(i);an.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const o=e.parent(a);an.get(o).externalConnections=!0,n.toCluster=r.w}ge.warn("Fix Replacing with XXX",i,a,r.name),e.setEdge(i,a,n,r.name)}}),ge.warn("Adjusted Graph",Z2(e)),tTe(e,0),ge.trace(an)},"adjustClustersAndEdges"),tTe=O((e,t)=>{var i,a;if(ge.warn("extractor - ",t,Z2(e),e.children("D")),t>10){ge.error("Bailing out");return}let r=e.nodes(),n=!1;for(const o of r){const s=e.children(o);n=n||s.length>0}if(!n){ge.debug("Done, no node has children",e.nodes());return}ge.debug("Nodes = ",r,t);for(const o of r)if(ge.debug("Extracting node",o,an,an.has(o)&&!an.get(o).externalConnections,!e.parent(o),e.node(o),e.children("D")," Depth ",t),!an.has(o))ge.debug("Not a cluster",o,t);else if(!an.get(o).externalConnections&&e.children(o)&&e.children(o).length>0){ge.warn("Cluster without external connections, without a parent and with children",o,t);let l=e.graph().rankdir==="TB"?"LR":"TB";(a=(i=an.get(o))==null?void 0:i.clusterData)!=null&&a.dir&&(l=an.get(o).clusterData.dir,ge.warn("Fixing dir",an.get(o).clusterData.dir,l));const u=new Js({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});ge.warn("Old graph before copy",Z2(e)),Z8e(o,e,u,o),e.setNode(o,{clusterNode:!0,id:o,clusterData:an.get(o).clusterData,label:an.get(o).label,graph:u}),ge.warn("New graph after copy node: (",o,")",Z2(u)),ge.debug("Old graph after copy",Z2(e))}else ge.warn("Cluster ** ",o," **not meeting the criteria !externalConnections:",!an.get(o).externalConnections," no parent: ",!e.parent(o)," children ",e.children(o)&&e.children(o).length>0,e.children("D"),t),ge.debug(an);r=e.nodes(),ge.warn("New list of nodes",r);for(const o of r){const s=e.node(o);ge.warn(" Now next level",o,s),s!=null&&s.clusterNode&&tTe(s.graph,t+1)}},"extractor"),rTe=O((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(n=>{const i=e.children(n),a=rTe(e,i);r=[...r,...a]}),r},"sorter"),Evt=O(e=>rTe(e,e.children()),"sortNodesByHierarchy"),nTe=O(async(e,t,r,n,i,a)=>{ge.warn("Graph in recursive render:XAX",Z2(t),i);const o=t.graph().rankdir;ge.trace("Dir in recursive render - dir:",o);const s=e.insert("g").attr("class","root");t.nodes()?ge.info("Recursive render XXX",t.nodes()):ge.info("No nodes found for",t),t.edges().length>0&&ge.info("Recursive edges",t.edge(t.edges()[0]));const l=s.insert("g").attr("class","clusters"),u=s.insert("g").attr("class","edgePaths"),d=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(g){const v=t.node(g);if(i!==void 0){const m=JSON.parse(JSON.stringify(i.clusterData));ge.trace(`Setting data for parent cluster XXX
891
891
  Node.id = `,g,`
892
892
  data=`,m.height,`
893
893
  Parent cluster`,i.height),t.setNode(i.id,m),t.parent(g)||(ge.trace("Setting parent",g,i.id),t.setParent(g,i.id,m))}if(ge.info("(Insert) Node XXX"+g+": "+JSON.stringify(t.node(g))),v!=null&&v.clusterNode){ge.info("Cluster identified XBX",g,v.width,t.node(g));const{ranksep:m,nodesep:y}=t.graph();v.graph.setGraph({...v.graph.graph(),ranksep:m+25,nodesep:y});const _=await nTe(h,v.graph,r,n,t.node(g),a),E=_.elem;yr(v,E),v.diff=_.diff||0,ge.info("New compound node after recursive render XAX",g,"width",v.width,"height",v.height),$st(E,v)}else t.children(g).length>0?(ge.trace("Cluster - the non recursive path XBX",g,v.id,v,v.width,"Graph:",t),ge.trace(wm(v.id,t)),an.set(v.id,{id:wm(v.id,t),node:v})):(ge.trace("Node - the non recursive path XAX",g,h,t.node(g),o),await ME(h,t.node(g),{config:a,dir:o}))})),await O(async()=>{const g=t.edges().map(async function(v){const m=t.edge(v.v,v.w,v.name);ge.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),ge.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(t.edge(v))),ge.info("Fix",an,"ids:",v.v,v.w,"Translating: ",an.get(v.v),an.get(v.w)),await Cue(d,m)});await Promise.all(g)},"processEdges")(),ge.info("Graph before layout:",JSON.stringify(Z2(t))),ge.info("############################################# XXX"),ge.info("### Layout ### XXX"),ge.info("############################################# XXX"),X8e(t),ge.info("Graph after layout:",JSON.stringify(Z2(t)));let p=0,{subGraphTitleTotalMargin:T}=NT(a);return await Promise.all(Evt(t).map(async function(g){var m;const v=t.node(g);if(ge.info("Position XBX => "+g+": ("+v.x,","+v.y,") width: ",v.width," height: ",v.height),v!=null&&v.clusterNode)v.y+=T,ge.info("A tainted cluster node XBX1",g,v.id,v.width,v.height,v.x,v.y,t.parent(g)),an.get(v.id).node=v,WP(v);else if(t.children(g).length>0){ge.info("A pure cluster node XBX1",g,v.id,v.x,v.y,v.width,v.height,t.parent(g)),v.height+=T,t.node(v.parentId);const y=(v==null?void 0:v.padding)/2||0,_=((m=v==null?void 0:v.labelBBox)==null?void 0:m.height)||0,E=_-y||0;ge.debug("OffsetY",E,"labelHeight",_,"halfPadding",y),await GP(l,v),an.get(v.id).node=v}else{const y=t.node(v.parentId);v.y+=T/2,ge.info("A regular node XBX1 - using the padding",v.id,"parent",v.parentId,v.width,v.height,v.x,v.y,"offsetY",v.offsetY,"parent",y,y==null?void 0:y.offsetY,v),WP(v)}})),t.edges().forEach(function(g){const v=t.edge(g);ge.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(v),v),v.points.forEach(E=>E.y+=T/2);const m=t.node(g.v);var y=t.node(g.w);const _=Rue(u,v,an,r,m,y,n);Lue(v,_)}),t.nodes().forEach(function(g){const v=t.node(g);ge.info(g,v.type,v.diff),v.isGroup&&(p=v.diff)}),ge.warn("Returning from recursive render XAX",s,p),{elem:s,diff:p}},"recursiveRender"),xvt=O(async(e,t)=>{var a,o,s,l,u,d;const r=new Js({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((a=e.config)==null?void 0:a.nodeSpacing)||((s=(o=e.config)==null?void 0:o.flowchart)==null?void 0:s.nodeSpacing)||e.nodeSpacing,ranksep:((l=e.config)==null?void 0:l.rankSpacing)||((d=(u=e.config)==null?void 0:u.flowchart)==null?void 0:d.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=t.select("g");Nue(n,e.markers,e.type,e.diagramId),Ust(),qst(),Est(),yvt(),e.nodes.forEach(h=>{r.setNode(h.id,{...h}),h.parentId&&r.setParent(h.id,h.parentId)}),ge.debug("Edges:",e.edges),e.edges.forEach(h=>{if(h.start===h.end){const f=h.start,p=f+"---"+f+"---1",T=f+"---"+f+"---2",g=r.node(f);r.setNode(p,{domId:p,id:p,parentId:g.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,g.parentId),r.setNode(T,{domId:T,id:T,parentId:g.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(T,g.parentId);const v=structuredClone(h),m=structuredClone(h),y=structuredClone(h);v.label="",v.arrowTypeEnd="none",v.id=f+"-cyclic-special-1",m.arrowTypeStart="none",m.arrowTypeEnd="none",m.id=f+"-cyclic-special-mid",y.label="",g.isGroup&&(v.fromCluster=f,y.toCluster=f),y.id=f+"-cyclic-special-2",y.arrowTypeStart="none",r.setEdge(f,p,v,f+"-cyclic-special-0"),r.setEdge(p,T,m,f+"-cyclic-special-1"),r.setEdge(T,f,y,f+"-cyc<lic-special-2")}else r.setEdge(h.start,h.end,{...h},h.id)}),ge.warn("Graph at first:",JSON.stringify(Z2(r))),bvt(r),ge.warn("Graph after XAX:",JSON.stringify(Z2(r)));const i=Ue();await nTe(n,r,e.type,e.diagramId,void 0,i)},"render");const Svt=Object.freeze(Object.defineProperty({__proto__:null,render:xvt},Symbol.toStringTag,{value:"Module"}));var Sx=O((e,t)=>{const r=e.append("rect");if(r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),t.name&&r.attr("name",t.name),t.rx&&r.attr("rx",t.rx),t.ry&&r.attr("ry",t.ry),t.attrs!==void 0)for(const n in t.attrs)r.attr(n,t.attrs[n]);return t.class&&r.attr("class",t.class),r},"drawRect"),iTe=O((e,t)=>{const r={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};Sx(e,r).lower()},"drawBackgroundRect"),Cvt=O((e,t)=>{const r=t.text.replace(Tf," "),n=e.append("text");n.attr("x",t.x),n.attr("y",t.y),n.attr("class","legend"),n.style("text-anchor",t.anchor),t.class&&n.attr("class",t.class);const i=n.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(r),n},"drawText"),Lvt=O((e,t,r,n)=>{const i=e.append("image");i.attr("x",t),i.attr("y",r);const a=W6.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),Avt=O((e,t,r,n)=>{const i=e.append("use");i.attr("x",t),i.attr("y",r);const a=W6.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Td=O(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),XB=O(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Cx=function(){var e=O(function(rt,ze,tt,Qe){for(tt=tt||{},Qe=rt.length;Qe--;tt[rt[Qe]]=ze);return tt},"o"),t=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],o=[1,63],s=[1,64],l=[1,65],u=[1,66],d=[1,67],h=[1,68],f=[1,69],p=[1,29],T=[1,30],g=[1,31],v=[1,32],m=[1,33],y=[1,34],_=[1,35],E=[1,36],Q=[1,37],b=[1,38],x=[1,39],S=[1,40],C=[1,41],A=[1,42],w=[1,43],N=[1,44],P=[1,45],R=[1,46],M=[1,47],H=[1,48],F=[1,50],k=[1,51],V=[1,52],B=[1,53],$=[1,54],z=[1,55],G=[1,56],J=[1,57],ie=[1,58],re=[1,59],j=[1,60],oe=[14,42],ee=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],X=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],te=[1,82],K=[1,83],ae=[1,84],le=[1,85],se=[12,14,42],Oe=[12,14,33,42],fe=[12,14,33,42,76,77,79,80],ue=[12,33],Pe=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],xe={trace:O(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:O(function(ze,tt,Qe,Ne,Ye,Ee,je){var ce=Ee.length-1;switch(Ye){case 3:Ne.setDirection("TB");break;case 4:Ne.setDirection("BT");break;case 5:Ne.setDirection("RL");break;case 6:Ne.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:Ne.setC4Type(Ee[ce-3]);break;case 19:Ne.setTitle(Ee[ce].substring(6)),this.$=Ee[ce].substring(6);break;case 20:Ne.setAccDescription(Ee[ce].substring(15)),this.$=Ee[ce].substring(15);break;case 21:this.$=Ee[ce].trim(),Ne.setTitle(this.$);break;case 22:case 23:this.$=Ee[ce].trim(),Ne.setAccDescription(this.$);break;case 28:Ee[ce].splice(2,0,"ENTERPRISE"),Ne.addPersonOrSystemBoundary(...Ee[ce]),this.$=Ee[ce];break;case 29:Ee[ce].splice(2,0,"SYSTEM"),Ne.addPersonOrSystemBoundary(...Ee[ce]),this.$=Ee[ce];break;case 30:Ne.addPersonOrSystemBoundary(...Ee[ce]),this.$=Ee[ce];break;case 31:Ee[ce].splice(2,0,"CONTAINER"),Ne.addContainerBoundary(...Ee[ce]),this.$=Ee[ce];break;case 32:Ne.addDeploymentNode("node",...Ee[ce]),this.$=Ee[ce];break;case 33:Ne.addDeploymentNode("nodeL",...Ee[ce]),this.$=Ee[ce];break;case 34:Ne.addDeploymentNode("nodeR",...Ee[ce]),this.$=Ee[ce];break;case 35:Ne.popBoundaryParseStack();break;case 39:Ne.addPersonOrSystem("person",...Ee[ce]),this.$=Ee[ce];break;case 40:Ne.addPersonOrSystem("external_person",...Ee[ce]),this.$=Ee[ce];break;case 41:Ne.addPersonOrSystem("system",...Ee[ce]),this.$=Ee[ce];break;case 42:Ne.addPersonOrSystem("system_db",...Ee[ce]),this.$=Ee[ce];break;case 43:Ne.addPersonOrSystem("system_queue",...Ee[ce]),this.$=Ee[ce];break;case 44:Ne.addPersonOrSystem("external_system",...Ee[ce]),this.$=Ee[ce];break;case 45:Ne.addPersonOrSystem("external_system_db",...Ee[ce]),this.$=Ee[ce];break;case 46:Ne.addPersonOrSystem("external_system_queue",...Ee[ce]),this.$=Ee[ce];break;case 47:Ne.addContainer("container",...Ee[ce]),this.$=Ee[ce];break;case 48:Ne.addContainer("container_db",...Ee[ce]),this.$=Ee[ce];break;case 49:Ne.addContainer("container_queue",...Ee[ce]),this.$=Ee[ce];break;case 50:Ne.addContainer("external_container",...Ee[ce]),this.$=Ee[ce];break;case 51:Ne.addContainer("external_container_db",...Ee[ce]),this.$=Ee[ce];break;case 52:Ne.addContainer("external_container_queue",...Ee[ce]),this.$=Ee[ce];break;case 53:Ne.addComponent("component",...Ee[ce]),this.$=Ee[ce];break;case 54:Ne.addComponent("component_db",...Ee[ce]),this.$=Ee[ce];break;case 55:Ne.addComponent("component_queue",...Ee[ce]),this.$=Ee[ce];break;case 56:Ne.addComponent("external_component",...Ee[ce]),this.$=Ee[ce];break;case 57:Ne.addComponent("external_component_db",...Ee[ce]),this.$=Ee[ce];break;case 58:Ne.addComponent("external_component_queue",...Ee[ce]),this.$=Ee[ce];break;case 60:Ne.addRel("rel",...Ee[ce]),this.$=Ee[ce];break;case 61:Ne.addRel("birel",...Ee[ce]),this.$=Ee[ce];break;case 62:Ne.addRel("rel_u",...Ee[ce]),this.$=Ee[ce];break;case 63:Ne.addRel("rel_d",...Ee[ce]),this.$=Ee[ce];break;case 64:Ne.addRel("rel_l",...Ee[ce]),this.$=Ee[ce];break;case 65:Ne.addRel("rel_r",...Ee[ce]),this.$=Ee[ce];break;case 66:Ne.addRel("rel_b",...Ee[ce]),this.$=Ee[ce];break;case 67:Ee[ce].splice(0,1),Ne.addRel("rel",...Ee[ce]),this.$=Ee[ce];break;case 68:Ne.updateElStyle("update_el_style",...Ee[ce]),this.$=Ee[ce];break;case 69:Ne.updateRelStyle("update_rel_style",...Ee[ce]),this.$=Ee[ce];break;case 70:Ne.updateLayoutConfig("update_layout_config",...Ee[ce]),this.$=Ee[ce];break;case 71:this.$=[Ee[ce]];break;case 72:Ee[ce].unshift(Ee[ce-1]),this.$=Ee[ce];break;case 73:case 75:this.$=Ee[ce].trim();break;case 74:let _e={};_e[Ee[ce-1].trim()]=Ee[ce].trim(),this.$=_e;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:T,46:g,47:v,48:m,49:y,50:_,51:E,52:Q,53:b,54:x,55:S,56:C,57:A,58:w,59:N,60:P,61:R,62:M,63:H,64:F,65:k,66:V,67:B,68:$,69:z,70:G,71:J,72:ie,73:re,74:j},{13:70,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:T,46:g,47:v,48:m,49:y,50:_,51:E,52:Q,53:b,54:x,55:S,56:C,57:A,58:w,59:N,60:P,61:R,62:M,63:H,64:F,65:k,66:V,67:B,68:$,69:z,70:G,71:J,72:ie,73:re,74:j},{13:71,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:T,46:g,47:v,48:m,49:y,50:_,51:E,52:Q,53:b,54:x,55:S,56:C,57:A,58:w,59:N,60:P,61:R,62:M,63:H,64:F,65:k,66:V,67:B,68:$,69:z,70:G,71:J,72:ie,73:re,74:j},{13:72,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:T,46:g,47:v,48:m,49:y,50:_,51:E,52:Q,53:b,54:x,55:S,56:C,57:A,58:w,59:N,60:P,61:R,62:M,63:H,64:F,65:k,66:V,67:B,68:$,69:z,70:G,71:J,72:ie,73:re,74:j},{13:73,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:T,46:g,47:v,48:m,49:y,50:_,51:E,52:Q,53:b,54:x,55:S,56:C,57:A,58:w,59:N,60:P,61:R,62:M,63:H,64:F,65:k,66:V,67:B,68:$,69:z,70:G,71:J,72:ie,73:re,74:j},{14:[1,74]},e(oe,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:s,37:l,38:u,39:d,40:h,41:f,44:p,45:T,46:g,47:v,48:m,49:y,50:_,51:E,52:Q,53:b,54:x,55:S,56:C,57:A,58:w,59:N,60:P,61:R,62:M,63:H,64:F,65:k,66:V,67:B,68:$,69:z,70:G,71:J,72:ie,73:re,74:j}),e(oe,[2,14]),e(ee,[2,16],{12:[1,76]}),e(oe,[2,36],{12:[1,77]}),e(X,[2,19]),e(X,[2,20]),{25:[1,78]},{27:[1,79]},e(X,[2,23]),{35:80,75:81,76:te,77:K,79:ae,80:le},{35:86,75:81,76:te,77:K,79:ae,80:le},{35:87,75:81,76:te,77:K,79:ae,80:le},{35:88,75:81,76:te,77:K,79:ae,80:le},{35:89,75:81,76:te,77:K,79:ae,80:le},{35:90,75:81,76:te,77:K,79:ae,80:le},{35:91,75:81,76:te,77:K,79:ae,80:le},{35:92,75:81,76:te,77:K,79:ae,80:le},{35:93,75:81,76:te,77:K,79:ae,80:le},{35:94,75:81,76:te,77:K,79:ae,80:le},{35:95,75:81,76:te,77:K,79:ae,80:le},{35:96,75:81,76:te,77:K,79:ae,80:le},{35:97,75:81,76:te,77:K,79:ae,80:le},{35:98,75:81,76:te,77:K,79:ae,80:le},{35:99,75:81,76:te,77:K,79:ae,80:le},{35:100,75:81,76:te,77:K,79:ae,80:le},{35:101,75:81,76:te,77:K,79:ae,80:le},{35:102,75:81,76:te,77:K,79:ae,80:le},{35:103,75:81,76:te,77:K,79:ae,80:le},{35:104,75:81,76:te,77:K,79:ae,80:le},e(se,[2,59]),{35:105,75:81,76:te,77:K,79:ae,80:le},{35:106,75:81,76:te,77:K,79:ae,80:le},{35:107,75:81,76:te,77:K,79:ae,80:le},{35:108,75:81,76:te,77:K,79:ae,80:le},{35:109,75:81,76:te,77:K,79:ae,80:le},{35:110,75:81,76:te,77:K,79:ae,80:le},{35:111,75:81,76:te,77:K,79:ae,80:le},{35:112,75:81,76:te,77:K,79:ae,80:le},{35:113,75:81,76:te,77:K,79:ae,80:le},{35:114,75:81,76:te,77:K,79:ae,80:le},{35:115,75:81,76:te,77:K,79:ae,80:le},{20:116,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:T,46:g,47:v,48:m,49:y,50:_,51:E,52:Q,53:b,54:x,55:S,56:C,57:A,58:w,59:N,60:P,61:R,62:M,63:H,64:F,65:k,66:V,67:B,68:$,69:z,70:G,71:J,72:ie,73:re,74:j},{12:[1,118],33:[1,117]},{35:119,75:81,76:te,77:K,79:ae,80:le},{35:120,75:81,76:te,77:K,79:ae,80:le},{35:121,75:81,76:te,77:K,79:ae,80:le},{35:122,75:81,76:te,77:K,79:ae,80:le},{35:123,75:81,76:te,77:K,79:ae,80:le},{35:124,75:81,76:te,77:K,79:ae,80:le},{35:125,75:81,76:te,77:K,79:ae,80:le},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(oe,[2,15]),e(ee,[2,17],{21:22,19:130,22:t,23:r,24:n,26:i,28:a}),e(oe,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:r,24:n,26:i,28:a,34:o,36:s,37:l,38:u,39:d,40:h,41:f,44:p,45:T,46:g,47:v,48:m,49:y,50:_,51:E,52:Q,53:b,54:x,55:S,56:C,57:A,58:w,59:N,60:P,61:R,62:M,63:H,64:F,65:k,66:V,67:B,68:$,69:z,70:G,71:J,72:ie,73:re,74:j}),e(X,[2,21]),e(X,[2,22]),e(se,[2,39]),e(Oe,[2,71],{75:81,35:132,76:te,77:K,79:ae,80:le}),e(fe,[2,73]),{78:[1,133]},e(fe,[2,75]),e(fe,[2,76]),e(se,[2,40]),e(se,[2,41]),e(se,[2,42]),e(se,[2,43]),e(se,[2,44]),e(se,[2,45]),e(se,[2,46]),e(se,[2,47]),e(se,[2,48]),e(se,[2,49]),e(se,[2,50]),e(se,[2,51]),e(se,[2,52]),e(se,[2,53]),e(se,[2,54]),e(se,[2,55]),e(se,[2,56]),e(se,[2,57]),e(se,[2,58]),e(se,[2,60]),e(se,[2,61]),e(se,[2,62]),e(se,[2,63]),e(se,[2,64]),e(se,[2,65]),e(se,[2,66]),e(se,[2,67]),e(se,[2,68]),e(se,[2,69]),e(se,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(ue,[2,28]),e(ue,[2,29]),e(ue,[2,30]),e(ue,[2,31]),e(ue,[2,32]),e(ue,[2,33]),e(ue,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(ee,[2,18]),e(oe,[2,38]),e(Oe,[2,72]),e(fe,[2,74]),e(se,[2,24]),e(se,[2,35]),e(Pe,[2,25]),e(Pe,[2,26],{12:[1,138]}),e(Pe,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:O(function(ze,tt){if(tt.recoverable)this.trace(ze);else{var Qe=new Error(ze);throw Qe.hash=tt,Qe}},"parseError"),parse:O(function(ze){var tt=this,Qe=[0],Ne=[],Ye=[null],Ee=[],je=this.table,ce="",_e=0,Y=0,me=2,Te=1,Se=Ee.slice.call(arguments,1),Ce=Object.create(this.lexer),ke={yy:{}};for(var $e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$e)&&(ke.yy[$e]=this.yy[$e]);Ce.setInput(ze,ke.yy),ke.yy.lexer=Ce,ke.yy.parser=this,typeof Ce.yylloc>"u"&&(Ce.yylloc={});var Ie=Ce.yylloc;Ee.push(Ie);var ht=Ce.options&&Ce.options.ranges;typeof ke.yy.parseError=="function"?this.parseError=ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Et(Rt){Qe.length=Qe.length-2*Rt,Ye.length=Ye.length-Rt,Ee.length=Ee.length-Rt}O(Et,"popStack");function gt(){var Rt;return Rt=Ne.pop()||Ce.lex()||Te,typeof Rt!="number"&&(Rt instanceof Array&&(Ne=Rt,Rt=Ne.pop()),Rt=tt.symbols_[Rt]||Rt),Rt}O(gt,"lex");for(var be,Ge,Fe,lt,Ot={},St,Ke,pt,it;;){if(Ge=Qe[Qe.length-1],this.defaultActions[Ge]?Fe=this.defaultActions[Ge]:((be===null||typeof be>"u")&&(be=gt()),Fe=je[Ge]&&je[Ge][be]),typeof Fe>"u"||!Fe.length||!Fe[0]){var yt="";it=[];for(St in je[Ge])this.terminals_[St]&&St>me&&it.push("'"+this.terminals_[St]+"'");Ce.showPosition?yt="Parse error on line "+(_e+1)+`:
@@ -1,4 +1,4 @@
1
- import { $ as ln, a0 as an, a1 as y, a2 as tn, a3 as G, a4 as q, a5 as _, a6 as un, a7 as z, a8 as rn, a9 as K, aa as o, ab as sn, ac as on, ad as fn } from "./index-DIxA_42a.mjs";
1
+ import { $ as ln, a0 as an, a1 as y, a2 as tn, a3 as G, a4 as q, a5 as _, a6 as un, a7 as z, a8 as rn, a9 as K, aa as o, ab as sn, ac as on, ad as fn } from "./index-Cp05Y3Eg.mjs";
2
2
  function cn(l) {
3
3
  return l.innerRadius;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { A as c, e as t } from "./mermaid-parser.core-D9-47Nfi.mjs";
1
+ import { A as c, e as t } from "./mermaid-parser.core-lHmBsMbr.mjs";
2
2
  export {
3
3
  c as ArchitectureModule,
4
4
  t as createArchitectureServices
@@ -1,7 +1,7 @@
1
- import { aI as qe, _ as nt, g as Je, s as Qe, a as Ke, b as je, q as _e, p as tr, H as er, U as rr, y as ir, l as Pe, aj as Le, c as ge, aJ as me, d as ar, F as nr, aK as or, aL as sr } from "./index-DIxA_42a.mjs";
2
- import { p as hr } from "./chunk-4BMEZGHF-uzgZ2L_n.mjs";
3
- import { I as lr } from "./chunk-XZIHB7SX-CybnO1Hd.mjs";
4
- import { p as fr } from "./mermaid-parser.core-D9-47Nfi.mjs";
1
+ import { aI as qe, _ as nt, g as Je, s as Qe, a as Ke, b as je, q as _e, p as tr, H as er, U as rr, y as ir, l as Pe, aj as Le, c as ge, aJ as me, d as ar, F as nr, aK as or, aL as sr } from "./index-Cp05Y3Eg.mjs";
2
+ import { p as hr } from "./chunk-4BMEZGHF-QHCkbkxt.mjs";
3
+ import { I as lr } from "./chunk-XZIHB7SX-B5Ijj4qi.mjs";
4
+ import { p as fr } from "./mermaid-parser.core-lHmBsMbr.mjs";
5
5
  import { c as Ge } from "./cytoscape.esm-D1A2YP3J.mjs";
6
6
  var le = { exports: {} }, fe = { exports: {} }, ce = { exports: {} }, cr = ce.exports, xe;
7
7
  function ur() {
@@ -1,7 +1,7 @@
1
- import { _ as d, E as at, d as R, e as de, l as L, y as ge, A as ue, c as z, ah as pe, Q as fe, R as xe, ai as Z, aj as Yt, ak as ye, u as tt, k as be, al as we, am as xt, an as me, i as Tt } from "./index-DIxA_42a.mjs";
2
- import { c as Le } from "./clone-KFWgjcn5.mjs";
3
- import { G as Se } from "./graph-B5acxDmH.mjs";
4
- import { c as ve } from "./channel-DLHWfhRv.mjs";
1
+ import { _ as d, E as at, d as R, e as de, l as L, y as ge, A as ue, c as z, ah as pe, Q as fe, R as xe, ai as Z, aj as Yt, ak as ye, u as tt, k as be, al as we, am as xt, an as me, i as Tt } from "./index-Cp05Y3Eg.mjs";
2
+ import { c as Le } from "./clone-fvQ93sYM.mjs";
3
+ import { G as Se } from "./graph-rBJ9WWwQ.mjs";
4
+ import { c as ve } from "./channel-DR2YZxUc.mjs";
5
5
  var yt = function() {
6
6
  var e = /* @__PURE__ */ d(function(N, x, g, u) {
7
7
  for (g = g || {}, u = N.length; u--; g[N[u]] = x) ;
@@ -1,5 +1,5 @@
1
- import { g as Se, d as De } from "./chunk-D6G4REZN-D1yLjpUx.mjs";
2
- import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./index-DIxA_42a.mjs";
1
+ import { g as Se, d as De } from "./chunk-D6G4REZN-1n5GhPIw.mjs";
2
+ import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./index-Cp05Y3Eg.mjs";
3
3
  var Ft = function() {
4
4
  var e = /* @__PURE__ */ g(function(_t, x, m, v) {
5
5
  for (m = m || {}, v = _t.length; v--; m[_t[v]] = x) ;
@@ -1,4 +1,4 @@
1
- import { ao as r, ap as n } from "./index-DIxA_42a.mjs";
1
+ import { ao as r, ap as n } from "./index-Cp05Y3Eg.mjs";
2
2
  const t = (a, o) => r.lang.round(n.parse(a)[o]);
3
3
  export {
4
4
  t as c
@@ -1,4 +1,4 @@
1
- import { _ as l } from "./index-DIxA_42a.mjs";
1
+ import { _ as l } from "./index-Cp05Y3Eg.mjs";
2
2
  function m(e, c) {
3
3
  var i, t, o;
4
4
  e.accDescr && ((i = c.setAccDescription) == null || i.call(c, e.accDescr)), e.accTitle && ((t = c.setAccTitle) == null || t.call(c, e.accTitle)), e.title && ((o = c.setDiagramTitle) == null || o.call(c, e.title));
@@ -1,5 +1,5 @@
1
- import { g as et, s as tt } from "./chunk-RZ5BOZE2-xdRKS4sX.mjs";
2
- import { _ as f, l as Oe, c as F, o as st, r as it, u as we, d as $, b as at, a as nt, s as rt, g as ut, p as lt, q as ct, k as v, y as ot, x as ht, i as dt, P as R } from "./index-DIxA_42a.mjs";
1
+ import { g as et, s as tt } from "./chunk-RZ5BOZE2-BZHe7l6F.mjs";
2
+ import { _ as f, l as Oe, c as F, o as st, r as it, u as we, d as $, b as at, a as nt, s as rt, g as ut, p as lt, q as ct, k as v, y as ot, x as ht, i as dt, P as R } from "./index-Cp05Y3Eg.mjs";
3
3
  var Ve = function() {
4
4
  var s = /* @__PURE__ */ f(function(I, c, h, p) {
5
5
  for (h = h || {}, p = I.length; p--; h[I[p]] = c) ;
@@ -1,8 +1,8 @@
1
1
  var re = Object.defineProperty;
2
2
  var ae = (e, t, s) => t in e ? re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var b = (e, t, s) => ae(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { g as ne, s as le } from "./chunk-RZ5BOZE2-xdRKS4sX.mjs";
5
- import { _ as p, l as v, c as A, r as oe, u as ce, S as he, k as j, y as ue, a as de, b as fe, g as pe, s as Se, p as ye, q as ge } from "./index-DIxA_42a.mjs";
4
+ import { g as ne, s as le } from "./chunk-RZ5BOZE2-BZHe7l6F.mjs";
5
+ import { _ as p, l as v, c as A, r as oe, u as ce, S as he, k as j, y as ue, a as de, b as fe, g as pe, s as Se, p as ye, q as ge } from "./index-Cp05Y3Eg.mjs";
6
6
  var bt = function() {
7
7
  var e = /* @__PURE__ */ p(function(P, l, h, a) {
8
8
  for (h = h || {}, a = P.length; a--; h[P[a]] = l) ;
@@ -1,4 +1,4 @@
1
- import { _ as n, T as o, j as l } from "./index-DIxA_42a.mjs";
1
+ import { _ as n, T as o, j as l } from "./index-Cp05Y3Eg.mjs";
2
2
  var x = /* @__PURE__ */ n((s, t) => {
3
3
  const e = s.append("rect");
4
4
  if (e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), t.name && e.attr("name", t.name), t.rx && e.attr("rx", t.rx), t.ry && e.attr("ry", t.ry), t.attrs !== void 0)
@@ -1,4 +1,4 @@
1
- import { _ as n, d as r, e as d, l as g } from "./index-DIxA_42a.mjs";
1
+ import { _ as n, d as r, e as d, l as g } from "./index-Cp05Y3Eg.mjs";
2
2
  var u = /* @__PURE__ */ n((e, t) => {
3
3
  let o;
4
4
  return t === "sandbox" && (o = r("#i" + e)), (t === "sandbox" ? r(o.nodes()[0].contentDocument.body) : r("body")).select(`[id="${e}"]`);
@@ -1,4 +1,4 @@
1
- import { _ as s } from "./index-DIxA_42a.mjs";
1
+ import { _ as s } from "./index-Cp05Y3Eg.mjs";
2
2
  var t, e = (t = class {
3
3
  /**
4
4
  * @param init - Function that creates the default state.
@@ -1,5 +1,5 @@
1
- import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-ztfHhjDV.mjs";
2
- import { _ as l } from "./index-DIxA_42a.mjs";
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-Dz5kIAS8.mjs";
2
+ import { _ as l } from "./index-Cp05Y3Eg.mjs";
3
3
  var d = {
4
4
  parser: e,
5
5
  get db() {
@@ -1,5 +1,5 @@
1
- import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-ztfHhjDV.mjs";
2
- import { _ as l } from "./index-DIxA_42a.mjs";
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-Dz5kIAS8.mjs";
2
+ import { _ as l } from "./index-Cp05Y3Eg.mjs";
3
3
  var d = {
4
4
  parser: e,
5
5
  get db() {
@@ -1,4 +1,4 @@
1
- import { b as r } from "./reduce-DkrcTnRq.mjs";
1
+ import { b as r } from "./reduce-DnPuHtIq.mjs";
2
2
  var e = 4;
3
3
  function a(o) {
4
4
  return r(o, e);
@@ -1,9 +1,9 @@
1
- import { _ as X, aq as F, ar as Y, as as _, at as H, l as i, c as V, au as q, av as U, af as $, ak as z, ag as P, ae as K, aw as Q, ax as W, ay as Z } from "./index-DIxA_42a.mjs";
2
- import { G as B } from "./graph-B5acxDmH.mjs";
3
- import { l as I } from "./layout-CZ2FJ6Nz.mjs";
4
- import { i as x } from "./reduce-DkrcTnRq.mjs";
5
- import { c as L } from "./clone-KFWgjcn5.mjs";
6
- import { m as A } from "./_basePickBy-B_kocBSO.mjs";
1
+ import { _ as X, aq as F, ar as Y, as as _, at as H, l as i, c as V, au as q, av as U, af as $, ak as z, ag as P, ae as K, aw as Q, ax as W, ay as Z } from "./index-Cp05Y3Eg.mjs";
2
+ import { G as B } from "./graph-rBJ9WWwQ.mjs";
3
+ import { l as I } from "./layout-D4i57JaQ.mjs";
4
+ import { i as x } from "./reduce-DnPuHtIq.mjs";
5
+ import { c as L } from "./clone-fvQ93sYM.mjs";
6
+ import { m as A } from "./_basePickBy-CJPOXTUJ.mjs";
7
7
  function p(e) {
8
8
  var t = {
9
9
  options: {
@@ -1,6 +1,6 @@
1
- import { p as k } from "./chunk-4BMEZGHF-uzgZ2L_n.mjs";
2
- import { _ as l, s as R, g as E, q as F, p as I, a as _, b as D, H as G, y as P, D as f, E as C, F as z, l as H, K as V } from "./index-DIxA_42a.mjs";
3
- import { p as W } from "./mermaid-parser.core-D9-47Nfi.mjs";
1
+ import { p as k } from "./chunk-4BMEZGHF-QHCkbkxt.mjs";
2
+ import { _ as l, s as R, g as E, q as F, p as I, a as _, b as D, H as G, y as P, D as f, E as C, F as z, l as H, K as V } from "./index-Cp05Y3Eg.mjs";
3
+ import { p as W } from "./mermaid-parser.core-lHmBsMbr.mjs";
4
4
  var x = {
5
5
  showLegend: !0,
6
6
  ticks: 5,